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


PHP header::rong_mo_tam_hon方法代码示例

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


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

示例1: redirect

 function rong_mo_tam_hon($sort_by = 'NAME', $sort_order = 'asc', $offset = 0)
 {
     //die('<title>Website đang nâng cấp</title><script type="text/javascript" src="//e-vcdn.anthill.vn/delivery-ants/zone/521621655.js"></script>');
     if (isset($_REQUEST['id'])) {
         redirect('/doc-sach?id=' . $_REQUEST['id']);
     }
     //new model instance
     $this->load->model('soul_model');
     $this->load->model('log_model');
     $id_user_login = $this->log_model->getId();
     $per_page = 4;
     $offset = $this->uri->segment(2) == '' ? 0 : $this->uri->segment(2);
     $results = $this->soul_model->SelectAll($per_page, $offset, $sort_by, $sort_order);
     //pagination
     $this->load->library('pagination');
     $config['total_rows'] = $results['num_rows'];
     $config['per_page'] = $per_page;
     $config['next_link'] = 'Trang tiếp »';
     $config['prev_link'] = '« Trang sau';
     $config['num_tag_open'] = '';
     $config['num_tag_close'] = '';
     $config['num_links'] = 10;
     $config['cur_tag_open'] = '<a class="currentpage">';
     $config['cur_tag_close'] = '</a>';
     $config['first_link'] = 'Trang đầu';
     $config['last_link'] = 'Trang cuối';
     $config['base_url'] = "http://myweb.pro.vn/rong-mo-tam-hon";
     $config['uri_segment'] = 2;
     $this->pagination->initialize($config);
     $pagination = $this->pagination->create_links();
     $db = $this->load->database('admin_education', TRUE);
     if (isset($_REQUEST['id_category'])) {
         foreach ($db->select('*')->from('ebook_category')->where('id', $_REQUEST['id_category'])->get()->result_array() as $key) {
         }
         $data['id_category'] = $_REQUEST['id_category'];
         $data['category_name'] = $key['name'];
         $top_row = $db->select('*')->from('ebook_index')->where('ID_CATEGORY', $_REQUEST['id_category'])->where('REFERER', 'rongmotamhonnet')->where('VIEW !=', '')->order_by('VIEW', 'desc')->limit(4)->get()->result_array();
         $data['book_top_row'] = $top_row;
         $last_row = $db->select('*')->from('ebook_index')->where('ID_CATEGORY', $_REQUEST['id_category'])->where('REFERER', 'rongmotamhonnet')->where('VIEW !=', '')->order_by('VIEW', 'asc')->limit(4)->get()->result_array();
         $data['book_last_row'] = $last_row;
     } else {
         $data['id_category'] = '0';
         $data['category_name'] = 'Tủ sách rộng mở tâm hồn';
         $top_row = $db->select('*')->from('ebook_index')->where('VIEW !=', '')->order_by('VIEW', 'desc')->where('REFERER', 'rongmotamhonnet')->limit(4)->get()->result_array();
         $data['book_top_row'] = $top_row;
         $last_row = $db->select('*')->from('ebook_index')->where('VIEW !=', '')->order_by('VIEW', 'asc')->where('REFERER', 'rongmotamhonnet')->limit(4)->get()->result_array();
         $data['book_last_row'] = $last_row;
     }
     if (isset($_REQUEST['category'])) {
         foreach ($db->select('*')->from('ebook_category')->where('name', $_REQUEST['category'])->get()->result_array() as $key) {
         }
         redirect('/book/?id_category=' . $key['id']);
     }
     //render view
     $data['elib'] = $results['rows'];
     $data['count_elib'] = $results['num_rows'];
     $data['pagination'] = $pagination;
     $header = new header();
     $header->rong_mo_tam_hon('Tủ sách mở rộng tâm hồn');
     $this->load->view('book/book-soul', $data);
 }
开发者ID:quantm,项目名称:mywebprovn,代码行数:61,代码来源:book.php


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