<?php
class User_model extends CI_Model {
function __construct()
	{
		parent::__construct();

	}
	public function get_user_list()
	{	//$searchtext, $column_name, $order_by
        $sql = "SELECT * FROM user where IsActive=0";
        $record = $this->db->query($sql);
        return $record->result_array();
	}	

	public function save_user($post_data)
	{	
				
				$user=$post_data['user'];
				$password=$post_data['password'];
				
				$data=array('user'=>$user,'password'=>$password);
				$in=$this->db->insert('user',$data);
			
				return TRUE;
				
	}	


	public function update_user($post_data)
	{	
				
				$user=$post_data['user'];
				$id=$post_data['id'];
				$password=$post_data['password'];
				
				$data=array('user'=>$user,'password'=>$password);
				$this->db->where('id',$id);
				$in=$this->db->update('user',$data);
			
				return TRUE;
				
	}	

	public function delete_user($id,$status)
	{	
			if($status=='block')
			{
				$data=array('status'=>'active');
				$this->db->where('id',$id);
				 return $this->db->update('user',$data);
			}
			else
			{
				$data=array('status'=>'block');
				$this->db->where('id',$id);
				 return $this->db->update('user',$data);
			}
			
				
	}	

}?>