本文整理汇总了PHP中page类的典型用法代码示例。如果您正苦于以下问题:PHP page类的具体用法?PHP page怎么用?PHP page使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了page类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
public function index()
{
$Feedback = D("Feedback");
$keyword = $_POST['keyword'];
$keywords = $_REQUEST['keywords'];
$uid = intval($_REQUEST['uid']);
if ($keyword) {
$data['content'] = array('like', '%' . $keyword . '%');
} elseif ($keywords) {
$data['content'] = array('like', '%' . safe_b64decode($keywords) . '%');
}
$count = $Feedback->count($data);
import("ORG.Util.Page");
$listRows = 15;
$p = new page($count, $listRows);
$list = $Feedback->findAll($data, '*', 'id desc', $p->firstRow . ',' . $p->listRows);
if ($keyword) {
$p->parameter = 'keywords=' . safe_b64encode($keyword);
}
$page = $p->show();
if ($list !== false) {
$this->assign('page', $page);
$this->assign('list', $list);
$this->assign('allowbat', $this->allowbat);
}
$this->display();
}
示例2: index
public function index()
{
$Link = D("Link");
$keyword = $_POST['keyword'];
$keywords = $_REQUEST['keywords'];
if ($keyword) {
$data['title'] = array('like', '%' . $keyword . '%');
} elseif ($keywords) {
$data['title'] = array('like', '%' . safe_b64decode($keywords) . '%');
}
$count = $Link->count($data);
import("ORG.Util.Page");
$listRows = 15;
$p = new page($count, $listRows);
$list = $Link->findAll($data, '*', 'types desc, orders desc', $p->firstRow . ',' . $p->listRows);
if ($keyword) {
$p->parameter = 'keywords=' . safe_b64encode($keyword);
}
$page = $p->show();
if ($list !== false) {
$this->assign('page', $page);
$this->assign('keyword', $keyword);
$this->assign('list', $list);
$this->assign("linkfolder", __ROOT__ . '/' . C(ATTACHDIR) . '/logo');
$this->assign('allowbat', $this->allowbat);
}
$this->display();
}
示例3: actionIndex
public function actionIndex()
{
$page = new page();
$page->title = zotop::t('系统管理');
$page->navbar = $this->navbar();
$page->display();
}
示例4: review
public function review()
{
$uid = intval($_GET['uid']);
if ($uid == '') {
parent::error404();
}
//分配根据GET传过来的uid用户的信息
$objUser = M('user');
$userMessage = $objUser->where('id=' . $uid)->field('id,username,face,introduce,point,exp')->find();
$userMessage = deep_htmlspecialchars_decode($userMessage);
if ($userMessage == '') {
parent::error404();
}
$this->assign('userMessage', $userMessage);
//分配该用户的评论
$objComment = M('comment');
import('ORG.Util.Page');
//导入分页类
$count = $objComment->where(array('comment_uid' => $uid))->count();
$page = new page($count, 20);
$page->setConfig('theme', '%upPage% %first% %prePage% %linkPage% %downPage%');
$commentList = $objComment->where(array('comment_uid' => $uid))->field('aid,time,comment')->order('time desc')->limit($page->firstRow . ',' . $page->listRows)->select();
foreach ($commentList as $k1 => $v1) {
$commentList[$k1]['url'] = '__APP__/List/detail/id/' . $v1['aid'] . '.html';
}
$commentList = deep_htmlspecialchars_decode($commentList);
$show = $page->show();
$this->assign('page', $show);
$this->assign('commentList', $commentList);
//分配Pagetitle
$this->pageTitle = $userMessage['username'] . '的个人主页_支招网';
$this->display();
}
示例5: index
public function index()
{
$put = I('s');
if (trim($put) == '') {
$this->error('搜索内容不能为空!');
die;
}
$where['biaoti'] = $put;
$where['content'] = $put;
$where['_logic'] = 'OR';
$map['_complex'] = $where;
$map['islock'] = 0;
//复合查询
$count = M('article')->where($map)->count();
import('ORG.Util.Page');
$page = new page($count, 10);
$page->setConfig('theme', '<ul class="pages">%first%%upPage%%linkPage%%downPage%%end%</ul>');
$show = $page->show();
//返回分页信息
$article = M('article')->where($map)->limit($page->firstRow . ',' . $page->listRows)->select();
foreach ($article as $key => $value2) {
$article[$key]["imgs"] = imgs($article[$key]["imgs"]);
}
$this->assign('put', $put);
$this->assign('show', $show);
//分页信息
$this->assign('count', $count);
//数据总数
$this->assign('list', $article);
//数据集
$sidebar1 = M('article')->where('type=0')->order('approval desc')->limit('10')->select();
//赞多到少
$this->assign('approval', $sidebar1);
$this->display('search');
}
示例6: index
public function index()
{
$put = I('s');
if (trim($put) == '') {
$this->error('搜索内容不能为空!');
die;
}
$where['title'] = $put;
$where['content'] = $put;
$count = M('Article')->where($where)->count();
import('ORG.Util.Page');
$page = new page($count, 10);
$page->setConfig('theme', '<ul class="pagination"><li>%upPage%</li><li>%downPage%</li><li>%prePage%</li><li>%linkPage%</li><li>%nextPage%</li><li>%end%</li></ul>');
$show = $page->show();
//返回分页信息
$article = M('article')->where($where)->limit($page->firstRow . ',' . $page->listRows)->select();
$this->assign('put', $put);
$this->assign('show', $show);
//分页信息
$this->assign('count', $count);
//数据总数
$this->assign('list', $article);
//数据集
//侧栏的数据分配
$sidebar1 = M('Article')->where("ispush=1 and islock=0")->order('approval desc')->limit('5')->select();
$sidebar2 = M('Article')->where("ispush=1 and islock=0")->order('opposition desc')->limit('5')->select();
$sidebar3 = M('Article')->where("ispush=1 and islock=0")->order('rand()')->limit('5')->select();
//赞多到少
$this->assign('sidebar1', $sidebar1);
//赞少到多
$this->assign('sidebar2', $sidebar2);
//随机5篇
$this->assign('sidebar3', $sidebar3);
$this->display('search');
}
示例7: index_action
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');
}
示例8: index
public function index()
{
$id = intval($_REQUEST['id']);
if ($id > 0) {
$mapc['cid'] = $id;
}
$Product = D("Product");
$count = $Product->count($mapc);
//if($count<=1)$this->error('此类别无产品');
import("ORG.Util.Page");
$listRows = 16;
$p = new page($count, $listRows);
$list = $Product->findAll($mapc, '*', 'id desc', $p->firstRow . ',' . $p->listRows);
//$list=$p->order('pid desc')->limit("$p->firstRow.','.$p->listRows")->findAll();
$page = $p->show();
/**/
//分类
$map['module'] = 1;
//分类
$Category = D('Category')->order("id desc")->where($map)->findall();
$this->assign('titler', '产品中心');
$this->assign('cate', $Category);
$this->assign('Product', $Product);
$this->assign('count', $count);
$this->assign('page', $page);
$this->display();
}
示例9: index
public function index()
{
$objAsk = M('ask');
$objUser = M('user');
$word = deep_htmlspecialchars($_GET["word"]);
$this->assign('searchWord', $word);
if ($word == '') {
redirect($_SERVER['HTTP_REFERER']);
}
//如果没有输入关键字 就重定向到上一页面
import('ORG.Util.Page');
//导入分页类
$count = $objAsk->where('INSTR(ask_name, "' . $word . '")>0')->count();
//统计总数
$this->assign('countSearch', $count);
$page = new page($count, 10);
$page->setConfig('theme', '%upPage% %first% %prePage% %linkPage% %downPage%');
$resultList = $objAsk->where('INSTR(ask_name, "' . $word . '")>0')->order('add_time desc')->limit($page->firstRow . ',' . $page->listRows)->select();
foreach ($resultList as $k1 => $v1) {
$resultList[$k1]['username'] = $objUser->where('id=' . $v1['uid'])->getField('username');
}
$resultList = deep_htmlspecialchars_decode($resultList);
$show = $page->show();
$this->assign('resultList', $resultList);
$this->assign('page', $show);
$this->display();
}
示例10: categoryList
function categoryList()
{
$page = new page();
$categ = new category();
$get_list = $categ->getAllList();
$page->printCategories($get_list);
}
示例11: addPage
function addPage($link, $name, $description)
{
$link = "playlist/" . $link;
$title = $name . " Playlist";
$page = new page();
$page->addPage($link, $title, $description, "Switch", "VideoChunk");
}
示例12: actionIndex
public function actionIndex()
{
$page = new page();
$page->title = zotop::t('模板管理');
$page->set('navbar', $this->navbar());
$page->display();
}
示例13: resumeList
/**
* 简历列表
*/
public function resumeList()
{
$db = V('resume');
$db->view = array('user_info' => array('type' => 'inner', 'on' => 'resume.uid=user_info.uid', 'field' => 'name'));
$cond = array();
if (isset($_GET['resume_name'])) {
$cond[] = 'resume_name like "%' . $_GET['resume_name'] . '%"';
}
if (isset($_GET['name'])) {
$cond[] = 'name like "%' . $_GET['name'] . '%"';
}
if (isset($_GET['created'])) {
$cond['created'] = array('gt' => strtotime($_GET['created']), 'lt' => time());
}
if (isset($_GET['updated'])) {
$cond['updated'] = array('gt' => strtotime($_GET['updated']), 'lt' => time());
}
if (isset($_GET['verify'])) {
$cond['verify'] = $_GET['verify'];
}
$nums = $db->where($cond)->count();
$page = new page($nums, 13);
$resumes = $db->where($cond)->findall($page->limit());
$this->assign('resumes', $resumes);
$this->assign('page', $page->show());
$this->display();
}
示例14: index
public function index()
{
//$Member=D("Member");
$Member = D("MemberView");
$keyword = $_POST['keyword'];
$keywords = $_REQUEST['keywords'];
if ($keyword) {
$data['username'] = array('like', '%' . $keyword . '%');
} elseif ($keywords) {
$data['username'] = array('like', '%' . safe_b64decode($keywords) . '%');
}
$count = $Member->count($data);
import("ORG.Util.Page");
$listRows = 15;
$p = new page($count, $listRows);
$list = $Member->findAll($data, '*', 'Member.id desc', $p->firstRow . ',' . $p->listRows);
if ($keyword) {
$p->parameter = 'keywords=' . safe_b64encode($keyword);
}
$page = $p->show();
if ($list !== false) {
$this->assign('page', $page);
$this->assign('list', $list);
$this->assign('allowbat', $this->allowbat);
}
$this->display();
}
示例15: show
public function show()
{
//if (!$this->QX[$this->get['open']][$this->get['action']]) $this->fun->Msg('你没有此权限');
if (is_numeric($this->get['weight'])) {
$this->default_value();
$start = (double) $this->get['weight'] / 10;
$stop = $start + 0.09;
switch ($this->get['weight']) {
case '03':
$weight = "and weight<={$stop}";
break;
case '010':
$weight = "and weight>={$start}";
break;
default:
$weight = "and weight>={$start} and weight<={$stop}";
}
$this->get['px'] = $this->get['px'] ? $this->get['px'] : 'agio';
$this->get['orders'] = $this->get['orders'] ? $this->get['orders'] : 'asc';
$ORDER = $this->get['px'] . ' ' . $this->get['orders'];
$this->sma->assign('get', $this->get);
$promotion_dot = $_SESSION['proxy']['is_offer'] == 'Y' ? 'promotion_dot' : $_SESSION['proxy']['rebate'];
require_once BASEPATH . '../Class/page.php';
$list = new page();
$list->db = $this->db;
$list->pageNS = 50;
$list->NowPage = empty($this->get['page']) | $this->get['page'] < 1 | !is_numeric($this->get['page']) ? 1 : $this->get['page'];
$list->SQL = "select id,ProID,shape,weight,color,clarity,cut,buffing,symmetry,Fent_Isity,scalar_value,diploma,diplomaNO,INTbid,(agio+baseAgio+{$promotion_dot}) as agio from product where status='up' {$weight} and amount>0 and is_promotion='Y' and promotion_start<=UNIX_TIMESTAMP() and promotion_stop>=UNIX_TIMESTAMP() order by {$ORDER}";
//$list->SQL = "select id,ProID,shape,weight,color,clarity,cut,buffing,symmetry,Fent_Isity,scalar_value,diploma,diplomaNO,INTbid,(agio+baseAgio+{$promotion_dot}) as agio from product where status='up' {$weight} and amount>0 and proSource='self' order by {$ORDER}";
$this->sma->assign('list_page', $list->getPage(true));
$this->sma->assign('list_text', $list->getText());
} else {
$this->default_value();
//$start = (float)$this->get['weight'] / 10;
//$stop = $start + 0.09;
//switch($this->get['weight'])
//{
// case '03':$weight = "and weight<={$stop}";break;
// case '010':$weight = "and weight>={$start}";break;
// default:$weight = "and weight>={$start} and weight<={$stop}";
//}
$weight = "and weight>=0.3";
$this->get['px'] = $this->get['px'] ? $this->get['px'] : 'agio';
$this->get['orders'] = $this->get['orders'] ? $this->get['orders'] : 'asc';
$ORDER = $this->get['px'] . ' ' . $this->get['orders'];
$this->sma->assign('get', $this->get);
$promotion_dot = $_SESSION['proxy']['is_offer'] == 'Y' ? 'promotion_dot' : $_SESSION['proxy']['rebate'];
require_once BASEPATH . '../Class/page.php';
$list = new page();
$list->db = $this->db;
$list->pageNS = 50;
$list->NowPage = empty($this->get['page']) | $this->get['page'] < 1 | !is_numeric($this->get['page']) ? 1 : $this->get['page'];
$list->SQL = "select id,ProID,shape,weight,color,clarity,cut,buffing,symmetry,Fent_Isity,scalar_value,diploma,diplomaNO,INTbid,(agio+baseAgio+{$promotion_dot}) as agio from product where status='up' {$weight} and amount>0 and is_promotion='Y' and promotion_start<=UNIX_TIMESTAMP() and promotion_stop>=UNIX_TIMESTAMP() order by {$ORDER}";
//$list->SQL = "select id,ProID,shape,weight,color,clarity,cut,buffing,symmetry,Fent_Isity,scalar_value,diploma,diplomaNO,INTbid,(agio+baseAgio+{$promotion_dot}) as agio from product where status='up' {$weight} and amount>0 and proSource='self' order by {$ORDER}";
$this->sma->assign('list_page', $list->getPage(true));
$this->sma->assign('list_text', $list->getText());
}
$this->sma->display('SP');
}