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'); }
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')); }
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')); }
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; }
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'); }
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')); }
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; }
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; }