<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Mod_profile extends CI_Model{
	
	var $table = "tbluser";
	function __construct()
	{
		parent::__construct();	
	}

	function compPassword($userId,$password)
	{
       	 $this->db->select('*');
       	 $this->db->where('userid', $userId);
         $this->db->where('password', $password);
       	 $this->db->from('tbluser');
         $data=$this->db->get();
          if($data->num_rows() > 0)
		  {
			 return TRUE;
          }else{
			  
			 return FALSE;
          }
   	}	
	
	public function changeProfile($data,$id)
	{
		$this->db->where("userid",$id);
		$this->db->update($this->table,$data);
	}
	
	function getUser($id)
	{
	   	$this->db->select('*');
        $this->db->where('userid', $id);
        $this->db->from('tbluser');
		$q = $this->db->get();
			
        if($q->num_rows() > 0)
		{
			return $q->row();
        }
		return FALSE;
        
	}

	
}