<?php 
class users_model extends CI_model
 {
   
	

		function get_users($rec_no)
		{
		  $this->db->order_by("id", "asc"); 
		  $query=$this->db->get('users',$rec_no,$this->uri->segment(3)); // select * from posts where module='$type'  limit $rec_no
		  
		  if($query->num_rows() > 0)
		    return $query->result(); 
		     return FALSE;

		}
		
		function get_num_users()
		{
		  $query=$this->db->get('users'); // select * from posts where module='$type' 
		  if($query->num_rows() > 0)
		    return $query->num_rows(); 
		     return FALSE;
		}

		
		
		function add_new_user($dt)
		{
			 $this->db->where('username',$dt['username']);
	          $data = array('role_id'=>$dt['roleid']);
              $this->db->update('users', $data);
		}
		
		function update_category($data,$id)
		{
		$this->db->where('id',$id);
		$q=$this->db->update('categories',$data);
		//if($q->num_rows() > 0)
		return $q; 
		//return FALSE;
		}
	
	
	

}
