function training_contact()
 {
     $options = array();
     $ci =& get_instance();
     $t = new Training_contact();
     $t->order_by('contact_name');
     $types = $t->get();
     $ci->load->helper('text');
     foreach ($types as $type) {
         $options[$type->id] = $type->contact_name;
     }
     return $options;
 }
 function contact_info()
 {
     $data['page_name'] = '<b>Training Contact Information</b>';
     $data['msg'] = '';
     $this->load->library('pagination');
     $contact = new Training_contact();
     $config['base_url'] = base_url() . 'training_manage/contact_info';
     $config['total_rows'] = $contact->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);
     $contact->order_by('contact_name');
     if (Input::get('contact_type_id') != 0) {
         $contact->where('contact_type_id', Input::get('contact_type_id'));
         //$limit = '';
     }
     $data['rows'] = $contact->get($limit, $offset);
     $data['page'] = $this->uri->segment(3);
     $data['main_content'] = 'contact_info';
     return View::make('includes/template', $data);
 }