include("../admin/include/sql.php"); include('../admin/include/page_navigator.php'); $q = "SELECT * FROM guarantee_tb ORDER BY guarantee_id DESC"; $qr=mysql_query($q); $total=mysql_num_rows($qr); $e_page=10; // กำหนด จำนวนรายการที่แสดงในแต่ละหน้า if(!isset($_GET['s_page'])){ $_GET['s_page']=0; }else{ $chk_page=$_GET['s_page']; $_GET['s_page']=$_GET['s_page']*$e_page; } $q.=" LIMIT ".$_GET['s_page'].",$e_page"; $qr=mysql_query($q); $num_rows = mysql_num_rows($qr); if(mysql_num_rows($qr)>=1){ $plus_p=($chk_page*$e_page)+mysql_num_rows($qr); }else{ $plus_p=($chk_page*$e_page); } $total_p=ceil($total/$e_page); $before_p=($chk_page*$e_page)+1; ?>
