/** * 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)); }
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)); }
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"); }
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(); } }
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; }
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(); }
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; }
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(); }
function index($urlParts) { $page = new Page(); $content = Content::getAll('post'); $page->addRenderable('content', $content); $page->render(); }
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(); }
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());//给模板赋值分页信息 }
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)); }
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(); }
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(); }
/** * 意见反馈 */ 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'); }
public function index() { $map = array(); if (C('agent_version')) { $map['agentid'] = array('lt', 1); } $UserDB = D('User_group'); $count = $UserDB->where($map)->count(); $Page = new Page($count, 15); // 实例化分页类 传入总记录数 // 进行分页数据查询 注意page方法的参数的前面部分是当前的页数使用 $_GET[p]获取 $nowPage = isset($_GET['p']) ? $_GET['p'] : 1; $show = $Page->show(); // 分页显示输出 $list = $UserDB->where($map)->order('id ASC')->page($nowPage . ',' . C('PAGE_NUM'))->select(); if ($list) { $i = 1; foreach ($list as $item) { $UserDB->where(array('id' => $item['id']))->save(array('taxisid' => $i)); $i++; } } $this->assign('list', $list); $this->assign('page', $show); // 赋值分页输出 $this->display(); }
public function inform_listOp() { /* * 生成分页 */ $page = new Page(); $page->setEachNum(10); $page->setStyle('admin'); /* * 得到该店被举报禁售的列表 */ $model_inform = Model('inform'); $condition = array(); $condition['inform_state'] = 2; $condition['inform_store_id'] = $_SESSION['store_id']; $condition['inform_handle_type'] = 3; $condition['order'] = 'inform_id desc'; $list = $model_inform->getInform($condition, $page); $this->profile_menu('inform_list'); Tpl::output('list', $list); Tpl::output('show_page', $page->show()); Tpl::output('menu_sign', 'store_inform'); Tpl::output('menu_sign_url', 'index.php?act=store_inform'); Tpl::output('menu_sign1', 'store_inform'); Tpl::showpage('store_inform.list'); }
public function index(){ $map = array(); $UserDB = D('Wxuser'); if (isset($_GET['agentid'])){ $map=array('agentid'=>intval($_GET['agentid'])); } $count = $UserDB->where($map)->count(); $Page = new Page($count,5);// 实例化分页类 传入总记录数 // 进行分页数据查询 注意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')->where(array('id'=>$value['uid']))->find(); if($user){ $list[$key]['user']['username']=$user['username']; $list[$key]['user']['gid']=$user['gid']-1; } } //dump($list); $this->assign('list',$list); $this->assign('page',$show);// 赋值分页输出 $this->display(); }
public function send() { // Actuellement, cette ligne a peu de sens dans votre esprit. // Promis, vo saurez vraiment ce qu'elle fait d'ici la fin du chapitre // (bien que je suis sûr que les noms choisis sont assez explicites !). exit($this->page->getGeneratedPage()); }
public function records(){ $db = D('Share'); $where['token'] = $this -> token; $count = $db -> where($where) -> count(); $page = new Page($count, 25); $info = $db -> where($where) -> order('id DESC') -> limit($page -> firstRow . ',' . $page -> listRows) -> select(); $wecha_ids = array(); if ($info){ foreach ($info as $item){ if (!in_array($item['wecha_id'], $wecha_ids)){ array_push($wecha_ids, $item['wecha_id']); } } $users = M('Userinfo') -> where(array('wecha_id' => array('in', $wecha_ids))) -> select(); if ($users){ foreach ($users as $useritem){ $users[$useritem['wecha_id']] = $useritem; } } $i = 0; foreach ($info as $item){ $info[$i]['user'] = $users[$item['wecha_id']]; $info[$i]['moduleName'] = funcDict :: moduleName($item['module']); $i++; } } $this -> assign('page', $page -> show()); $this -> assign('info', $info); $this -> assign('tab', 'records'); $this -> display(); }
public function index(){ $data = M('Wehcat_member_enddate'); $count = $data -> where(array('token' => $_SESSION['token'])) -> count(); $Page = new Page($count, 50); $show = $Page -> show(); $list = $data -> where(array('token' => $_SESSION['token'], 'uid' => session('userId'))) -> order('enddate desc') -> limit($Page -> firstRow . ',' . $Page -> listRows) -> select(); foreach($list as $key => $limen){ $dataUp['joinUpDate'] = time(); $dataUp['uid'] = session('userId'); $dataUp['id'] = $limen['id']; M('wehcat_member_enddate') -> data($dataUp) -> save(); $userInfo = M('wechat_group_list') -> order('id desc') -> where(array('openid' => $limen['openid'])) -> find(); $list1[$key]['endtime'] = $this -> getTime($limen['enddate'], 'mohu'); $list1[$key]['nickname'] = $userInfo['nickname']; $list1[$key]['headimgurl'] = $userInfo['headimgurl']; $list1[$key]['id'] = $userInfo['id']; $list1[$key]['city'] = $userInfo['city']; $list1[$key]['openid'] = $limen['openid']; $list1[$key]['subscribe_time'] = $this -> getTime($userInfo['subscribe_time'], 'normal'); } $where['token'] = session('token'); $where['id'] = session('userId'); $where['endJoinDate'] = time(); M('Service_user') -> data($where) -> save(); $this -> assign('page', $show); $this -> assign('list', $list1); $this -> display(); }
public function index() { $page = intval($_REQUEST['p']); if ($page == 0) { $page = 1; } $limit = ($page - 1) * app_conf("PAGE_SIZE") . "," . app_conf("PAGE_SIZE"); $result = get_invite_list($limit, $GLOBALS['user_info']['id']); $GLOBALS['tmpl']->assign("list", $result['list']); $page = new Page($result['count'], app_conf("PAGE_SIZE")); //初始化分页对象 $p = $page->show(); $GLOBALS['tmpl']->assign('pages', $p); $total_referral_money = $GLOBALS['db']->getOne("select sum(money) from " . DB_PREFIX . "referrals where user_id = " . $GLOBALS['user_info']['id'] . " and pay_time > 0"); $total_referral_score = $GLOBALS['db']->getOne("select sum(score) from " . DB_PREFIX . "referrals where user_id = " . $GLOBALS['user_info']['id'] . " and pay_time > 0"); $GLOBALS['tmpl']->assign("total_referral_money", $total_referral_money); $GLOBALS['tmpl']->assign("total_referral_score", $total_referral_score); $GLOBALS['tmpl']->assign("page_title", $GLOBALS['lang']['UC_INVITE']); $GLOBALS['tmpl']->assign("inc_file", "inc/uc/uc_invite_index.html"); $share_url = get_domain() . APP_ROOT . "/"; if ($GLOBALS['user_info']) { $share_url .= "?r=" . base64_encode(intval($GLOBALS['user_info']['id'])); } $GLOBALS['tmpl']->assign("share_url", $share_url); $GLOBALS['tmpl']->display("uc.html"); }
public function indexOp() { $page = new Page(); $page->setEachNum(10); $page->setStyle('admin'); /* * 得到当前用户的投诉列表 */ $model_complain = Model('complain'); $condition = array(); $condition['order'] = 'complain_state asc,complain_id desc'; $condition['accuser_id'] = $_SESSION['member_id']; switch (intval($_GET['select_complain_state'])) { case 1: $condition['progressing'] = 'true'; break; case 2: $condition['finish'] = 'true'; break; default: $condition['state'] = ''; } $list = $model_complain->getComplain($condition, $page); $this->profile_menu('complain_accuser_list'); Tpl::output('list', $list); Tpl::output('show_page', $page->show()); $goods_list = $model_complain->getComplainGoodsList($list); Tpl::output('goods_list', $goods_list); Tpl::showpage('complain.list'); }
function index() { $group_id = isset($_GET['group_id']) && intval($_GET['group_id']) ? intval($_GET['group_id']) : ''; $keyword = isset($_GET['keyword']) && trim($_GET['keyword']) ? trim($_GET['keyword']) : ''; $where = '1=1'; if ($group_id != '') { $where .= " AND group_id={$group_id}"; } if ($keyword != '') { $where .= " AND module like '%{$keyword}%' or module_name like '%{$keyword}%' or action_name like '%{$keyword}%'"; } $node_mod = D('node'); import("ORG.Util.Page"); $count = $node_mod->where($where)->count(); $p = new Page($count, 15); $node_list = $node_mod->where($where)->limit($p->firstRow . ',' . $p->listRows)->order('module asc,sort ASC')->select(); $big_menu = array('javascript:window.top.art.dialog({id:\'add\',iframe:\'?m=Node&a=add\', title:\'添加菜单\', width:\'500\', height:\'490\', 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);', '添加菜单'); $page = $p->show(); $group_mod = D('group'); $group_list = $group_mod->select(); $this->assign('group_list', $group_list); $this->assign('group_id', $group_id); $this->assign('keyword', $keyword); $this->assign('page', $page); $this->assign('big_menu', $big_menu); $this->assign('node_list', $node_list); $this->display(); }
public function index() { if (!$GLOBALS['user_info']) { app_redirect(url("user#login")); } $all = intval($_REQUEST['all']); $page_size = 20; $page = intval($_REQUEST['p']); if ($page == 0) { $page = 1; } $limit = ($page - 1) * $page_size . "," . $page_size; if ($all == 0) { $cond = " and is_read = 0 "; } else { $cond = " and 1=1 "; } $GLOBALS['tmpl']->assign("all", $all); $sql = "select * from " . DB_PREFIX . "user_notify where user_id = " . intval($GLOBALS['user_info']['id']) . " {$cond} order by log_time desc limit " . $limit; $sql_count = "select count(*) from " . DB_PREFIX . "user_notify where user_id = " . intval($GLOBALS['user_info']['id']) . " {$cond} "; $notify_list = $GLOBALS['db']->getAll($sql); $notify_count = $GLOBALS['db']->getOne($sql_count); foreach ($notify_list as $k => $v) { $notify_list[$k]['url'] = parse_url_tag("u:" . $v['url_route'] . "|" . $v['url_param']); } $GLOBALS['tmpl']->assign("notify_list", $notify_list); require APP_ROOT_PATH . 'app/Lib/page.php'; $page = new Page($notify_count, $page_size); //初始化分页对象 $p = $page->show(); $GLOBALS['tmpl']->assign('pages', $p); $GLOBALS['tmpl']->display("notify.html"); }
public function publist() { $Pub = D('pub'); if (isset($_GET['pid'])) { $_GET['pid'] = intval($_GET['pid']); $Pub->where('id=' . $_GET['pid'])->delete(); header('Location: ' . __ADMIN__ . '/Pub/publist'); } import('ORG.Util.Page'); // 导入分页类 $count = $Pub->count(); // 查询满足要求的总记录数 $Page = new Page($count, 25); // 实例化分页类 传入总记录数和每页显示的记录数 $show = $Page->show(); // 分页显示输出 // 进行分页数据查询 注意limit方法的参数要使用Page类的属性 $list = $Pub->order('pubtime desc')->limit($Page->firstRow . ',' . $Page->listRows)->select(); $this->assign('list', $list); // 赋值数据集 $this->assign('page', $show); // 赋值分页输出 $this->display(); // 输出模板 }
private function cate() { require APP_ROOT_PATH . 'app/Lib/page.php'; $cate_id = 6; $GLOBALS['tmpl']->caching = true; $cache_id = md5(MODULE_NAME . ACTION_NAME . "cate" . $cate_id . intval($_REQUEST['p'])); if (!$GLOBALS['tmpl']->is_cached('page/usagetip_index.html', $cache_id)) { $cate_item = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "article_cate where id = {$cate_id} and is_effect = 1 and is_delete = 0"); if ($cate_id > 0 && !$cate_item) { app_redirect(APP_ROOT . "/"); } $cate_tree = get_acate_tree(); $GLOBALS['tmpl']->assign("acate_tree", $cate_tree); //分页 $page = intval($_REQUEST['p']); if ($page == 0) { $page = 1; } $limit = ($page - 1) * app_conf("PAGE_SIZE") . "," . app_conf("PAGE_SIZE"); $result = get_article_list($limit, $cate_id, '', ''); $GLOBALS['tmpl']->assign("list", $result['list']); $page = new Page($result['count'], app_conf("PAGE_SIZE")); //初始化分页对象 $p = $page->show(); $GLOBALS['tmpl']->assign('pages', $p); //使用技巧 $use_tech_list = get_article_list(6, 6); $GLOBALS['tmpl']->assign("use_tech_list", $use_tech_list); $GLOBALS['tmpl']->assign("page_title", $cate_item['title']); $GLOBALS['tmpl']->assign("page_keyword", $cate_item['title'] . ","); $GLOBALS['tmpl']->assign("page_description", $cate_item['title'] . ","); } $GLOBALS['tmpl']->display("page/usagetip_index.html", $cache_id); }
public function index() { global $tmpl; $rel_table = addslashes(trim($_REQUEST['act'])); $message_type = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "message_type where type_name='" . $rel_table . "' and type_name <> 'supplier'"); if (!$message_type || $message_type['is_fix'] == 0) { app_redirect(APP_ROOT . "/"); } $rel_table = $message_type['type_name']; $condition = ''; $id = intval($_REQUEST['id']); if ($rel_table == 'deal') { $deal = get_deal($id); if ($deal['buy_type'] != 1) { $GLOBALS['tmpl']->assign("deal", $deal); } $id = $deal['id']; } require APP_ROOT_PATH . 'app/Lib/side.php'; if ($id > 0) { $condition = "rel_table = '" . $rel_table . "' and rel_id = " . $id; } else { $condition = "rel_table = '" . $rel_table . "'"; } if (app_conf("USER_MESSAGE_AUTO_EFFECT") == 0) { $condition .= " and user_id = " . intval($GLOBALS['user_info']['id']); } else { if ($message_type['is_effect'] == 0) { $condition .= " and user_id = " . intval($GLOBALS['user_info']['id']); } } $condition .= " and is_buy = " . intval($_REQUEST['is_buy']); //message_form 变量输出 $GLOBALS['tmpl']->assign("post_title", $message_type['show_name']); $GLOBALS['tmpl']->assign("page_title", $message_type['show_name']); $GLOBALS['tmpl']->assign('rel_id', $id); $GLOBALS['tmpl']->assign('rel_table', $rel_table); $GLOBALS['tmpl']->assign('is_buy', intval($_REQUEST['is_buy'])); if (intval($_REQUEST['is_buy']) == 1) { $GLOBALS['tmpl']->assign("post_title", $GLOBALS['lang']['AFTER_BUY']); $GLOBALS['tmpl']->assign("page_title", $GLOBALS['lang']['AFTER_BUY']); } if (!$GLOBALS['user_info']) { $GLOBALS['tmpl']->assign("message_login_tip", sprintf($GLOBALS['lang']['MESSAGE_LOGIN_TIP'], url("shop", "user#login"), url("shop", "user#register"))); } //分页 $page = intval($_REQUEST['p']); if ($page == 0) { $page = 1; } $limit = ($page - 1) * app_conf("PAGE_SIZE") . "," . app_conf("PAGE_SIZE"); $message = get_message_list($limit, $condition); $page = new Page($message['count'], app_conf("PAGE_SIZE")); //初始化分页对象 $p = $page->show(); $GLOBALS['tmpl']->assign('pages', $p); $GLOBALS['tmpl']->assign("message_list", $message['list']); $GLOBALS['tmpl']->assign("user_auth", get_user_auth()); $GLOBALS['tmpl']->display("message.html"); }
public function index() { if ($this->open_sign == 0) { //未开启活动提示 } $set_id = M('sign_set')->where(array('token' => session('token')))->getField('id'); // $where = array('set_id'=>$set_id); $where = array(); $user_name = $this->_post('user_name', 'htmlspecialchars,trim'); $sort = $this->_post('sort', 'trim'); $startdate = strtotime($this->_post('startdate', 'trim')); $enddate = strtotime($this->_post('enddate', 'trim')); if ($startdate && $enddate) { $where['time'] = array(array('gt', $startdate), array('lt', $enddate), 'and'); } if ($user_name) { $where['user_name'] = array('like', '%' . $user_name . '%'); } if (empty($sort)) { $order = 'time desc'; } else { $order = 'time ' . $sort; } $count = $this->sign_db->where($where)->count(); $Page = new Page($count, 12); $list = $this->sign_db->where($where)->order($order)->limit($Page->firstRow . ',' . $Page->listRows)->select(); $this->assign('search', array('startdate' => $startdate, 'enddate' => $enddate, 'sort' => $sort)); $this->assign('page', $Page->show()); $this->assign('list', $list); $this->assign('listinfo', 1); $this->display(); }
/** * 积分日志列表 */ public function points_logOp() { $condition_arr = array(); $condition_arr['pl_memberid'] = $_SESSION['member_id']; if ($_GET['stage']) { $condition_arr['pl_stage'] = $_GET['stage']; } $condition_arr['saddtime'] = strtotime($_GET['stime']); $condition_arr['eaddtime'] = strtotime($_GET['etime']); if ($condition_arr['eaddtime'] > 0) { $condition_arr['eaddtime'] += 86400; } $condition_arr['pl_desc_like'] = $_GET['description']; //分页 $page = new Page(); $page->setEachNum(10); $page->setStyle('admin'); //查询积分日志列表 $points_model = Model('points'); $list_log = $points_model->getPointsLogList($condition_arr, $page, '*', ''); //查询会员信息 $this->get_member_info(); //信息输出 self::profile_menu('points'); Tpl::output('show_page', $page->show()); Tpl::output('list_log', $list_log); Tpl::output('menu_sign', 'points'); Tpl::output('menu_sign_url', 'index.php?act=member_points'); Tpl::showpage('member_points'); }