<?php 
class imports extends CI_Controller {
	function imports()	 
	{  
    parent::__construct();	
    $this->load->library('session');		
    $this->load->Model('functions', 'fun');  //function in model 
    $this->load->library('pagination');
    $this->load->library('DX_Auth');
    $this->load->helper('form');
	$this->load->helper('url');
	$this->load->library('form_validation');
	$this->dx_auth->check_uri_permissions();

    } 
    
	
		
	function index()
	{   
	    $this->load->model('imports_model');  /// model file name
	    	
	   //////pagination styl and config
	    $config['base_url'] = base_url().'index.php/imports/index/';
		$config['total_rows'] = $this->imports_model->get_num_imports();
		$config['per_page'] = 10;
		$config['num_links'] = 3; 
		$config['uri_segment'] = 3;	
		$config['full_tag_open']='<div class="pagination">';
		$config['full_tag_close'] = '</div>';
		$config['next_link'] = 'Next';
		$config['prev_link'] = 'Prev';
		$config['cur_tag_open'] = '<span class="current">';
		$config['cur_tag_close'] = '</span>';		
		$offset = $this->uri->segment(3,0);
		$this->session->set_userdata('offset',$offset);
		$this->pagination->initialize($config); 
		
		$this->load->view('header');
		
		//// load left and send query to creat menu
		$status='all';
		
		$menu=array();
		$menu_q= $this->fun->get_modules();
		$menu['mods']=$menu_q;
		$menu['status']=$status;
		$this->load->view('left',$menu);
		
		////// load content send query to get post 
		$data=array();
		$q=$this->imports_model->get_imports($config['per_page']);   ///////model class --->model func		
		$data['records']=$q;
		
		$this->load->view('imports',$data);
		
		$this->load->view('footer');
	}
	
	
	function show_imports($id)
	{   
	
	    $this->load->model('imports_model');  /// model file name
	    	
	 		
		$this->load->view('header');
		
		//// load left and send query to creat menu
		$status='all';
		
		$menu=array();
		$menu_q= $this->fun->get_modules();
		$menu['mods']=$menu_q;
		$menu['status']=$status;
		$this->load->view('left',$menu);
		
		////// load content send query to get post 
		$data=array();
		$q=$this->imports_model->show_import($id);   ///////model class --->model func		
		$data['records']=$q;
		
		$this->load->view('show_imports',$data);
		
		$this->load->view('footer');
	}
	


}
/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */