当前位置: 首页>>代码示例>>PHP>>正文


PHP util::paging方法代码示例

本文整理汇总了PHP中util::paging方法的典型用法代码示例。如果您正苦于以下问题:PHP util::paging方法的具体用法?PHP util::paging怎么用?PHP util::paging使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在util的用法示例。


在下文中一共展示了util::paging方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: index

 function index()
 {
     //authen
     $pageID = 2;
     Authen::AllowPage($pageID, $this->session->userdata('role'), '/register');
     $this->load->model('register/course_m', 'course_m');
     //paging
     $limit = setting::$limit;
     $page = !$this->uri->segment(4) ? 1 : $this->uri->segment(4);
     $offset = (int) ($page * $limit - $limit);
     $courseID = 0;
     $this->course_m->context['limit'] = $limit;
     // $this->course_m->context['page'] = $page;
     $this->course_m->context['page'] = $offset;
     $this->course_m->context['filter'] = $_GET;
     $qry = "";
     if (!empty($_GET)) {
         if (isset($_GET['course']) && trim($_GET['course']) == '' && isset($_GET['month']) && trim($_GET['month']) == 0 && isset($_GET['year']) && trim($_GET['year']) == 0 && isset($_GET['status']) && trim($_GET['status']) == 0) {
             $coursecode = '';
             $this->course_m->context['courseID'] = $courseID;
             $res = $this->course_m->getCourseList(true);
         } else {
             //$coursecode = trim($_GET['course']);
             //$this->course_m->context['coursecode'] = $coursecode;
             $this->course_m->context['course'] = $_GET['course'];
             $this->course_m->context['month'] = $_GET['month'];
             $this->course_m->context['year'] = $_GET['year'];
             $this->course_m->context['status'] = $_GET['status'];
             $res = $this->course_m->searchCourse();
             $arrQry = array('course' => $_GET['course'], 'month' => $_GET['month'], 'year' => $_GET['year'], 'status' => $_GET['status']);
             $qry = "?";
             $qry .= http_build_query($arrQry);
         }
     } else {
         $coursecode = '';
         $this->course_m->context['courseID'] = $courseID;
         $res = $this->course_m->getCourseList(true);
     }
     $total = $this->course_m->getCountCourseList(true);
     $pages = util::paging($total, $limit, 'register/course/index/%s/' . $qry, 'Page', $page);
     //var_dump($total);
     $data = array();
     $data['data'] = $res;
     $data['paging'] = $pages;
     $data['cntCourse'] = $total;
     $data['course_list'] = $this->course_m->getCourseCode();
     //load template
     $this->template->set_template('admin');
     $this->template->write('title', setting::$WINDOW_TITLE);
     $this->template->write_view('content', 'register/course_index', $data);
     $this->template->render();
 }
开发者ID:Nirun,项目名称:HAsong01ha,代码行数:52,代码来源:course.php

示例2: index

 function index()
 {
     $pageID = 5;
     Authen::AllowPage($pageID, $this->session->userdata('role'));
     $this->load->model('register/course_m', 'course_m');
     //paging
     $limit = setting::$limit;
     $page = !$this->uri->segment(4) ? 1 : $this->uri->segment(4);
     $offset = (int) ($page * $limit - $limit);
     $courseID = 0;
     $this->course_m->context['limit'] = $limit;
     $this->course_m->context['page'] = $offset;
     $this->course_m->context['filter'] = $_GET;
     if (!empty($_GET)) {
         if (!isset($_GET['course']) && trim($_GET['course']) == '' && !isset($_GET['month']) && trim($_GET['month']) == 0 && !isset($_GET['year']) && trim($_GET['year']) == 0) {
             $coursecode = '';
             $this->course_m->context['courseID'] = $courseID;
             $res = $this->course_m->getCourseList();
         } else {
             $coursecode = trim($_GET['course']);
             $this->course_m->context['coursecode'] = $coursecode;
             $this->course_m->context['month'] = $_GET['month'];
             $this->course_m->context['year'] = $_GET['year'];
             $res = $this->course_m->searchCourse();
         }
     } else {
         $coursecode = '';
         $this->course_m->context['courseID'] = $courseID;
         $res = $this->course_m->getCourseList();
     }
     $total = $this->course_m->getCountCourseList();
     $pages = util::paging($total, $limit, 'register/nametag/index/%s/', 'Page', $page);
     $data = array();
     $data['data'] = $res;
     $data['paging'] = $pages;
     $data['cntCourse'] = $total;
     $data['course_list'] = $this->course_m->getCourseCode();
     //load template
     $this->template->set_template('admin');
     $this->template->write('title', setting::$WINDOW_TITLE);
     $this->template->write_view('content', 'register/course_nametag', $data);
     $this->template->render();
 }
开发者ID:Nirun,项目名称:HAsong01ha,代码行数:43,代码来源:nametag.php

示例3: all_members

 function all_members()
 {
     $pageID = 3;
     Authen::AllowPage($pageID, $this->session->userdata('role'));
     $limit = setting::$limit;
     $page = !$this->uri->segment(4) ? 1 : $this->uri->segment(4);
     $offset = (int) ($page * $limit - $limit);
     $this->load->model('register/user_m', 'user_m');
     $this->load->model('register/hospital_m', 'hospital_m');
     $this->user_m->context['filter'] = $_GET;
     $this->user_m->context['limit'] = $limit;
     $this->user_m->context['page'] = $offset;
     $res = $this->user_m->getAllUserList();
     $total = $this->user_m->getCountAllUserListByFilter();
     $total_user = $this->user_m->getCountAllUserList();
     //load template
     //var_dump($this->uri);exit;
     $data = array();
     $arr = $_GET;
     $data['g_name'] = isset($arr['name']) ? $arr['name'] : '';
     $data['g_lastname'] = isset($arr['lastname']) ? $arr['lastname'] : '';
     $data['g_register_type'] = isset($arr['register_type']) ? $arr['register_type'] : '';
     $data['g_occupation'] = isset($arr['position']) ? $arr['position'] : '';
     $data['g_hospital'] = isset($arr['hospital']) ? $arr['hospital'] : '';
     $data['g_course'] = isset($arr['course']) ? $arr['course'] : '';
     $data['_row'] = $offset;
     $arrQuery = array('name' => $data['g_name'], 'lastname' => $data['g_lastname'], 'register_type' => $data['g_register_type'], 'position' => $data['g_occupation'], 'hospital' => $data['g_hospital'], 'course' => $data['g_course']);
     foreach ($arrQuery as $key => $val) {
         if ($val == '') {
             unset($arrQuery[$key]);
         }
     }
     $txt_query = count($arrQuery) > 0 ? '?' . http_build_query($arrQuery) : '';
     $data['paging'] = util::paging($total, $limit, 'register/user/all_members/%s/' . $txt_query, 'Page', $page);
     $data['hospital_list'] = $this->hospital_m->getHospital();
     $data['totalRegister'] = $total_user;
     $data['occupation'] = $this->user_m->getOccupation();
     $data['position'] = $this->user_m->getPosition();
     $data['sent_type'] = $this->user_m->getAddType();
     // array('0' => 'บ้าน', '1' => 'ที่ทำงาน');
     $data['register_type'] = $this->user_m->getRegisType();
     // array('0' => 'สมัครเอง', '1' => 'สรพ สมัครให้', '2' => 'ผู้ประสานงานสถานพยาบาลสมัครให้');
     $data['data'] = $res;
     $this->template->set_template('admin');
     $this->template->write('title', setting::$WINDOW_TITLE);
     $this->template->write_view('content', 'register/all_members', $data);
     $this->template->render();
 }
开发者ID:Nirun,项目名称:HAsong01ha,代码行数:48,代码来源:user.php

示例4: index

 function index()
 {
     $pageID = 3;
     Authen::AllowPage($pageID, $this->session->userdata('role'));
     $limit = setting::$limit;
     $page = !$this->uri->segment(4) ? 1 : $this->uri->segment(4);
     $offset = (int) ($page * $limit - $limit);
     $courseID = 0;
     // (!$this->uri->segment(4)) ? 0 : $this->uri->segment(4);
     $this->load->model('register/user_m', 'user_m');
     $this->load->model('register/hospital_m', 'hospital_m');
     $this->load->model('register/course_m', 'course_m');
     $this->user_m->context['filter'] = $_GET;
     if (!isset($_GET['course']) || trim($_GET['course']) == '') {
         $resLastCourse = $this->user_m->getLastCourse();
         $courseID = count($resLastCourse) > 0 ? $resLastCourse[0]['courseID'] : 0;
         $this->user_m->context['filter']['course'] = $courseID;
     } else {
         $courseID = trim($_GET['course']);
     }
     $this->user_m->context['courseID'] = $courseID;
     $this->user_m->context['limit'] = $limit;
     $this->user_m->context['page'] = $offset;
     $res = $this->user_m->getUserList();
     $total = $this->user_m->getCountUserListByFilter();
     //load template
     //var_dump($this->uri);exit;
     $data = array();
     $arr = $_GET;
     $data['g_name'] = isset($arr['name']) ? $arr['name'] : '';
     $data['g_lastname'] = isset($arr['lastname']) ? $arr['lastname'] : '';
     $data['g_register_type'] = isset($arr['register_type']) ? $arr['register_type'] : '';
     $data['g_occupation'] = isset($arr['position']) ? $arr['position'] : '';
     $data['g_hospital'] = isset($arr['hospital']) ? $arr['hospital'] : '';
     $data['g_course'] = isset($arr['course']) ? $arr['course'] : '';
     $data['_row'] = $offset;
     $arrQuery = array('name' => $data['g_name'], 'lastname' => $data['g_lastname'], 'register_type' => $data['g_register_type'], 'position' => $data['g_occupation'], 'hospital' => $data['g_hospital'], 'course' => $data['g_course']);
     foreach ($arrQuery as $key => $val) {
         if ($val == '') {
             unset($arrQuery[$key]);
         }
     }
     $txt_query = count($arrQuery) > 0 ? '?' . http_build_query($arrQuery) : '';
     $dataCourse = $this->course_m->getCourse($courseID);
     $opt = $this->course_m->getCourseOptionalsList($dataCourse[0]['courseID']);
     $optional = '';
     foreach ($opt as $keyO => $valO) {
         $optional .= $valO['optional'] . ' ';
     }
     $data['paging'] = util::paging($total, $limit, 'register/user/index/%s/' . $txt_query, 'Page', $page);
     $data['hospital_list'] = $this->hospital_m->getHospital();
     $data['last_course'] = count($dataCourse) > 0 ? $dataCourse[0] : null;
     $data['totalRegister'] = $this->user_m->getTotalRegisterByCourse($courseID);
     $data['optional'] = $optional;
     $data['course_list'] = $this->course_m->getAllCourses();
     $data['occupation'] = $this->user_m->getOccupation();
     $data['position'] = $this->user_m->getPosition();
     $data['sent_type'] = $this->user_m->getAddType();
     // array('0' => 'บ้าน', '1' => 'ที่ทำงาน');
     $data['register_type'] = $this->user_m->getRegisType();
     // array('0' => 'สมัครเอง', '1' => 'สรพ สมัครให้', '2' => 'ผู้ประสานงานสถานพยาบาลสมัครให้');
     $data['showCourse'] = false;
     // ($this->uri->segment(3)) ? true : false;
     $data['data'] = $res;
     $this->template->set_template('admin');
     $this->template->write('title', setting::$WINDOW_TITLE);
     $this->template->write_view('content', 'register/user_index', $data);
     $this->template->render();
 }
开发者ID:Nirun,项目名称:HAsong01ha,代码行数:69,代码来源:_user.php


注:本文中的util::paging方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。