當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。