本文整理汇总了PHP中pager::findPages方法的典型用法代码示例。如果您正苦于以下问题:PHP pager::findPages方法的具体用法?PHP pager::findPages怎么用?PHP pager::findPages使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pager
的用法示例。
在下文中一共展示了pager::findPages方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: pager
return $page_list;
}
}
?>
<?php
// kết nối CSDL
require 'db.php';
//$ketnoi_maychu = ketnoi_MC();
//chon_CSDL($ketnoi_maychu);
$p = new pager();
$limit = 20;
$start = $p->findStart($limit);
$count = mysql_num_rows(mysql_query("SELECT*FROM gioi_thieu"));
$pages = $p->findPages($count, $limit);
$result = mysql_query("SELECT * FROM gioi_thieu ORDER BY id DESC limit {$start},{$limit}");
// $result=mysql_query("SELECT * FROM danh_muc_sp ORDER BY masp DESC");
if (mysql_num_rows($result) != 0) {
echo "<h2 align='div'>Thông Tin Người Dùng </h2>";
echo " <table border='1' align='div'>";
echo "<tr bgcolor='orange'>";
echo "<td >STT</td>";
echo "<td >Tiêu đề</td>";
echo "<td >Hình ảnh</td>";
echo "<td >Xóa</td>";
echo "<td >Sữa</td>";
echo "</tr>";
$stt = 1;
while ($row = mysql_fetch_object($result)) {
$id = $row->id;
示例2:
if ($flag == 5) {
$product_detail_submenu = $xl_submenu_db->getProduct_nsx($nsx, $start, $limit);
$total = $xl_submenu_db->countProduct_nsx($nsx);
} else {
$total = $xl_submenu_db->countProduct_detail_submenu($result_submenu[$i]['cat1id'], $result_submenu[$i]['cat2id'], $result_submenu[$i]['cat3id'], $flag);
//var_dump($result_submenu[$i]['cat3id']);
// var_dump("</br>");
$product_detail_submenu = null;
$product_detail_submenu = $xl_submenu_db->getProduct_detail_submenu($result_submenu[$i]['cat1id'], $result_submenu[$i]['cat2id'], $result_submenu[$i]['cat3id'], $flag, $start, $limit);
$DisplayActive = $result_submenu[$i]['cat1id'];
}
}
//var_dump($total);
//var_dump($product_detail_submenu);
//tạo thành phân trang
$pages = $pager->findPages($total, $limit);
$thanh_phan_trang = $pager->pageList($_GET['page'], $pages);
?>
<div class="class" title = "<?php
echo $DisplayActive;
?>
" style="display:block"></div>
<script>
$( document ).ready(function() {
var title = $("div.class").attr("title").toLowerCase();
var isActive = false;
if(!isActive)
{
$(".sub-nav-inner li.menubar").each(function(){
var name = $(this).find("a").eq(0).attr("href");
if(name != undefined && name != '')