コード例 #1
0
 function training_event()
 {
     $options = array();
     $ci =& get_instance();
     $t = new Training_event();
     $t->order_by('event_from', 'DESC');
     $types = $t->get();
     $ci->load->helper('text');
     foreach ($types as $type) {
         $tc = new Training_course();
         $tc->get_by_id($type->course_id);
         $options[$type->id] = $type->event_from . "\t \t | " . $type->event_to . "\t \t | " . $tc->course_title;
     }
     return $options;
 }
コード例 #2
0
 function event()
 {
     $data['page_name'] = '<b>Training Event</b>';
     $data['msg'] = '';
     $this->load->library('pagination');
     $event = new Training_event();
     $config['base_url'] = base_url() . 'training_manage/event';
     $config['total_rows'] = $event->get()->count();
     $config['per_page'] = '15';
     $this->config->load('pagination', TRUE);
     $pagination = $this->config->item('pagination');
     // We will merge the config file of pagination
     $config = array_merge($config, $pagination);
     $this->pagination->initialize($config);
     // How many related records we want to limit ourselves to
     $limit = $config['per_page'];
     // Set the offset for our paging
     $offset = $this->uri->segment(3);
     $event->order_by('event_from', 'DESC');
     $data['rows'] = $event->get($limit, $offset);
     $data['page'] = $this->uri->segment(3);
     $data['main_content'] = 'event';
     return View::make('includes/template', $data);
 }