當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Page類代碼示例

本文整理匯總了PHP中Page的典型用法代碼示例。如果您正苦於以下問題:PHP Page類的具體用法?PHP Page怎麽用?PHP Page使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Page類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: display_rotate_error

 /**
  * Display the error.
  *
  * @param Page $page
  * @param string $title
  * @param string $message
  */
 public function display_rotate_error(Page $page, $title, $message)
 {
     $page->set_title("Rotate Image");
     $page->set_heading("Rotate Image");
     $page->add_block(new NavBlock());
     $page->add_block(new Block($title, $message));
 }
開發者ID:JarJak,項目名稱:shimmie2,代碼行數:14,代碼來源:theme.php

示例2: sysmsg

 public function sysmsg($re = false)
 {
     $map['uid'] = $this->uid;
     //分頁處理
     import("ORG.Util.Page");
     $count = M('inner_msg')->where($map)->count('id');
     $p = new Page($count, 15);
     $page = $p->show();
     $Lsql = "{$p->firstRow},{$p->listRows}";
     //分頁處理
     $list = M('inner_msg')->where($map)->order('id DESC')->limit($Lsql)->select();
     $read = M("inner_msg")->where("uid={$this->uid} AND status=1")->count('id');
     $this->assign("list", $list);
     $this->assign("pagebar", $page);
     $this->assign("read", $read);
     $this->assign("unread", $count - $read);
     $this->assign("count", $count);
     if (true === $re) {
         $dpage = array();
         $dpage['numpage'] = $count ? ceil($count / 15) : 1;
         $dpage['curpage'] = (int) $_GET['p'] ? (int) $_GET['p'] : 1;
         $this->assign("dpage", $dpage);
         return $list;
     }
     $data['html'] = $this->fetch();
     exit(json_encode($data));
 }
開發者ID:caotieshuan,項目名稱:ishoutou,代碼行數:27,代碼來源:MsgAction.class.php

示例3: history

 public function history()
 {
     if (!$GLOBALS['user_info']) {
         app_redirect(url("user#login"));
     }
     $dest_user_id = intval($_REQUEST['id']);
     $dest_user_info = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user where id = " . $dest_user_id . " and is_effect = 1");
     if (!$dest_user_info) {
         app_redirect(url("message"));
     }
     $GLOBALS['db']->query("update " . DB_PREFIX . "user_message set is_read = 1 where user_id = " . intval($GLOBALS['user_info']['id']) . " and dest_user_id = " . $dest_user_id);
     $page_size = 20;
     $page = intval($_REQUEST['p']);
     if ($page == 0) {
         $page = 1;
     }
     $limit = ($page - 1) * $page_size . "," . $page_size;
     $sql = "select * from " . DB_PREFIX . "user_message  where user_id = " . intval($GLOBALS['user_info']['id']) . " and dest_user_id = " . $dest_user_id . " order by create_time desc limit " . $limit;
     $sql_count = "select count(*) from " . DB_PREFIX . "user_message where user_id = " . intval($GLOBALS['user_info']['id']) . " and dest_user_id = " . $dest_user_id;
     $message_list = $GLOBALS['db']->getAll($sql);
     $message_count = $GLOBALS['db']->getOne($sql_count);
     $GLOBALS['tmpl']->assign("dest_user_info", $dest_user_info);
     $GLOBALS['tmpl']->assign("message_list", $message_list);
     require APP_ROOT_PATH . 'app/Lib/page.php';
     $page = new Page($message_count, $page_size);
     //初始化分頁對象
     $p = $page->show();
     $GLOBALS['tmpl']->assign('pages', $p);
     $GLOBALS['tmpl']->display("message_history.html");
 }
開發者ID:centaurustech,項目名稱:crowdfunding-9,代碼行數:30,代碼來源:messageModule.class.php

示例4: index

 public function index()
 {
     if (IS_POST) {
         $this->all_insert('Recognition');
     } else {
         $db = D('Recognition');
         $where = array('token' => session('token'));
         $count = $db->where($where)->count();
         $page = new Page($count, 25);
         $wechat_group_db = M('Wechat_group');
         $list = $db->where($where)->limit($page->firstRow . ',' . $page->listRows)->order('id desc')->select();
         foreach ($list as $key => $value) {
             $list[$key]['group'] = $wechat_group_db->where(array('token' => $this->token, 'wechatgroupid' => $value['groupid']))->getField('name');
         }
         $groups = $wechat_group_db->where(array('token' => $this->token))->order('id ASC')->select();
         $this->assign('groups', $groups);
         $this->assign('page', $page->show());
         $this->assign('list', $list);
         if (ALI_FUWU_GROUP) {
             $fuwu = 'yes';
         } else {
             $fuwu = 'no';
         }
         $this->assign('fuwu', $fuwu);
         $this->display();
     }
 }
開發者ID:node-rookie,項目名稱:bdg,代碼行數:27,代碼來源:RecognitionAction.class.php

示例5: getList

 public function getList($where = array(), $order = false, $limit = false, $page = false, $group = false)
 {
     $data = array();
     if ($page) {
         import('ORG.Util.Page');
         $count = $this->where($where)->count();
         $limit = $limit ? $limit : 10;
         $Page = new Page($count, $limit);
         $data['page'] = $Page->show();
         if ($group) {
             $this->group($group);
         }
         if ($order) {
             $this->order($order);
         }
         $this->limit($Page->firstRow . ',' . $Page->listRows);
         $data['list'] = $this->where($where)->select();
     } else {
         if ($limit) {
             $this->limit($limit);
         }
         if ($group) {
             $this->group($group);
         }
         if ($order) {
             $this->order($order);
         }
         $data = $this->where($where)->select();
     }
     return $data;
 }
開發者ID:noikiy,項目名稱:yisheji,代碼行數:31,代碼來源:BaseModel.class.php

示例6: index

 public function index()
 {
     $frontuser = M('Users')->where($this->belong_where)->select();
     foreach ($frontuser as $val) {
         $belong_where_wx .= $val['id'] . ',';
     }
     $map = array();
     $map['uid'] = array('in', $belong_where_wx);
     $UserDB = D('Wxuser');
     $count = $UserDB->where($map)->count();
     $Page = new Page($count, 10);
     // 實例化分頁類 傳入總記錄數
     // 進行分頁數據查詢 注意page方法的參數的前麵部分是當前的頁數使用 $_GET[p]獲取
     $nowPage = isset($_GET['p']) ? $_GET['p'] : 1;
     $show = $Page->show();
     // 分頁顯示輸出
     $list = $UserDB->where($map)->order('id ASC')->limit($Page->firstRow . ',' . $Page->listRows)->order('id desc')->select();
     foreach ($list as $key => $value) {
         $user = M('Users')->field('id,gid,username,belonguser')->where(array('id' => $value['uid']))->find();
         if ($user) {
             $list[$key]['user']['username'] = $user['username'];
             $list[$key]['user']['gid'] = $user['gid'] - 1;
             $back_user = M('user')->where(array('id' => $user['belonguser']))->find();
             $list[$key]['user']['backusername'] = $back_user['username'];
         }
     }
     //dump($list);
     $this->assign('list', $list);
     $this->assign('page', $show);
     // 賦值分頁輸出
     $this->display();
 }
開發者ID:dalinhuang,項目名稱:wxMall,代碼行數:32,代碼來源:TokenAction.class.php

示例7: getCacheHeaders

 public function getCacheHeaders(ConcretePage $c)
 {
     $lifetime = $c->getCollectionFullPageCachingLifetimeValue();
     $expires = gmdate('D, d M Y H:i:s', time() + $lifetime) . ' GMT';
     $headers = array('Pragma' => 'public', 'Cache-Control' => 'max-age=' . $lifetime . ',s-maxage=' . $lifetime, 'Expires' => $expires);
     return $headers;
 }
開發者ID:ceko,項目名稱:concrete5-1,代碼行數:7,代碼來源:PageCache.php

示例8: financeDetail

 public function financeDetail()
 {
     import("ORG.Util.Page");
     $map['is_stock'] = array("in", "1,2");
     $count = M("ausers")->where($map)->count();
     $p = new Page($count, C('ADMIN_PAGE_SIZE'));
     $page = $p->show();
     $Lsql = "{$p->firstRow},{$p->listRows}";
     $list = M("ausers")->where($map)->limit($Lsql)->select();
     foreach ($list as $k => $v) {
         if ($v['is_stock'] == 2) {
             $com = getComsById($v['id']);
             $com = $com * $this->glo['commision_ratio'] / 100;
             $com = $com * $this->glo['commision_ratio'] / 100;
             $list[$k]['all_commission'] = $com;
         } else {
             $com = getComById($v['id']);
             $com = $com * $this->glo['commision_ratio'] / 100;
             $list[$k]['all_commission'] = $com;
         }
     }
     $this->assign("list", $list);
     $this->assign("pagebar", $page);
     $this->display();
 }
開發者ID:caotieshuan,項目名稱:ishoutou,代碼行數:25,代碼來源:StockdetailAction.class.php

示例9: index

 function index($urlParts)
 {
     $page = new Page();
     $content = Content::getAll('post');
     $page->addRenderable('content', $content);
     $page->render();
 }
開發者ID:natewilliford,項目名稱:cmsexp,代碼行數:7,代碼來源:Index.php

示例10: sn

 public function sn()
 {
     $lid = $this->_get('id', 'intval');
     $id = M('Lottery')->where(array('zjpic' => $lid, 'token' => $this->token))->getField('id');
     $type = $this->_get('type', 'intval');
     $lottery = M('Activity')->where(array('token' => $this->token, 'id' => $lid, 'type' => $type))->find();
     $this->assign('Activity', $lottery);
     $recordcount = $lottery['fistlucknums'] + $lottery['secondlucknums'] + $lottery['thirdlucknums'] + $lottery['fourlucknums'] + $lottery['fivelucknums'] + $lottery['sixlucknums'];
     $datacount = $lottery['fistnums'] + $lottery['secondnums'] + $lottery['thirdnums'] + $lottery['fournums'] + $lottery['fivenums'] + $lottery['sixnums'];
     $this->assign('datacount', $datacount);
     $this->assign('recordcount', $recordcount);
     $box = M('Autumns_box');
     $lcount = $box->where(array('token' => $this->token, 'bid' => $id, 'isprize' => 1))->count();
     $page = new Page($lcount, 20);
     $this->assign('page', $page->show());
     $list = $box->where(array('token' => $this->token, 'bid' => $id, 'isprize' => 1))->order('id desc')->limit($page->firstRow . ',' . $page->listRows)->select();
     foreach ($list as $key => $val) {
         $user = M('Userinfo')->where(array('token' => $this->token, 'wecha_id' => $val['wecha_id']))->field('wechaname,tel')->find();
         $list[$key]['tel'] = $user['tel'];
         $list[$key]['name'] = $user['wechaname'];
     }
     $this->assign('list', $list);
     $send = $box->where(array('bid' => $id, 'isprize' => 1, 'sendstutas' => 1))->count();
     $this->assign('send', $send);
     $count = $box->where(array('bid' => $id, 'isprize' => 1, 'isprizes' => 1))->count();
     $this->assign('count', $count);
     $lottery = M('Activity')->where(array('id' => $lid, 'token' => $this->token))->find();
     $this->assign('id', $id);
     $this->display();
 }
開發者ID:liuguogen,項目名稱:weixin,代碼行數:30,代碼來源:AutumnsAction.class.php

示例11: index

    public function index($id){
        //實例化評論表對象
        $mod = M("Libcom");

        //導入分頁類
        import("ORG.Util.Page");
        //設置搜索條件
        $where['lid'] = array("eq",$id);
        //設置分頁條件
        $total = $mod->where($where)->count();//獲取總數據條數
        $page = new Page($total,5);//實例化一個分頁對象
        
        //查詢評論信息
        $list = $mod->where($where)->order("addtime desc")->limit($page->firstRow.",".$page->listRows)->select();
        //循環遍曆查詢結果集執行用戶名追加
        //$cid = array();//定義該資源所有評論的id
        foreach ($list as &$v) {
            $ob = D("Users")->field("username,picture")->find($v['uid']);
            $v['username'] = $ob['username'];
            $v['picture'] = $ob['picture'];
            //$cid[] = $v['id'];//把遍曆出的id存進數組
        }
        $this->assign("list",$list);
        $this->assign("comTotal",$total);//賦值模板評論條數
        $this->assign("comPage",$page->show());//給模板賦值分頁信息
    }
開發者ID:jl9n,項目名稱:debugger,代碼行數:26,代碼來源:LibcomAction.class.php

示例12: display_image

 public function display_image(Page $page, Image $image)
 {
     $ilink = make_link("get_svg/{$image->id}/{$image->id}.svg");
     //		$ilink = $image->get_image_link();
     $html = "\n\t\t\t<object data='{$ilink}' type='image/svg+xml' width='{$image->width}' height='{$image->height}'>\n\t\t\t    <embed src='{$ilink}' type='image/svg+xml' width='{$image->width}' height='{$image->height}' />\n\t\t\t</object>\n\t\t";
     $page->add_block(new Block("Image", $html, "main", 0));
 }
開發者ID:kmcasto,項目名稱:shimmie2,代碼行數:7,代碼來源:theme.php

示例13: index

 public function index()
 {
     $form_id = intval(I('get.form_id'));
     $map = array('id' => $form_id, 'is_del' => 0);
     $form_one = D('form')->where($map)->find();
     if (!$form_one) {
         $this->error('未找到表單,請返回重試!');
     }
     $list = array();
     $map = array('form_id' => $form_id, 'is_del' => 0);
     $count = D('foreign_test')->where($map)->count('id');
     if ($count > 0) {
         import("@.Org.Util.Page");
         $p = new \Page($count, 5);
         //分頁跳轉的時候保證查詢條件
         foreach ($_GET as $key => $val) {
             if (!is_array($val)) {
                 $p->parameter .= $key . '=' . urlencode($val) . '&';
             }
         }
         //分頁顯示
         $page = $p->show();
         $list = D('foreign_test')->field('id,name,updatetime,dateline')->where($map)->order('id desc')->limit($p->firstRow . ',' . $p->listRows)->select();
     }
     $this->assign('form_one', $form_one);
     $this->assign('page', $page);
     $this->assign('list', $list);
     $this->display();
 }
開發者ID:dlpc,項目名稱:formdesign,代碼行數:29,代碼來源:DemodataController.class.php

示例14: index2

 function index2()
 {
     $items_mod = M('items');
     $items_comments_mod = M('items_comments');
     import("ORG.Util.Page");
     $prex = C('DB_PREFIX');
     //搜索
     $where = '1=1';
     if (isset($_GET['keyword']) && trim($_GET['keyword'])) {
         $where .= " AND (" . $prex . "info.name LIKE '%" . $_GET['keyword'] . "%' or title LIKE '%" . $_GET['keyword'] . "%')";
         $this->assign('keyword', $_GET['keyword']);
     }
     $count = $mod->where($where)->count();
     $p = new Page($count, 20);
     $list = $mod->where($where)->field($prex . 'user_comments.*,' . $prex . 'items.title as title')->join('LEFT JOIN ' . $prex . 'items ON ' . $prex . 'user_comments.items_id = ' . $prex . 'items.id ')->limit($p->firstRow . ',' . $p->listRows)->order($prex . 'user_comments.add_time DESC')->select();
     echo $mod->getlastSQL();
     exit;
     $key = 1;
     foreach ($list as $k => $val) {
         $list[$k]['key'] = ++$p->firstRow;
     }
     $big_menu = array('javascript:window.top.art.dialog({id:\'add\',iframe:\'?m=items_comments&a=add\', title:\'' . L('add_flink') . '\', width:\'450\', height:\'250\', lock:true}, function(){var d = window.top.art.dialog({id:\'add\'}).data.iframe;var form = d.document.getElementById(\'dosubmit\');form.click();return false;}, function(){window.top.art.dialog({id:\'add\'}).close()});void(0);', L('add_flink'));
     $page = $p->show();
     $this->assign('page', $page);
     $this->assign('big_menu', $big_menu);
     $this->assign('list', $list);
     $this->display();
 }
開發者ID:nexteee,項目名稱:php,代碼行數:28,代碼來源:items_commentsAction.class.php

示例15: flistOp

 /**
  * 意見反饋
  */
 public function flistOp()
 {
     $lang = Language::getLangContent();
     $model_link = Model('mb_feedback');
     /**
      * 刪除
      */
     if ($_POST['form_submit'] == 'ok') {
         if (is_array($_POST['del_id']) && !empty($_POST['del_id'])) {
             foreach ($_POST['del_id'] as $k => $v) {
                 $model_link->del($v);
             }
             showMessage($lang['feedback_del_succ']);
         } else {
             showMessage($lang['feedback_del_fiald']);
         }
     }
     /**
      * 分頁
      */
     $page = new Page();
     $page->setEachNum(10);
     $page->setStyle('admin');
     $list = $model_link->getList(array(), $page);
     Tpl::output('list', $list);
     Tpl::output('page', $page->show());
     Tpl::showpage('mb_feedback.index');
 }
開發者ID:noikiy,項目名稱:nc-1,代碼行數:31,代碼來源:mb_feedback.php


注:本文中的Page類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。