<?php
class LoginModel extends CI_Model {
	function checkLogin($email,$password){
		$whereArray = array(
			'fsEmail'=>$email,
			'fsPassword'=>md5($password)
		);
		$userDetails = $this->db->select('*')->from('tbl_admin')->where($whereArray)->get();
		$userDetails = $userDetails->row_array();
// Role Menager
		if(count($userDetails) == 0){
			$whereArray = array(
				'fsEmail'=>$email,
				'fsPassword'=>md5($password)
			);
			$userDetails = $this->db->select('*')->from('hotels')->where($whereArray)->get();
			$userDetails = $userDetails->row_array();
			if(count($userDetails) > 0){
				$userDetails['isUserType'] = 'hotel';
			}
		}else{
			$userDetails['isUserType'] = 'admin';
		}
// End Pass session on siderbar.php menu list
		return $userDetails;
	}
}
