当前位置: 首页>>代码示例>>PHP>>正文


PHP page::numPage方法代码示例

本文整理汇总了PHP中page::numPage方法的典型用法代码示例。如果您正苦于以下问题:PHP page::numPage方法的具体用法?PHP page::numPage怎么用?PHP page::numPage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在page的用法示例。


在下文中一共展示了page::numPage方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: elseif

 function index_action()
 {
     $this->public_action();
     if ($_GET['type'] == 0) {
         $table = "question";
     } elseif ($_GET['type'] == 1) {
         $table = "answer";
     } elseif ($_GET['type'] == 2) {
         $table = "answer_review";
     }
     include LIB_PATH . "page3.class.php";
     $limit = 10;
     $page = $_GET["page"] < 1 ? 1 : $_GET["page"];
     $ststrsql = ($page - 1) * $limit;
     $page_url = "index.php?c=" . $_GET['c'] . "&type=" . intval($_GET['type']) . "&page={{page}}";
     $num = $this->obj->DB_select_num($table, "`uid`='" . $this->uid . "'");
     if ($num > $limit) {
         $pages = ceil($num / $limit);
         $page = new page($page, $limit, $num, $page_url);
         $pagenav = $page->numPage();
     }
     if ($_GET["type"] == 0) {
         $list = $this->obj->DB_select_all($table, "`uid`='" . $this->uid . "'  ORDER BY `add_time` DESC LIMIT {$ststrsql},{$limit}");
     } else {
         $list = $this->obj->DB_select_alls($table, "question", "a.`uid`='" . $this->uid . "' and a.`qid`=b.`id`  ORDER BY a.`add_time` DESC LIMIT {$ststrsql},{$limit}", "a.`content`,a.`add_time`,b.`id`,b.`title`,a.`id` as `aid`");
     }
     if ($list[0] != '') {
         $this->yunset("q_list", $list);
     }
     $this->yunset("gettype", $_GET["type"]);
     $this->yunset("pagenav", $pagenav);
     $this->user_tpl('my_question');
 }
开发者ID:keyu199314,项目名称:php,代码行数:33,代码来源:my_question.class.php

示例2: elseif

 function index_action()
 {
     $this->set_search();
     if ($_GET['m'] == 'comnews') {
         if (trim($_GET['keyword'])) {
             if ($_GET['type']) {
                 if ($_GET['type'] == "1") {
                     $where .= " and b.`name` like '%" . $_GET['keyword'] . "%'";
                 } else {
                     $where .= " and a.`title` like '%" . $_GET['keyword'] . "%'";
                 }
                 $urlarr['type'] = $_GET['type'];
             }
             $urlarr['keyword'] = $_GET['keyword'];
         } elseif ($_GET['status']) {
             if ($_GET['status'] == "3") {
                 $where .= " and a.`status`='0'";
             } else {
                 $where .= " and a.`status`='" . $_GET['status'] . "'";
             }
             $urlarr['status'] = $_GET['status'];
         }
     }
     if ($_GET['time']) {
         if ($_GET['time'] == '1') {
             $where .= " and a.`ctime` >= '" . strtotime(date("Y-m-d 00:00:00")) . "'";
         } else {
             $where .= " and a.`ctime` >= '" . strtotime('-' . (int) $_GET['time'] . 'day') . "'";
         }
         $urlarr['time'] = $_GET['time'];
     }
     if ($_GET['order']) {
         $where .= " order by a.`" . $_GET['t'] . "` " . $_GET['order'];
         $urlarr['order'] = $_GET['order'];
         $urlarr['t'] = $_GET['t'];
     } else {
         $where .= " order by a.`id` desc";
     }
     $urlarr['order'] = $_GET['order'];
     include LIB_PATH . "page.class.php";
     $limit = $this->config['sy_listnum'];
     $page = $_GET['page'] < 1 ? 1 : $_GET['page'];
     $ststrsql = ($page - 1) * $limit;
     $urlarr['page'] = "{{page}}";
     $pageurl = Url($_GET['m'], $urlarr, 'admin');
     $count = $this->obj->DB_select_alls("company_news", "company", "a.`uid`=b.`uid` {$where}", "a.uid");
     $num = count($count);
     $page = new page($page, $limit, $num, $pageurl);
     $pagenav = $page->numPage();
     $rows = $this->obj->DB_select_alls("company_news", "company", "a.`uid`=b.`uid` {$where}  limit {$ststrsql},{$limit}", "b.name,a.*");
     $this->yunset("pagenav", $pagenav);
     $this->yunset("rows", $rows);
     $this->yunset("get_type", $_GET);
     $this->yuntpl(array('admin/admin_comnews'));
 }
开发者ID:justinyaoqi,项目名称:qyhr,代码行数:55,代码来源:comnews.class.php

示例3: strtotime

 function index_action()
 {
     $this->set_search();
     if ($_GET['status']) {
         if ($_GET['status'] == '3') {
             $where = " and a.`status`='0'";
             $urlarr['status'] = '0';
         } else {
             $where = " and a.`status`='" . $_GET['status'] . "'";
             $urlarr['status'] = $_GET['status'];
         }
     }
     if ($_GET['keyword']) {
         $where .= " and b.`name` like '%" . $_GET['keyword'] . "%'";
         $urlarr['keyword'] = $_GET['keyword'];
     }
     if ($_GET['status']) {
         if ($_GET['status'] == '3') {
             $where .= " and a.`status` ='0'";
         } else {
             $where .= " and a.`status` ='" . $_GET['status'] . "'";
         }
     }
     if ($_GET['end']) {
         if ($_GET['end'] == '1') {
             $where .= " and `ctime` >= '" . strtotime(date("Y-m-d 00:00:00")) . "'";
         } else {
             $where .= " and `ctime` >= '" . strtotime('-' . (int) $_GET['end'] . 'day') . "'";
         }
         $urlarr['end'] = $_GET['end'];
     }
     if ($_GET['order']) {
         $where .= " order by a.`" . $_GET['t'] . "` " . $_GET['order'];
         $urlarr['order'] = $_GET['order'];
         $urlarr['t'] = $_GET['t'];
     } else {
         $where .= " order by a.`id` desc";
     }
     include LIB_PATH . "page3.class.php";
     $limit = $this->config["sy_listnum"];
     $page = $_GET["page"] < 1 ? 1 : $_GET["page"];
     $ststrsql = ($page - 1) * $limit;
     $urlarr["page"] = "{{page}}";
     $pageurl = $this->url("index", $_GET["m"], $urlarr);
     $count = $this->obj->DB_select_alls("company_cert", "company", "a.`uid`=b.`uid` and a.`type`='3' {$where}", "a.uid");
     $num = count($count);
     $page = new page($page, $limit, $num, $pageurl);
     $pagenav = $page->numPage();
     $rows = $this->obj->DB_select_alls("company_cert", "company", "a.`uid`=b.`uid` and a.`type`='3' {$where} {$order} limit {$ststrsql},{$limit}", "b.name,a.*");
     $this->yunset("pagenav", $pagenav);
     $this->yunset("rows", $rows);
     $this->yuntpl(array('admin/admin_com_cert'));
 }
开发者ID:keyu199314,项目名称:php,代码行数:53,代码来源:comcert.class.php

示例4: Page

function Page($pagenum, $num, $limit, $pageurl, $notpl = false, $_smarty_tpl, $pagenavname = 'pagenav', $isadmin = false)
{
    global $db, $db_config, $config;
    include_once LIB_PATH . "page.class.php";
    $pagenum = $pagenum < 1 ? 1 : $pagenum;
    $ststrsql = ($pagenum - 1) * $limit;
    $pages = ceil($num / $limit);
    $page = new page($pagenum, $limit, $num, $pageurl, 5, true, $notpl);
    $pagenav = $page->numPage();
    if ($_smarty_tpl) {
        $_smarty_tpl->tpl_vars['limit'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['pages'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['total'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars[$pagenavname] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['limit']->value = $limit;
        $_smarty_tpl->tpl_vars['pages']->value = $pages;
        $_smarty_tpl->tpl_vars['total']->value = $num;
        $_smarty_tpl->assignByRef('total', $num);
        $_smarty_tpl->tpl_vars[$pagenavname]->value = $pagenav;
    }
    return $pagenav;
}
开发者ID:justinyaoqi,项目名称:qyhr,代码行数:22,代码来源:public.url.php

示例5: foreach

 function dynamic_action()
 {
     //动态
     $this->public_action();
     include LIB_PATH . "page3.class.php";
     $limit = 10;
     $page = $_GET["page"] < 1 ? 1 : $_GET["page"];
     $ststrsql = ($page - 1) * $limit;
     $page_url["c"] = $_GET['c'];
     $page_url["page"] = "{{page}}";
     $pageurl = $this->url("index", "index", $page_url, '1');
     $atn = $this->obj->DB_select_all("atn", "`uid`='" . $this->uid . "'", "`sc_uid`");
     if (is_array($atn)) {
         foreach ($atn as $v) {
             $uids[] = $v['sc_uid'];
         }
     }
     $uids = @implode(',', $uids);
     $count = $this->obj->DB_select_alls("friend_info", "friend_state", "a.`uid` in(" . $uids . ") and a.`uid`=b.`uid`", "a.`uid`,a.`nickname`,a.`pic`,b.`content`,b.`ctime`");
     $num = count($count);
     $page = new page($page, $limit, $num, $pageurl);
     $pagenav = $page->numPage();
     $dynamic = $this->obj->DB_select_alls("friend_info", "friend_state", "a.`uid` in(" . $uids . ") and a.`uid`=b.`uid` order by b.`ctime` desc limit {$ststrsql},{$limit}", "a.`uid`,a.`nickname`,a.`pic`,b.`content`,b.`ctime`");
     if (is_array($dynamic)) {
         foreach ($dynamic as $k => $v) {
             if (in_array($v['uid'], $uids)) {
                 $dynamic[$k]['is_atn'] = '1';
             }
         }
     }
     $this->yunset("pagenav", $pagenav);
     $this->yunset("C", 'index');
     $this->yunset("dynamic", $dynamic);
     $this->seo("seo_dynamic");
     $this->wenda_tpl('dynamic');
 }
开发者ID:keyu199314,项目名称:php,代码行数:36,代码来源:index.class.php

示例6: elseif

 function index_action()
 {
     $this->set_search();
     if (trim($_GET['keyword'])) {
         if ($_GET['type'] == "1") {
             $where .= " and b.`username` LIKE '%" . $_GET['keyword'] . "%'";
         } elseif ($_GET['type'] == "2") {
             $where .= " and a.`name` LIKE '%" . $_GET['keyword'] . "%'";
         } elseif ($_GET['type'] == "3") {
             $where .= " and b.`email` LIKE '%" . $_GET['keyword'] . "%'";
         } else {
             $where .= " and b.`moblie` LIKE '%" . $_GET['keyword'] . "%'";
         }
         $page_url['keyword'] = $_GET['keyword'];
         $page_url['type'] = $_GET['type'];
     }
     if ($_GET['adtime']) {
         if ($_GET['adtime'] == '1') {
             $where .= " and b.`reg_date`>'" . strtotime(date("Y-m-d 00:00:00")) . "'";
         } else {
             $where .= " and b.`reg_date`>'" . strtotime('-' . intval($_GET['adtime']) . ' day') . "'";
         }
         $page_url['adtime'] = $_GET['adtime'];
     }
     if ($_GET['lotime']) {
         if ($_GET['lotime'] == '1') {
             $where .= " and b.`login_date`>'" . strtotime(date("Y-m-d 00:00:00")) . "'";
         } else {
             $where .= " and b.`login_date`>'" . strtotime('-' . intval($_GET['lotime']) . ' day') . "'";
         }
         $page_url['lotime'] = $_GET['lotime'];
     }
     if ($_GET['r_uid']) {
         $where .= " and a.`uid`='" . $_GET['r_uid'] . "'";
         $page_url['r_uid'] = $_GET['r_uid'];
     }
     if ($_GET['order']) {
         $where .= " order by b." . $_GET['t'] . " " . $_GET['order'];
         $page_url['order'] = $_GET['order'];
         $page_url['t'] = $_GET['t'];
     } else {
         $where .= " order by b.uid desc";
     }
     include LIB_PATH . "page3.class.php";
     $limit = $this->config['sy_listnum'];
     $page = $_GET['page'] < 1 ? 1 : $_GET['page'];
     $ststrsql = ($page - 1) * $limit;
     $page_url['page'] = "{{page}}";
     $pageurl = $this->url("index", "user_member", $page_url);
     $count = $this->obj->DB_select_alls("resume", "member", "a.`uid`=b.`uid` " . $where, "a.uid");
     $num = count($count);
     $page = new page($page, $limit, $num, $pageurl);
     $pagenav = $page->numPage();
     $userrows = $this->obj->DB_select_alls("resume", "member", "a.`uid`=b.`uid` {$where} limit {$ststrsql},{$limit}", "a.name,a.telphone,b.*");
     $this->yunset("pagenav", $pagenav);
     $this->yunset("userrows", $userrows);
     $nav_user = $this->obj->DB_select_alls("admin_user", "admin_user_group", "a.`m_id`=b.`id` and a.`uid`='" . $_SESSION['auid'] . "'");
     $power = unserialize($nav_user[0]['group_power']);
     if (in_array('141', $power)) {
         $this->yunset("email_promiss", '1');
     }
     if (in_array('163', $power)) {
         $this->yunset("moblie_promiss", '1');
     }
     $adtime = array('1' => '今天', '3' => '最近三天', '7' => '最近七天', '15' => '最近半月', '30' => '最近一个月');
     $lotime = array('1' => '今天', '3' => '最近三天', '7' => '最近七天', '15' => '最近半月', '30' => '最近一个月');
     $this->yunset("adtime", $adtime);
     $this->yunset("lotime", $lotime);
     $this->yunset("get_type", $_GET);
     $this->yuntpl(array('admin/admin_member_userlist'));
 }
开发者ID:keyu199314,项目名称:php,代码行数:71,代码来源:user_member.class.php

示例7: array

 function get_page($table, $where = "", $pageurl = "", $limit = 20, $field = "*", $rowsname = "rows", $pagenavname = "pagenav")
 {
     include_once LIB_PATH . "page3.class.php";
     $rows = array();
     $page = $_GET['page'] < 1 ? 1 : $_GET['page'];
     $ststrsql = ($page - 1) * $limit;
     $num = $this->obj->DB_select_num($table, $where);
     $this->yunset("total", $num);
     if ($num > $limit) {
         $pages = ceil($num / $limit);
         $this->yunset("pages", $pages);
         $page = new page($page, $limit, $num, $pageurl);
         $pagenav = $page->numPage();
         $this->yunset($pagenavname, $pagenav);
     }
     $rows = $this->obj->DB_select_all($table, "{$where} limit {$ststrsql},{$limit}", $field);
     $this->yunset($rowsname, $rows);
     return $rows;
 }
开发者ID:keyu199314,项目名称:php,代码行数:19,代码来源:common.php

示例8: Page

 function Page($pagenum, $num, $limit, $pageurl, $notpl = false)
 {
     global $db, $db_config, $config;
     $path = dirname(dirname(dirname(__FILE__)));
     include $path . "/include/page3.class.php";
     $pagenum = $pagenum < 1 ? 1 : $pagenum;
     $ststrsql = ($pagenum - 1) * $limit;
     $pages = ceil($num / $limit);
     $page = new page($pagenum, $limit, $num, $pageurl, 5, true, $notpl);
     $pagenav = $page->numPage();
     $this->_tpl_vars[limit] = $limit;
     $this->_tpl_vars[pages] = $pages;
     $this->_tpl_vars[total] = $num;
     $this->_tpl_vars[pagenav] = $pagenav;
     return $ststrsql;
 }
开发者ID:keyu199314,项目名称:php,代码行数:16,代码来源:Smarty_Compiler.class.php


注:本文中的page::numPage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。