<?php 

class members extends CI_Controller {

	function members()	 

	{  

    parent::__construct();	

    $this->load->library('session');		

    $this->load->Model('functions', 'fun');  //function in model 

    $this->load->library('pagination');

    $this->load->library('DX_Auth');	

	$this->dx_auth->check_uri_permissions();



    } 

    

	

		

	function index()

	{   

	    $this->load->model('members_model');  /// model file name

	    	

	   //////pagination styl and config

	    $config['base_url'] = base_url().'members/index/';

		$config['total_rows'] = $this->members_model->get_num_members();

		$config['per_page'] = 25;

		$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(4,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;

		$menu['type']='cat';

		$this->load->view('left',$menu);

		

		////// load content send query to get post 

		$data=array();

		$q=$this->members_model->get_members($config['per_page']);   ///////model class --->model func		

		$data['records']=$q;

	

		$data['status']=$status;

		$this->load->view('members',$data);

		

		//$this->load->view('footer');

	}

	

	

	function view_order($id)

	{

	$this->load->model('orders_model');   

	$status='all';

	    $data=array();

	    $this->load->view('header');

	    

	    $menu=array();

		$menu_q= $this->fun->get_modules();

		$menu['mods']=$menu_q;

		$menu['status']=$status;

		$menu['type']='cat';

		$this->load->view('left',$menu);

		

		$data['status']=$status;

		$data['uid']=$id;



		

		//// get admin lang

		$lang_q= $this->fun->get_lang();

		$data['lang']=$lang_q;

		

		$this->load->view('view_order',$data);

		//$this->load->view('footer');



	}







	

	

	function delete_order($id)

	{ 	

	   // $q= $this->fun->delete_one("contact_us", $id); 

	    $q= $this->fun->delete_one("members", $id); 

	    if($q)

	    {

	     echo "<script type=\"text/javascript\"> alert(\" Deleted successfully \") ;window.location.href= \"".base_url()."index.php/members/\";</script>";

	    }

	    else

	    {

	    echo "<script type=\"text/javascript\"> alert(\" Dont Deleted Please Try Again \") ;window.location.href= \"".base_url()."index.php/members/\";</script>";

	    }
	}
	
	
	
	
	
function change_status($st,$id)

	{ 	

	   // $q= $this->fun->delete_one("contact_us", $id); 
		$data=array('active'=>$st);
	    $q= $this->fun->status2($data, $id); 

	    
	     echo "<script type=\"text/javascript\">window.location.href= \"".base_url()."index.php/members/\";</script>";

	  

	   

	

	}

	

}

/* End of file welcome.php */

/* Location: ./application/controllers/welcome.php */