当前位置: 首页>>代码示例>>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;未经允许,请勿转载。