public function index() { global_run(); init_app_page(); $GLOBALS['tmpl']->assign("no_nav", true); //无分类下拉 if (check_save_login() != LOGIN_STATUS_LOGINED) { app_redirect(url("index", "user#login")); } $page = intval($_REQUEST['p']); if ($page <= 0) { $page = 1; } $limit = ($page - 1) * app_conf("PAGE_SIZE") . "," . app_conf("PAGE_SIZE"); $user_id = intval($GLOBALS['user_info']['id']); $result = get_voucher_list($limit, $user_id); $GLOBALS['tmpl']->assign("list", $result['list']); $page = new Page($result['count'], app_conf("PAGE_SIZE")); //初始化分页对象 $p = $page->show(); $GLOBALS['tmpl']->assign('pages', $p); $GLOBALS['tmpl']->assign("page_title", $GLOBALS['lang']['UC_VOUCHER']); assign_uc_nav_list(); //左侧导航菜单 $GLOBALS['tmpl']->display("uc/uc_voucher_index.html"); }
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_voucher_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); $GLOBALS['tmpl']->assign("page_title", $GLOBALS['lang']['UC_VOUCHER']); $GLOBALS['tmpl']->assign("inc_file", "inc/uc/uc_voucher_index.html"); $GLOBALS['tmpl']->display("uc.html"); }