| Server IP : 172.67.187.206 / Your IP : 172.71.28.155 Web Server : Apache/2.4.25 (Win32) OpenSSL/1.0.2j PHP/5.6.30 System : Windows NT WIN-ECQAAA40806 6.2 build 9200 (Windows Server 2012 Standard Edition) i586 User : SYSTEM ( 0) PHP Version : 5.6.30 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /Inetpub/www/news/ |
Upload File : |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ศูนย์ข่าวสำนักงานเขตพื้นที่การศึกษามัธยมศึกษาราชบุรี</title>
<link href="bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="bootstrap/css/style.css" rel="stylesheet" >
<script src="bootstrap/js/jquery.min.js"></script>
<script src="bootstrap/js/bootstrap.min.js"></script>
<style type="text/css">
<!--
.well-right-block {
float: none;
display: block;
margin-left: auto;
margin-right:25px;
margin-top: 10px;
height: 65px;
}
.ps1 {
float: none;
display: block;
margin-left: auto;
margin-right: 14%;
margin-top: 22px;
}
.ps2 {
float: none;
display: block;
margin-left: 12%;
}
.myContiner {
max-width: 98%;
margin-left: 25px;
margin-right: auto;
}
-->
</style>
</head>
<body>
<!--Breadcrumbs -->
<ol class="breadcrumb">
<li><a href="index.php"><span class="glyphicon glyphicon-home"></span> Home</a></li>
<li><a href="system">ข้อมูลระบบ</a></li>
<li class="active">ข่าวทั้งหมด</li>
</ol>
<!--End Breadcrumbs -->
<!-- ฟอร์มค้นหา -->
<div class="well well-sm well-right-block" style="width:450px" align="right">
<form action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>" method="GET">
<div class="col-sm-12">
<div class="input-group">
<span class="input-group-addon"><a href="allnews_list2017.php?page=1"><span class="glyphicon glyphicon-home"></span></a></span>
<input type="text" class="form-control" name="keys" placeholder="พิมพ์ข้อความที่ต้องการ"autocomplete="off" style="width:260px;">
<button class="btn btn-info loginbutton" type="submit" ><span class="glyphicon glyphicon-ok-sign"></span> ค้นหา</button>
</div>
</div>
</form>
</div>
<!-- จบฟอร์มค้นหา -->
<?php
error_reporting( error_reporting() & ~E_NOTICE );
include("db.php");
$sql_pic= $mysqli->query("SELECT * FROM photo ");
$total_pic=mysqli_num_rows($sql_pic);
function GetFolderSize($d ="." ) {
// ? kasskooye and patricia benedetto
$h = @opendir($d);
if($h==0)return 0;
while ($f=readdir($h)){
if ( $f!= "..") {
$sf+=filesize($nd=$d."/".$f);
if($f!="."&&is_dir($nd)){
$sf+=GetFolderSize ($nd);
}
}
}
closedir($h);
return $sf ;
}
$folder="myphoto/";
$size_byte= GetFolderSize("$folder") ;
$size_mb=($size_byte/1024)/1024;
$totalsize=number_format($size_mb,2);
$keys = $_GET['keys'];
$url="allnews_list2017.php";
$idpage = $mysqli->escape_string($_GET['page']);
if ($idpage=="" or $idpage<=0) {$idpage=1;}
$rows=25; //แสดงกี่แถวต่อหน้า
$total_data=mysqli_num_rows($mysqli->query("SELECT * FROM `posts` INNER JOIN `users` ON `posts`.`uid` = `users`.`id` where title like '%$keys%' OR school like '%$keys%' OR name like '%$keys%' "));
$total_page=ceil($total_data/$rows);
$start=($idpage-1)*$rows;
?>
<div class="myContiner">
<p><?php if($keys==""){} else { echo "ค้นหาคำว่า :<span class='label label-warning'><font color=red> $keys</font></span>";} ?> ทั้งหมด: <span class="label label-info"><?php echo number_format($total_data); ?></span> รายการ รูปภาพในฐานข้อมูล <span class="label label-info"><?php echo number_format($total_pic); ?> รูป</span> ใช้พื้นที่ไป <span class="label label-info"><?php echo "$totalsize MB"; ?></span>
<a href='https://program.sesaorb.go.th/news/static/' target='_blank'><img src='static/static.png' width='30'><button type="button" class="btn btn-outline-warning btn-sm">รายงาน</button></a>
</p>
</div>
<div class="myContiner">
<table class="table table-hover table-datatable table-striped table-bordered" style="width:98%;">
<thead>
<tr>
<th><center>ลำดับที่</center></th>
<th><center>เรื่อง</center></th>
<th><center>อ่าน</center></th>
<th><center>วันที่</center></th>
<th><center>ผู้เขียน</center></th>
</tr>
</thead>
<tbody>
<?php
$sql= $mysqli->query("SELECT
`posts`.`id`,
`posts`.`title`,
`posts`.`description`,
`posts`.`ppost`,
`posts`.`date`,
`users`.`school`,
`users`.`name`,
`posts`.`views`,
`posts`.`hot`
FROM `posts` INNER JOIN `users` ON `posts`.`uid` = `users`.`id` where title like '%$keys%' OR school like '%$keys%' OR name like '%$keys%' ORDER BY `posts`.`id` DESC Limit $start,$rows");
$i = ($idpage*$rows)-$rows;
while($arr=mysqli_fetch_array($sql)) {
$i++;
?>
<tr>
<td width="70"><center><?=number_format($i); ?></center></td>
<td><a href="story.php?id=<?=$arr['id'] ?>" target="_blank"><?=$arr['title'] ?></a></td>
<td width="60"><center><?=number_format($arr['views']) ?><center></td>
<td width="170"><center><?=$arr['date'] ?></center></td>
<td width="250"><?=$arr['school'] ?></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
<!-- เริ่มแยกหน้า -->
<center>
<nav>
<ul class="pagination">
<li>
<a href="<?php echo $url; ?>?page=1&keys=<?php echo $keys; ?>">
<span aria-hidden="true">หน้าแรก</span>
</a>
</li>
<li <?php if($idpage==1) echo "class='disabled'";?>>
<a href="<?php echo $url; ?>?page=<?php echo $idpage-1; ?>&keys=<?php echo $keys; ?>" aria-label="Previous">
<span aria-hidden="true">«</span>
</a>
</li>
<?php for($i=1;$i<=$total_page;$i++){ ?>
<!-- การย่นหน้า -->
<?php
if ($idpage-2>=2 and ($i>2 and $i< $idpage-2)) {
echo "<li><a href=''>...</a></li>";
$i=$idpage-2;
}
if($idpage+5<=$total_page and ($i>=$idpage+3 and $i<=$total_page - 2)){
echo "<li><a href=''>...</a></li>";
$i=$total_page-1;
}
?>
<!-- จบการย่นหน้า -->
<li <?php if($idpage==$i) echo "class='active'";?>>
<a href="<?php echo $url; ?>?page=<?php echo "$i"; ?>&keys=<?php echo $keys; ?>"> <?php echo $i; ?></a></li>
<?php } ?>
<li <?php if($idpage==$total_page) echo "class='disabled'";?>>
<a href="<?php echo $url; ?>?page=<?php if($idpage>=$total_page) { echo $idpage; } else { echo $idpage+1; } ?>&keys=<?php echo $keys; ?>" aria-label="Next">
<span aria-hidden="true">»</span>
</a>
</li>
<li>
<a href="<?php echo $url; ?>?page=<?php echo $total_page; ?>&keys=<?php echo $keys; ?>">
<span aria-hidden="true">สุดท้าย</span>
</a>
</li>
</ul>
</nav>
</center>
<!-- จบการแยกหน้า -->
<center><span class="label label-warning">[email protected]</span></center><br><br>
</body>
</html>