function get_list($condition = 'status=3', $order = 'itemid DESC') { global $MOD, $pages, $page, $pagesize, $offset, $items, $sum; if ($page > 1 && $sum) { $items = $sum; } else { $r = $this->db->get_one("SELECT COUNT(*) AS num FROM {$this->table} WHERE {$condition}"); $items = $r['num']; } $pages = pages($items, $page, $pagesize); if ($items < 1) { return array(); } $lists = array(); $result = $this->db->query("SELECT * FROM {$this->table} WHERE {$condition} ORDER BY {$order} LIMIT {$offset},{$pagesize}"); while ($r = $this->db->fetch_array($result)) { $r['adddate'] = timetodate($r['addtime'], 5); if (strpos($r['content'], '<hr class="club_break" />') !== false) { $r['content'] = substr($r['content'], strpos($r['content'], '<hr class="club_break" />')); } $r['title'] = get_intro($r['content'], 50); $r['alt'] = get_intro($r['content'], 500); $r['linkurl'] = $MOD['linkurl'] . 'goto.php?itemid=' . $r['itemid']; $lists[] = $r; } return $lists; }
public function indexAction() { $search = daddslashes($this->postVar('search', '')); $mobile = daddslashes($this->postVar('sms_mobile', '')); $startTime = daddslashes($this->postVar('start_time', '')); $endTime = daddslashes($this->postVar('end_time', '')); $page = (int) $this->reqVar('page', 1); if (!empty($search) && !empty($mobile)) { $passwdSet['mobile'] = $mobile; } if (!empty($startTime)) { $passwdSet['start_time'] = $startTime; } if (!empty($endTime)) { $passwdSet['end_time'] = $endTime; } $passwdList = $this->smspassModel->getPasswdList($passwdSet, $page, 20); $passwdCount = $this->smspassModel->getPasswdCount($passwdSet); $passwdPages = pages($passwdCount, $page, 20, '', $array = array()); $this->assign('mobile', $mobile); $this->assign('passwdList', $passwdList); $this->assign("smspwStatus", $this->configModel['smspw_status']); $this->assign('passwdPages', $passwdPages); $this->getViewer()->needLayout(false); $this->render('smspasswd'); }
function get_list($condition = '1', $order = 'addtime DESC') { global $MOD, $pages, $page, $pagesize, $offset, $sum; if ($page > 1 && $sum) { $items = $sum; } else { $r = $this->db->get_one("SELECT COUNT(*) AS num FROM {$this->table} WHERE {$condition}"); $items = $r['num']; } $pages = pages($items, $page, $pagesize); if ($items < 1) { return array(); } $lists = array(); $result = $this->db->query("SELECT * FROM {$this->table} WHERE {$condition} ORDER BY {$order} LIMIT {$offset},{$pagesize}"); while ($r = $this->db->fetch_array($result)) { $r['adddate'] = timetodate($r['addtime'], 5); $r['editdate'] = timetodate($r['edittime'], 5); $r['title'] = set_style($r['title'], $r['style']); $r['linkurl'] = $MOD['linkurl'] . rewrite('expert.php?itemid=' . $r['itemid']); $r['rate'] = $r['answer'] && $r['best'] < $r['answer'] ? dround($r['best'] * 100 / $r['answer'], 2, true) . '%' : '100%'; $lists[] = $r; } return $lists; }
function get_list($condition, $order = 'listorder ASC,itemid ASC') { global $MOD, $pages, $page, $pagesize, $offset, $sum; if ($page > 1 && $sum) { $items = $sum; } else { $r = $this->db->get_one("SELECT COUNT(*) AS num FROM {$this->table} WHERE {$condition}"); $items = $r['num']; } $pages = pages($items, $page, $pagesize); if ($items < 1) { return array(); } $lists = array(); $result = $this->db->query("SELECT * FROM {$this->table} WHERE {$condition} ORDER BY {$order} LIMIT {$offset},{$pagesize}"); while ($r = $this->db->fetch_array($result)) { $r['adddate'] = timetodate($r['addtime'], 5); $r['editdate'] = timetodate($r['edittime'], 5); if ($r['areaid']) { $r['address'] = area_pos($r['areaid'], '') . $r['address']; } $lists[] = $r; } return $lists; }
public function index() { //$Line_type = M('Line_type'); $catid = I('get.catid', 1); $sql = "select count(*) as num from __LINE_TYPE__ as a,__LINE__ as b\n where a.type_id = {$catid} and a.line_id = b.line_id and b.status=1"; $pageNum = 10; $_page = pages($sql, $pageNum); $nowPage = I('get.p', 1); $firstRow = ($nowPage - 1) * $pageNum; $Model = new \Think\Model(); $line_lists = $Model->query("select a.*, b.* from __LINE_TYPE__ as a,\n __LINE__ as b where a.type_id = {$catid} and a.line_id = b.line_id and b.status=1\n order by b.update_time desc, b.line_id desc limit {$firstRow},{$pageNum}"); $line_lists = array_filter($line_lists); foreach ($line_lists as $key => $val) { $map_two = array(); $map_two['line_id&is_default'] = array($val['line_id'], 1, '_multi' => true); $res = get_tc_val($map_two); $line_lists[$key]['price'] = $res['price']; $line_lists[$key]['best_price'] = $res['best_price']; $line_lists[$key]['start_date'] = get_start_date($res['date_price_data']); $line_lists[$key]['img'] = get_cover(array_shift(explode(',', $val['images'])), 'path'); $line_lists[$key]['url'] = U('Line/show', array('id' => $val['line_id'])); } $this->assign('line_lists', $line_lists); $this->assign('_page', $_page); $this->display(); }
function get_list($condition = '1', $order = 'listorder DESC, itemid DESC') { global $MODULE, $MOD, $pages, $page, $pagesize, $offset, $sum; if ($page > 1 && $sum) { $items = $sum; } else { $r = $this->db->get_one("SELECT COUNT(*) AS num FROM {$this->table} WHERE {$condition}"); $items = $r['num']; } $pages = pages($items, $page, $pagesize); $GROUP = cache_read('group.php'); $lists = array(); $result = $this->db->query("SELECT * FROM {$this->table} WHERE {$condition} ORDER BY {$order} LIMIT {$offset},{$pagesize}"); while ($r = $this->db->fetch_array($result)) { $r['adddate'] = timetodate($r['addtime'], 5); $r['thumb'] = is_file(DT_ROOT . '/' . $MODULE[4]['moduledir'] . '/skin/' . $r['skin'] . '/thumb.gif') ? $MODULE[4]['linkurl'] . 'skin/' . $r['skin'] . '/thumb.gif' : $MODULE[4]['linkurl'] . 'image/nothumb.gif'; $groupid = explode(',', substr($r['groupid'], 1, -1)); $group = array(); foreach ($groupid as $gid) { $group[] = $GROUP[$gid]['groupname']; } $r['group'] = implode('<br/>', $group); $lists[] = $r; } return $lists; }
public function indexAction() { $page = (int) $this->reqVar('page', 1); $actionOs = daddslashes(trim($this->reqVar('action_os', 'ios'))); $pageUrl = "/admin/version/"; $versionSet = array(); $start = ($page - 1) * 20; $end = $page * 20; if (!empty($actionOs)) { $versionSet['os_type'] = $actionOs; $pageUrl .= "?action_os={$actionOs}"; $versionList = $this->versionModel->query("SELECT * FROM z_version where status in (0, 1) AND os_type='{$actionOs}' ORDER BY id DESC LIMIT {$start}, {$end}"); } else { $versionList = $this->versionModel->query("SELECT * FROM z_version where status in (0, 1) ORDER BY id DESC LIMIT {$start}, {$end}"); } // $versionList = $this->versionModel->query("SELECT * FROM z_version where status in (0, 1) ORDER BY id DESC LIMIT $start, $end"); $versionCount = $this->versionModel->getVersionCount($versionSet); $versionPages = pages($versionCount, $page, 20, $pageUrl, array()); $this->assign('versionList', $versionList); $this->assign('versionPages', $versionPages); $this->assign("packageOs", $this->configModel['pk_os']); $this->assign("publicRadio", $this->configModel['public_radio']); $this->assign("publicRadio_force", $this->configModel['public_radio_force']); $this->assign("versionStatus", $this->configModel['version_status']); $this->assign("actionOs", $actionOs); $this->assign('page', $page); $this->assign('adminId', UID); $this->getViewer()->needLayout(false); $this->render('version_list'); }
function get_list($condition = 'status=3', $order = 'itemid DESC') { global $MOD, $TYPE, $pages, $page, $pagesize, $offset, $items, $sum; if ($page > 1 && $sum) { $items = $sum; } else { $r = $this->db->get_one("SELECT COUNT(*) AS num FROM {$this->table} WHERE {$condition}"); $items = $r['num']; } $pages = pages($items, $page, $pagesize); if ($items < 1) { return array(); } $lists = $groupids = array(); $result = $this->db->query("SELECT * FROM {$this->table} WHERE {$condition} ORDER BY {$order} LIMIT {$offset},{$pagesize}"); while ($r = $this->db->fetch_array($result)) { $r['adddate'] = timetodate($r['addtime'], 5); $groupids[$r['gid']] = $r['gid']; $lists[] = $r; } if ($groupids) { $GRPS = array(); $result = $this->db->query("SELECT itemid,title,linkurl FROM {$this->db->pre}club_group WHERE itemid IN (" . implode(',', $groupids) . ")"); while ($r = $this->db->fetch_array($result)) { $GRPS[$r['itemid']] = $r; } if ($GRPS) { foreach ($lists as $k => $v) { $lists[$k]['groupname'] = $v['gid'] ? $GRPS[$v['gid']]['title'] : ''; $lists[$k]['groupurl'] = $v['gid'] ? $MOD['linkurl'] . $GRPS[$v['gid']]['linkurl'] : ''; } } } return $lists; }
function get_list($condition = 'status=3', $order = 'addtime DESC', $cache = '') { global $MOD, $pages, $page, $pagesize, $offset, $items, $TYPE, $special, $sum; if ($page > 1 && $sum) { $items = $sum; } else { $r = $this->db->get_one("SELECT COUNT(*) AS num FROM {$this->table} WHERE {$condition}", $cache); $items = $r['num']; } $pages = pages($items, $page, $pagesize); if ($items < 1) { return array(); } $lists = array(); $result = $this->db->query("SELECT * FROM {$this->table} WHERE {$condition} ORDER BY {$order} LIMIT {$offset},{$pagesize}", $cache); while ($r = $this->db->fetch_array($result)) { $r['adddate'] = timetodate($r['addtime'], 5); $r['editdate'] = timetodate($r['edittime'], 5); $r['alt'] = $r['title']; $r['title'] = set_style($r['title'], $r['style']); $r['type'] = $r['typeid'] && isset($TYPE[$r['typeid']]) ? set_style($TYPE[$r['typeid']]['typename'], $TYPE[$r['typeid']]['style']) : ''; $r['typeurl'] = $r['type'] ? rewrite($MOD['linkurl'] . 'type.php?tid=' . $r['typeid']) : ''; $lists[] = $r; } return $lists; }
public function indexAction() { $page = (int) $this->reqVar('page', 1); $actionType = daddslashes($this->postVar('action_type', '')); $actionStatus = daddslashes($this->postVar('action_status', '')); $adSet = array(); if (!empty($actionType)) { $adSet['action'] = $actionType; } if (is_numeric($actionStatus)) { $adSet['z_status'] = $actionStatus; } $adList = $this->adwidgetModel->getAdList($adSet, $page, 60); $adCount = $this->adwidgetModel->getAdCount($adSet); $adPages = pages($adCount, $page, 60, '', $array = array()); $this->assign('adList', $adList); $this->assign('adCount', $adCount); $this->assign('adPages', $adPages); $this->assign("adTop", $this->configModel['ad_top']); $this->assign("adStatus", $this->configModel['ad_status']); $this->assign("adZStatus", $this->configModel['ad_z_status']); $this->assign("adType", $this->configModel['ad_widget_type']); $this->assign("actionType", $actionType); $this->assign("actionStatus", $actionStatus); $this->getViewer()->needLayout(false); $this->render('adwidget_list'); }
public function indexAction() { $page = (int) $this->reqVar('page', 1); $menuSet = array(); $menuList = $this->menuModel->getMenuList($menuSet, $page, 100); if ($menuList) { foreach ($menuList as $key => $val) { if (empty($val['parent_id'])) { $menuList[$key]['parent_name'] = '一级菜单'; continue; } $menuParent = $this->menuModel->getMenu(array('id' => $val['parent_id'])); if ($menuParent) { $menuList[$key]['parent_name'] = $menuParent['name']; } else { $menuList[$key]['parent_name'] = ''; } } } $menuCount = $this->menuModel->getMenuCount($menuSet); $menuPages = pages($menuCount, $page, 100, '', $array = array()); $this->assign('menuList', $menuList); $this->assign("menuConceal", $this->configModel['menu_conceal']); $this->assign("menuStatus", $this->configModel['menu_status']); $this->assign('menuCount', $menuCount); $this->assign('menuPages', $menuPages); $this->assign('page', $page); $this->getViewer()->needLayout(false); $this->render('menu_list'); }
function get_list($condition = '1', $order = 'addtime DESC') { global $pages, $page, $pagesize, $offset, $pagesize, $MOD, $item, $sum; if ($page > 1 && $sum) { $items = $sum; } else { $r = $this->db->get_one("SELECT COUNT(*) AS num FROM {$this->table} WHERE {$condition}"); $item = $r['num']; } $pages = pages($item, $page, $pagesize); $lists = $pids = $P = array(); $result = $this->db->query("SELECT * FROM {$this->table} WHERE {$condition} ORDER BY {$order} LIMIT {$offset},{$pagesize}"); while ($r = $this->db->fetch_array($result)) { $r['adddate'] = timetodate($r['addtime'], 5); $r['editdate'] = timetodate($r['edittime'], 5); $r['linkurl'] = $MOD['linkurl'] . rewrite('price.php?itemid=' . $r['pid']); $pids[$r['pid']] = $r['pid']; $lists[] = $r; } if ($pids) { $result = $this->db->query("SELECT * FROM {$this->table_product} WHERE itemid IN (" . implode(',', $pids) . ")"); while ($r = $this->db->fetch_array($result)) { $P[$r['itemid']] = $r; } if ($P) { foreach ($lists as $k => $v) { $lists[$k]['unit'] = $P[$v['pid']]['unit']; $lists[$k]['alt'] = $P[$v['pid']]['title']; $lists[$k]['title'] = set_style($P[$v['pid']]['title'], $P[$v['pid']]['style']); } } } return $lists; }
function show() { global $set, $db, $apx, $html; quicklink('contact.add'); $orderdef[0] = 'title'; $orderdef['title'] = array('title', 'ASC', 'COL_TITLE'); $orderdef['email'] = array('email', 'ASC', 'COL_EMAIL'); $col[] = array('ID', 3, 'align="center"'); $col[] = array('COL_TITLE', 50, 'class="title"'); $col[] = array('COL_EMAIL', 47, ''); list($count) = $db->first("SELECT count(id) FROM " . PRE . "_contact"); pages('action.php?action=contact.show&sortby=' . $_REQUEST['sortby'], $count); $data = $db->fetch("SELECT id,title,email FROM " . PRE . "_contact " . getorder($orderdef) . getlimit()); if (count($data)) { foreach ($data as $res) { ++$i; $tabledata[$i]['COL1'] = $res['id']; $tabledata[$i]['COL2'] = replace($res['title']); $tabledata[$i]['COL3'] = replace($res['email']); //Optionen if ($apx->user->has_right('contact.edit')) { $tabledata[$i]['OPTIONS'] .= optionHTML('edit.gif', 'contact.edit', 'id=' . $res['id'], $apx->lang->get('CORE_EDIT')); } if ($apx->user->has_right('contact.del')) { $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('del.gif', 'contact.del', 'id=' . $res['id'], $apx->lang->get('CORE_DEL')); } } } $apx->tmpl->assign('TABLE', $tabledata); $html->table($col); orderstr($orderdef, 'action.php?action=contact.show'); save_index($_SERVER['REQUEST_URI']); }
function get_list($condition = 'status=3', $order = 'itemid DESC') { global $MOD, $pages, $page, $pagesize, $offset, $sum; if ($page > 1 && $sum) { $items = $sum; } else { $r = $this->db->get_one("SELECT COUNT(*) AS num FROM {$this->table} WHERE {$condition}"); $items = $r['num']; } $pages = pages($items, $page, $pagesize); if ($items < 1) { return array(); } $lists = array(); $result = $this->db->query("SELECT * FROM {$this->table} WHERE {$condition} ORDER BY {$order} LIMIT {$offset},{$pagesize}"); while ($r = $this->db->fetch_array($result)) { $r['adddate'] = timetodate($r['addtime'], 5); $r['content'] = nl2br($r['content']); $r['editdate'] = '--'; if ($r['reply']) { $r['reply'] = nl2br($r['reply']); $r['editdate'] = timetodate($r['edittime'], 5); } $lists[] = $r; } return $lists; }
public function indexAction() { $keyword = daddslashes($this->reqVar('keyword', '')); $startTime = daddslashes($this->reqVar('start_time', '')); $endTime = daddslashes($this->reqVar('end_time', '')); $page = (int) $this->reqVar('page', 1); $pageUrl = "/admin/thread_raffle/"; $raffleSet = array(); if (!empty($keyword)) { $raffleSet['tid'] = $keyword; $pageUrl .= "?keyword={$keyword}"; } if (!empty($startTime)) { $raffleSet['start_time'] = $startTime . " 00:00:00"; $pageUrl .= !empty($keyword) ? "&" : "?"; $pageUrl .= "start_time={$startTime}"; } if (!empty($endTime)) { $raffleSet['end_time'] = $startTime . " 23:59:59"; $pageUrl .= !empty($keyword) || !empty($startTime) ? "&" : "?"; $pageUrl .= "end_time={$endTime}"; } $raffleList = $this->raffleModel->getRaffleList($raffleSet); $raffleCount = $this->raffleModel->getRaffleCount($raffleSet); $rafflePages = pages($raffleCount, $page, 20, $pageUrl, array()); $this->assign('raffleList', $raffleList); $this->assign('rafflePages', $rafflePages); $this->assign('isImagesStatus', $this->isImagesStatus); $this->assign('keyword', $keyword); $this->assign('page', $page); $this->assign('siteUrl', $this->siteUrl); $this->getViewer()->needLayout(false); $this->render('thread_raffle_list'); }
function get_list($condition = '1', $order = 'listorder DESC,addtime DESC') { global $MOD, $TYPE, $pages, $page, $pagesize, $offset, $L, $sum; if ($page > 1 && $sum) { $items = $sum; } else { $r = $this->db->get_one("SELECT COUNT(*) AS num FROM {$this->table} WHERE {$condition}"); $items = $r['num']; } $pages = pages($items, $page, $pagesize); if ($items < 1) { return array(); } $lists = array(); $result = $this->db->query("SELECT * FROM {$this->table} WHERE {$condition} ORDER BY {$order} LIMIT {$offset},{$pagesize}"); while ($r = $this->db->fetch_array($result)) { $r['title'] = set_style($r['title'], $r['style']); $r['adddate'] = timetodate($r['addtime'], 5); $r['editdate'] = timetodate($r['edittime'], 5); $r['fromdate'] = $r['fromtime'] ? timetodate($r['fromtime'], 3) : $L['timeless']; $r['todate'] = $r['totime'] ? timetodate($r['totime'], 3) : $L['timeless']; $r['typename'] = $TYPE[$r['typeid']]['typename']; $r['typeurl'] = $MOD['announce_url'] . list_url($r['typeid']); $lists[] = $r; } return $lists; }
public function indexAction() { $page = (int) $this->reqVar('page', 1); $actionOs = daddslashes(trim($this->reqVar('action_os', ''))); $actionStatus = daddslashes($this->reqVar('action_status', '')); $actionType = daddslashes($this->reqVar('action_type', '')); $pageUrl = "/admin/notification/"; $notificationSet = array(); if (!empty($actionOs)) { $notificationSet['os_type'] = $actionOs; $pageUrl .= "?action_os={$actionOs}"; } if (is_numeric($actionStatus)) { $notificationSet['status'] = $actionStatus; $pageUrl .= !empty($actionOs) ? "&" : "?"; $pageUrl .= "action_status={$actionStatus}"; } if (!empty($actionType)) { $notificationSet['action'] = $actionType; if (!empty($actionOs) || is_numeric($actionStatus)) { $pageUrl .= "&action_type={$actionType}"; } else { $pageUrl .= "?action_type={$actionType}"; } } $notificationList = $this->notificationModel->getNotificationList($notificationSet, $page, 60); // foreach($notificationList as &$var) // { // // var_dump("SELECT COUNT(*) as num FROM a_notification WHERE id = {$var['id']}");die(); // // $a = $this->notificationModel->query("SELECT COUNT(*) as num FROM a_notification_public WHERE status = 1 and nid = {$var['id']}")[0]['num']; // $b = $this->notificationModel->query("SELECT COUNT(*) as num FROM a_notification_public_master WHERE status = 1 and nid = {$var['id']}")[0]['num']; // // $good= intval($a) + intval($b); // // $a = $this->notificationModel->query("SELECT COUNT(*) as num FROM a_notification_public WHERE status = 2 and nid = {$var['id']}")[0]['num']; // $b = $this->notificationModel->query("SELECT COUNT(*) as num FROM a_notification_public_master WHERE status = 2 and nid = {$var['id']}")[0]['num']; // $bad= intval($a) + intval($b); // // $var['send_num'] = $good . "/" . $bad; // } $notificationCount = $this->notificationModel->getNotificationCount($notificationSet); $notificationPages = pages($notificationCount, $page, 60, $pageUrl, $array = array()); $this->assign('notificationList', $notificationList); $this->assign('notificationCount', $notificationCount); $this->assign('notificationPages', $notificationPages); $this->assign("notificationStatus", $this->configModel['notification_status']); $this->assign("notificationType", $this->configModel['notification_type']); $this->assign("publicType", $this->configModel['public_type']); $this->assign("pkOs", $this->configModel['pk_os']); $this->assign("adStatus", $this->configModel['ad_status']); $this->assign("actionType", $actionType); $this->assign("actionStatus", $actionStatus); $this->assign("actionOs", $actionOs); $this->assign('page', $page); $this->assign('adminId', UID); $this->getViewer()->needLayout(false); $this->render('notification_list'); }
public function indexAction() { $company = daddslashes($this->reqVar('company', '')); $page = (int) $this->reqVar('page', 1); $s_n = 60 * ($page - 1); // 每页取60条数据 $e_n = 60 * $page; $pageUrl = "/admin/expense/"; $startTime = daddslashes($this->reqVar('start_time', '')); $endTime = daddslashes($this->reqVar('end_time', date('Y-m-d', time()))); if (!empty($startTime)) { $pageUrl .= "&start_time={$startTime}"; } if (!empty($endTime)) { $endTime = date("Y-m-d", strtotime($endTime . ' + 1 day')); $pageUrl .= "&end_time={$endTime}"; } if (!empty($company)) { $pageUrl .= "&company={$company}"; $List = $this->expenseModel->query("SELECT DISTINCT(company) FROM t_company_expense ;"); $company_list = " AND company in ("; foreach ($List as $var) { if (strstr($var['company'], $company)) { $company_list .= "'" . $var['company'] . "', "; } } $company_list .= "'_')"; $expenseList = $this->expenseModel->query("SELECT * FROM t_company_expense WHERE flag ='1' {$company_list} AND ctime > '{$startTime}' AND ctime < '{$endTime}' ORDER BY id DESC LIMIT {$s_n}, {$e_n}"); $expenseCount = $this->expenseModel->query("SELECT COUNT(*) FROM t_company_expense WHERE flag ='1' {$company_list} AND ctime > '{$startTime}' AND ctime < '{$endTime}' ;")[0]["COUNT(*)"]; } else { $sql = "SELECT * FROM t_company_expense WHERE flag ='1' AND ctime > '{$startTime}' AND ctime < '{$endTime}' ORDER BY id DESC LIMIT {$s_n}, {$e_n}"; $expenseList = $this->expenseModel->query($sql); $sql = "SELECT COUNT(*) FROM t_company_expense WHERE flag ='1' AND ctime > '{$startTime}' AND ctime < '{$endTime}';"; $expenseCount = $this->expenseModel->query($sql)[0]["COUNT(*)"]; } foreach ($expenseList as &$var) { if ($var['remark'] == '0') { $var['remark'] = ''; } if ($var['num_promo'] == '0') { $var['num_promo'] = ''; } if ($var['price'] == '0') { $var['price'] = ''; } } $expensePages = pages($expenseCount, $page, 60, $pageUrl, $array = array()); $this->assign('company', $company); $this->assign('startTime', $startTime); $endTime = date("Y-m-d", strtotime($endTime . ' - 1 day')); $this->assign('endTime', $endTime); $this->assign('expensePages', $expensePages); $this->assign("expenseList", $expenseList); $this->assign('adminId', UID); $this->getViewer()->needLayout(false); $this->render('expense_stat_list'); }
/** * Render a template from the /site/templates/ directory * * @param string $file The filename of the template to render * @param array $data Data for the template * @param $return Default false, Set to true to return the output * @return void */ protected function render($file = 'index', $data = [], $return = false) { tpl::$data = array_merge(tpl::$data, ['kirby' => kirby(), 'site' => site(), 'pages' => pages()], $data); $output = tpl::load(kirby()->roots()->templates() . '/' . $file . '.php'); if ($return) { return $output; } die($output); }
public function init() { $page = isset($_GET['page']) && intval($_GET['page']) ? intval($_GET['page']) : 1; $pagesize = 20; $offset = ($page - 1) * $pagesize; $total = $this->db->count(); $pages = pages($total, $page, $pagesize); $list = $this->db->select('', '*', $offset.','.$pagesize); include $this->admin_tpl('applications_list'); }
/** * * 短信消费记录 */ public function sms_pay_history() { $page = isset($_GET['page']) ? intval($_GET['page']) : 1; $paylist_apiarr = $this->smsapi->get_payhistory($page); $paylist_arr = !empty($paylist_apiarr['datas']) ? $paylist_apiarr['datas'] : array(); $payhistoryinfo_total = !empty($paylist_apiarr['total']) ? $paylist_apiarr['total'] : 0; $pages = pages($payhistoryinfo_total, $page, 20); include $this->admin_tpl('sms_pay_history'); }
/** * 表单向导首页 */ public function index() { $SEO = seo($this->siteid, '', L('formguide_list')); $page = max(intval($_GET['page']), 1); $r = $this->db->get_one(array('siteid'=>$this->siteid, 'type'=>3, 'disabled'=>0), 'COUNT(`modelid`) AS sum'); $total = $r['sum']; $pages = pages($total, $page, 20); $offset = ($page-1)*20; $datas = $this->db->select(array('siteid'=>$this->siteid, 'type'=>3, 'disabled'=>0), 'modelid, name, addtime', $offset.',20', '`modelid` DESC'); include template('formguide', 'index'); }
/** * 查询多条数据并分页 * @param $where * @param $order * @param $page * @param $pagesize * @return unknown_type */ public final function listinfo($where = '', $order = '', $page = 1, $pagesize = 20, $key = '', $setpages = 10, $urlrule = '', $array = array()) { $where = to_sqls($where); $this->number = $this->count($where); $page = max(intval($page), 1); $offset = $pagesize * ($page - 1); $this->pages = pages($this->number, $page, $pagesize, $urlrule, $array, $setpages); $array = array(); return $this->select($where, '*', "{$offset}, {$pagesize}", $order, '', $key); }
public function indexAction() { $keyword = daddslashes($this->reqVar('keyword', '')); $startTime = daddslashes($this->reqVar('start_time', '')); $endTime = daddslashes($this->reqVar('end_time', '')); $page = (int) $this->reqVar('page', 1); $pageUrl = "/admin/operate/"; if (!empty($keyword)) { $opertaeSet['operat'] = $keyword; $pageUrl .= "?keyword={$keyword}"; } if (!empty($startTime)) { $opertaeSet['start_time'] = $startTime; $pageUrl .= !empty($keyword) ? "&" : "?"; $pageUrl .= "&start_time={$startTime}"; } if (!empty($endTime)) { $opertaeSet['end_time'] = $endTime; if (!empty($keyword) || !empty($startTime)) { $pageUrl .= "&end_time={$endTime}"; } else { $pageUrl .= "?end_time={$endTime}"; } } $operateList = $this->operateModel->getOpLogList($opertaeSet, $page, 20); if ($operateList) { foreach ($operateList as $key => $val) { $contentStr = ''; $content = json_decode($val['content'], true); // die(); if (is_array($content)) { foreach ($content as $ckey => $cval) { $contentStr .= $ckey . "/" . $cval . ","; } $contentStr = trim($contentStr, ","); $contentSub = cn_substr($contentStr, 20); $operateList[$key]['content'] = $contentStr; $operateList[$key]['content_sub'] = $contentSub; } else { $operateList[$key]['content'] = $operateList[$key]['content_sub'] = $content; } // $operateList[$key]['content_sub'] = $val['content']; } } $operateCount = $this->operateModel->getOpLogCount($opertaeSet); $operatePages = pages($operateCount, $page, 20, $pageUrl, array()); $this->assign('keyword', $keyword); $this->assign('startTime', $startTime); $this->assign('endTime', $endTime); $this->assign('operateList', $operateList); $this->assign('operatePages', $operatePages); $this->assign("page", $page); $this->getViewer()->needLayout(false); $this->render('operate_list'); }
public function init() { $total = $this->db->count(); $page = isset($_GET['page']) && intval($_GET['page']) ? intval($_GET['page']) : 1; $pagesize = 20; $offset = ($page - 1) * $pagesize; $list = $this->db->select('', '*', $offset.','.$pagesize); $pages = pages($total, $page, $pagesize); $show_dialog = true; $big_menu = array('javascript:window.top.art.dialog({id:\'add\',iframe:\'?m=zl_admin&c=site&a=add\', title:\''.L('add_site').'\', width:\'700\', height:\'500\', 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_site')); include $this->admin_tpl('site_list'); }
function get_list($condition, $order) { global $pages, $page, $pagesize, $offset, $pagesize; $pages = pages($this->db->count($this->table, $condition), $page, $pagesize); $lists = array(); $result = $this->db->query("SELECT * FROM {$this->table} WHERE {$condition} ORDER BY {$order} LIMIT {$offset},{$pagesize}"); while ($r = $this->db->fetch_array($result)) { $lists[] = $r; } return $lists; }
public function indexAction() { $page = (int) $this->reqVar('page', 1); $feedbackSet = array(); $feedbackList = $this->feedbackModel->getFeedbackList($feedbackSet, $page, 20); $feedbackCount = $this->feedbackModel->getFeedbackCount($feedbackSet); $feedbackPages = pages($feedbackCount, $page, 20, '', $array = array()); $this->assign('feedbackList', $feedbackList); $this->assign('feedbackPages', $feedbackPages); $this->getViewer()->needLayout(false); $this->render('feedback_list'); }
function get_list($condition, $order = 'itemid DESC') { global $MOD, $TYPE, $pages, $page, $pagesize, $offset, $items, $sum, $L; if ($page > 1 && $sum) { $items = $sum; } else { $r = $this->db->get_one("SELECT COUNT(*) AS num FROM {$this->table} WHERE {$condition}"); $items = $r['num']; } $pages = pages($items, $page, $pagesize); if ($items < 1) { return array(); } $lists = $groupids = array(); $result = $this->db->query("SELECT * FROM {$this->table} WHERE {$condition} ORDER BY {$order} LIMIT {$offset},{$pagesize}"); while ($r = $this->db->fetch_array($result)) { $r['adddate'] = timetodate($r['addtime'], 5); if ($r['typeid'] == 1) { $r['linkurl'] = "javascript:alert('" . $L['manage_has_del'] . "');"; } else { $r['linkurl'] = $r['tid'] ? DT_PATH . 'api/redirect.php?mid=' . $MOD['moduleid'] . '&itemid=' . $r['tid'] : $MOD['linkurl'] . 'goto.php?itemid=' . $r['rid']; } $r['value'] = ''; if ($r['typeid'] == 3) { $r['value'] = $r['content'] ? $L['manage_level'] . $r['content'] : $L['manage_cancel']; } else { if ($r['typeid'] == 4) { $r['value'] = $r['content'] ? $r['content'] == 1 ? $L['manage_ontop_1'] : $L['manage_ontop_2'] : $L['manage_cancel']; } else { if ($r['typeid'] == 5) { $r['value'] = $r['content'] ? '<div style="width:10px;height:10px;line-height:10px;background:' . $r['content'] . ';"> </div>' : $L['manage_cancel']; } } } $groupids[$r['gid']] = $r['gid']; $lists[] = $r; } if ($groupids) { $GRPS = array(); $result = $this->db->query("SELECT itemid,title,linkurl FROM {$this->db->pre}club_group WHERE itemid IN (" . implode(',', $groupids) . ")"); while ($r = $this->db->fetch_array($result)) { $GRPS[$r['itemid']] = $r; } if ($GRPS) { foreach ($lists as $k => $v) { $lists[$k]['groupname'] = $v['gid'] ? $GRPS[$v['gid']]['title'] : ''; $lists[$k]['groupurl'] = $v['gid'] ? $MOD['linkurl'] . $GRPS[$v['gid']]['linkurl'] : ''; } } } return $lists; }
public function indexAction() { $page = (int) $this->reqVar('page', 1); $deviceSet = array(); $deviceList = $this->deviceModel->getDeviceModeifyList($deviceSet, $page, 20); $deviceCount = $this->deviceModel->getDeviceModeifyCount($deviceSet); $devicePages = pages($deviceCount, $page, 20, '', $array = array()); $this->assign('deviceList', $deviceList); $this->assign('devicePages', $devicePages); $this->assign("deviceStatus", $this->configModel['device_modify_status']); $this->getViewer()->needLayout(false); $this->render('device_modify_list'); }
public function init() { $total = $this->db->count(); $page = isset($_GET['page']) && intval($_GET['page']) ? intval($_GET['page']) : 1; $pagesize = 20; $offset = ($page - 1) * $pagesize; $list = $this->db->select('', '*', $offset.','.$pagesize); pc_base::load_sys_class('format', '', 0); foreach ($list as $key=> $v) { $list[$key]['lastlogin'] = format::date($v['lastlogin'], 1); } $pages = pages($total, $page, $pagesize); include $this->admin_tpl('administrator_list'); }