Viewing file:      books.php (1.94 KB)      -rwxr-xr-x Select action/file-type:    (+) |   (+) |   (+) | Code (+) | Session (+) |   (+) | SDB (+) |   (+) |   (+) |   (+) |   (+) |   (+) |
 
<?php
 include('ea_controller.php');
 class Books extends Ea_controller {
     
 //    function __construct() {
 //        parent::Controller();
 //        $this->load->helper('url');
 //        $this->load->database();
 //    }
     
     function index() {
         
         //load pagination class
         $this->load->library('pagination');
 
         $config['base_url'] = base_url().'index_codeigniter.php/ealumni/books/index/';
         $config['total_rows'] = $this->db->count_all('christian_books');
         $config['num_links'] = '3';
         $config['per_page'] = '3';
         $config['full_tag_open'] = '<p>';
         $config['full_tag_close'] = '</p>';
 
         $this->pagination->initialize($config);
 
         //load the model and get results
         $this->load->model($this->config->item("ea_folder").'books_model');
         //$this->load->model('books_model');
         $data['results'] = $this->books_model->get_books($config['per_page'],$this->uri->segment(4));
         
         // load the HTML Table Class
         $this->load->library('table');
         $this->table->set_heading('ID', 'Title', 'Author', 'Description');
 
         $data['links'] = $this->pagination->create_links();
         
         // load the view
         $this->load->view($this->config->item('ea_folder').'books_view', $data);
     }
 
     function make() {
         $this->load->library('pagination');
 
         $config['base_url'] = base_url().'index.php/books/make/';
         $config['total_rows'] = $this->db->count_all('education');
         $config['num_links'] = '3';
         $config['per_page'] = '50';
         $config['full_tag_open'] = '<p>';
         $config['full_tag_close'] = '</p>';
 
         $this->pagination->initialize($config);
 
         //load the model and get results
         $this->load->model('education');
         $data['results'] = $this->education->qryEduLimitPage($config['per_page'],$this->uri->segment(3));
         
         // load the HTML Table Class
         $this->load->library('table');
         $this->table->set_heading('ID', 'ชื่อสถาบัน ไทย', 'รหัสการใช้');
         
         // load the view
         $this->load->view('books_view', $data);
     }
 }
 ?>
  |