Commit 37c95ff2 by Tobin

staff user changes and customer care changes

parent 5481f172
...@@ -6,11 +6,16 @@ class Dashboard extends CI_Controller { ...@@ -6,11 +6,16 @@ class Dashboard extends CI_Controller {
public function __construct() { public function __construct() {
parent::__construct(); parent::__construct();
date_default_timezone_set("Asia/Riyadh"); date_default_timezone_set("Asia/Riyadh");
$this->load->model('Dashboard_model');
if(!$this->session->userdata('logged_in')) { if(!$this->session->userdata('logged_in')) {
redirect(base_url('Login')); redirect(base_url('Login'));
} }
$userType = $this->session->userdata['user_type'];
if($userType == 5){
redirect(base_url('Customer_Booking'));
}
redirect(base_url('Event/listEvents')); redirect(base_url('Event/listEvents'));
} }
......
...@@ -188,7 +188,7 @@ class Event extends CI_Controller { ...@@ -188,7 +188,7 @@ class Event extends CI_Controller {
$subject = "TimeOut, New Event Created"; $subject = "TimeOut, New Event Created";
$emailId = $settings['admin_mail_id']; $emailId = $settings['admin_mail_id'];
$message = "<html><body> $message = "<html><body>
New Event Created, event name: <strong>".$_POST['event_name_en']."</strong>. Event URL : ".base_url()."eventdetail?event_id=$event_id New Event Created, event name: <strong>".$_POST['event_name_en']."</strong>. Event URL : ".base_url()."Event/listEvents
</body></html>"; </body></html>";
$this->Api_model->send_mail($subject,$emailId,$message); $this->Api_model->send_mail($subject,$emailId,$message);
} }
......
...@@ -579,7 +579,7 @@ class Webservice extends CI_Controller { ...@@ -579,7 +579,7 @@ class Webservice extends CI_Controller {
else{ else{
$this->errorResponse($res['code'],$res['message']); $this->errorResponse($res['code'],$res['message']);
} }
} }
public function update_user_visibility(){ public function update_user_visibility(){
$data = (array) json_decode(file_get_contents('php://input')); $data = (array) json_decode(file_get_contents('php://input'));
...@@ -593,266 +593,99 @@ class Webservice extends CI_Controller { ...@@ -593,266 +593,99 @@ class Webservice extends CI_Controller {
} }
} }
public function get_hotel_city_list($data){ public function get_hotel_city_list(){
try{ $data = $_GET;
$user_id = $this->auth_token_get($data['auth_token']); $data['auth_token'] = $this->auth_token;
if($user_id > 0) { $res = $this->Webservice_model->get_hotel_city_list($data);
$cond = ''; if($res['status'] == 1){
if(isset($data['query']) && !empty($data['query'])){ $this->response($res['data']);
$cond = "AND THC.hotel_city_name LIKE '%".$data['query']."%'";
}
$sql = "SELECT HC.hotel_city_id FROM hotel_cities AS HC
INNER JOIN translator_hotel_city AS THC ON(THC.hotel_city_id=HC.hotel_city_id)
WHERE HC.status=1 $cond";
$count = $this->db->query($sql)->num_rows();
if($count >= 1){
$perPage = 10;
$page = (isset($data['page']))?$data['page']:1;
$limit = ($page - 1) * $perPage;
$meta = array('total_pages'=>ceil($count/$perPage),'total'=>$count,
'current_page'=>$page,'per_page'=>$perPage);
$sql = "SELECT THC.hotel_city_id AS id,HC.hotel_city_icon AS image
FROM translator_hotel_city AS THC
INNER JOIN hotel_cities AS HC ON (HC.hotel_city_id=THC.hotel_city_id)
WHERE THC.status=1 $cond GROUP BY HC.hotel_city_id LIMIT $limit,$perPage";
$hotelData = $this->db->query($sql)->result_array();
$countryData = $this->getCountryData($user_id);
$lang = $countryData['language_code'];
foreach ($hotelData as $key => $value) {
if(!empty($lanTrans = langTranslator($value['id'],'HCTY',$lang))){
$hotelData[$key]['name'] = $lanTrans['hotel_city_name'];
}
}
if(count($hotelData) < 0){
$res = array('status'=>0,'message'=>'No Data Found','code'=>'ER10');
}
$res = array('status'=>1,'data'=>array('city_list'=>$hotelData,'meta'=>$meta));
}else{
$res = array('status'=>0,'message'=>'No Data Found','code'=>'ER10');
}
}else{ }else{
$res = array('status'=>0,'message'=>'User Authentication Failed','code'=>'ER15'); $this->errorResponse($res['code'],$res['message']);
} }
} catch(Exception $e){ }
$res = array('status'=>0,'message'=>'Ohh No!! Something Went South!!','code'=>'ER08');
} public function hotel_search(){
return $res; $data = (array)json_decode(file_get_contents('php://input'));
} $data['auth_token'] = $this->auth_token;
$res = $this->Webservice_model->hotel_search($data);
public function hotel_search($data){ if($res['status'] == 1){
try{ $this->response($res['data']);
$user_id = $this->auth_token_get($data['auth_token']); }else{
if($user_id > 0) { $this->errorResponse($res['code'],$res['message']);
$trackingId = time().rand(100000,999999); }
$settings = getSettings(); }
if(!isset($data['nextToken']) && empty($data['nextToken'])){
$this->db->select('nationality');
$userData = $this->db->get_where('customer',array('customer_id'=>$user_id))->row_array();
$countryData = $this->getCountryData($user_id);
}
$url = (isset($data['nextToken']) && !empty($data['nextToken']))?"https://trawex.biz/api/hotel_trawexv5/getMoreHotels?user_id=".$settings['trawex_user_id']."&user_password=".$settings['trawex_user_password']."&access=".$settings['trawex_access']."&ip_address=".$settings['trawex_ip_address']."&sessionId=".$data['sessionId']."&nextToken=".$data['nextToken']."&trackingId=".$data['trackingId']."":"https://trawex.biz/api/hotel_trawexv5/hotel_search";
if(!isset($data['nextToken']) && empty($data['nextToken'])){
$postData = array('user_id'=>$settings['trawex_user_id'],
'user_password'=>$settings['trawex_user_password'],
'access'=>$settings['trawex_access'],
'ip_address'=>$settings['trawex_ip_address'],
'trackingId'=>$trackingId,'city_name'=>$data['city_name'],
'country_name'=>$data['country_name'],
'room_count'=>$data['room_count'],'adult'=>$data['adult'],
'child'=>$data['child'],'child_age'=>$data['child_age'],
'checkin'=>$data['checkin'],'checkout'=>$data['checkout'],
'client_nationality'=>$userData['nationality'],
'requiredCurrency'=>$countryData['currency']);
}
$postFields = (isset($data['nextToken']) && !empty($data['nextToken']))?'':$postData; public function get_specific_hotel_content(){
$result = $this->passToJsonCurl($url,$postFields); $data = (array)json_decode(file_get_contents('php://input'));
if(!empty($result)){ $data['auth_token'] = $this->auth_token;
$result = json_decode($result); $res = $this->Webservice_model->get_specific_hotel_content($data);
$result->status->trackingId = (!isset($data['nextToken']) && empty($data['nextToken']))?$trackingId:$data['trackingId']; if($res['status'] == 1){
$res = array('status'=>1,'data'=>array('itineraries'=> $result)); $this->response($res['data']);
}else{
$res = array('status'=>0,'message'=>'No Data Found','code'=>'ER07');
}
}else{ }else{
$res = array('status'=>0,'message'=>'User Authentication Error','code'=>'ER10'); $this->errorResponse($res['code'],$res['message']);
} }
}catch(Exception $e){ }
$res = array('status'=>0,'message'=>'Ohh No!! Something Went South!!','code'=>'ER08');
} public function get_room_rates(){
return $res; $data = (array)json_decode(file_get_contents('php://input'));
} $data['auth_token'] = $this->auth_token;
$res = $this->Webservice_model->get_room_rates($data);
public function get_specific_hotel_content($data){ if($res['status'] == 1){
try{ $this->response($res['data']);
$user_id = $this->auth_token_get($data['auth_token']);
if($user_id > 0) {
$settings = getSettings();
$url = "https://trawex.biz/api/hotel_trawexv5/get_specific_hotel_content?user_id=".$settings['trawex_user_id']."&user_password=".$settings['trawex_user_password']."&access=".$settings['trawex_access']."&ip_address=".$settings['trawex_ip_address']."&sessionId=".$data['sessionId']."&trackingId=".$data['trackingId']."&productId=".$data['productId']."&hotelId=".$data['hotelId']."";
$result = $this->passToJsonCurl($url,'');
if(!empty($result)){
$result = json_decode($result);
$result->trackingId = $data['trackingId'];
$res = array('status'=>1,'data'=>$result);
}else{
$res = array('status'=>0,'message'=>'No Data Found','code'=>'ER06');
}
}else{ }else{
$res = array('status'=>0,'message'=>'User Authentication Error','code'=>'ER10'); $this->errorResponse($res['code'],$res['message']);
} }
}catch(Exception $e){ }
$res = array('status'=>0,'message'=>'Ohh No!! Something Went South!!','code'=>'ER08');
} public function get_rate_rules(){
return $res; $data = (array) json_decode(file_get_contents('php://input'));
} $data['auth_token'] = $this->auth_token;
$res = $this->Webservice_model->get_rate_rules($data);
public function get_room_rates($data){ if($res['status'] == 1){
try{ $this->response($res['data']);
$user_id = $this->auth_token_get($data['auth_token']); }else{
if($user_id > 0){ $this->errorResponse($res['code'],$res['message']);
$settings = getSettings(); }
$url = "https://trawex.biz/api/hotel_trawexv5/get_room_rates"; }
$postData = array("user_id"=>$settings['trawex_user_id'],"user_password"=>$settings['trawex_user_password'],"access"=>$settings['trawex_access'],"ip_address"=>$settings['trawex_ip_address'],"TraceId"=>$data['TraceId'],"propertyid"=>$data['propertyid'],"trackingId"=>$data['trackingId'],"sessionId"=>$data['sessionId'],"productId"=>$data['productId'],"TokenId"=>$data['TokenId'],"resultindex"=>$data['resultindex'],"hotelcode"=>$data['hotelcode']);
$result = $this->passToJsonCurl($url,$postData); public function hotel_book(){
if(!empty($result)){ $data = (array)json_decode(file_get_contents('php://input'));
$result = json_decode($result); $data['auth_token'] = $this->auth_token;
$result->trackingId = $data['trackingId']; $res = $this->Webservice_model->hotel_book($data);
$res = array('status'=>1,'data'=>$result); if($res['status'] == 1){
}else{ $this->response($res['data']);
$res = array('status'=>0,'message'=>'No data Found','code'=>'ER06'); }else{
} $this->errorResponse($res['code'],$res['message']);
}else{ }
$res = array('status'=>0,'message'=>'User Authentication Error','code'=>'ER10'); }
}
}catch (Exception $e){ public function trawex_cancel_booking(){
$res = array('status'=>0,'message'=>'Ohh No!! Something Went South!!','code'=>'ER08'); $data = (array)json_decode(file_get_contents('php://input'));
} $data['auth_token'] = $this->auth_token;
return $res; $res = $this->Webservice_model->trawex_cancel_booking($data);
} if($res['status'] == 1){
$this->response($res['data']);
public function get_rate_rules($data){ }else{
try{ $this->errorResponse($res['code'],$res['message']);
$user_id = $this->auth_token_get($data['auth_token']); }
if($user_id > 0){
$settings = getSettings();
$url = "https://trawex.biz/api/hotel_trawexv5/get_booking_terms";
$postData = array(
"user_id"=>$settings['trawex_user_id'],
"user_password"=>$settings['trawex_user_password'],
"access"=>$settings['trawex_access'],
"ip_address"=>$settings['trawex_ip_address'],
"TraceId"=>$data['TraceId'],"propertyid"=>$data['propertyid'],
"trackingId"=>$data['trackingId'],"sessionId"=>$data['sessionId'],
"productId"=>$data['productId'],"TokenId"=>$data['TokenId'],
"resultindex"=>$data['resultindex'],"hotelcode"=>$data['hotelcode'],
"allocationDetails"=>$data['allocationDetails'],
"booking_token"=>$data['booking_token'],
"hotel_name"=>$data['hotel_name'],"infosource"=>$data['infosource'],
"meal_code"=>$data['meal_code'],
"rate_basis_id"=>$data['rate_basis_id'],
"room_code"=>$data['room_code'],
"roomType_runno"=>$data['roomType_runno']);
$result = $this->passToJsonCurl($url,$postData);
if(!empty($result)){
$result = json_decode($result);
$result->trackingId = $data['trackingId'];
$res = array('status'=>1,'data'=>$result);
}else{
$res = array('status'=>0,'message'=>'No data Found','code'=>'ER06');
}
}else{
$res = array('status'=>0,'message'=>'User Authentication Error','code'=>'ER10');
}
} catch(Exception $e){
$res = array('status'=>0,'message'=>'Ohh No!! Something Went South!!','code'=>'ER08');
}
return $res;
}
public function hotel_book($data){
try{
$user_id = $this->auth_token_get($data['auth_token']);
if($user_id > 0){
$settings = getSettings();
$url = "https://trawex.biz/api/hotel_trawexv5/hotel_book";
$postData = array(
"user_id"=>$settings['trawex_user_id'],
"user_password"=>$settings['trawex_user_password'],
"access"=>$settings['trawex_access'],
"ip_address"=>$settings['trawex_ip_address'],
"TraceId"=>$data['TraceId'],"propertyid"=>$data['propertyid'],
"trackingId"=>$data['trackingId'],"sessionId"=>$data['sessionId'],
"productId"=>$data['productId'],"TokenId"=>$data['TokenId'],
"resultindex"=>$data['resultindex'],"hotelcode"=>$data['hotelcode'],
"changedOccupancy"=>$data['changedOccupancy'],
"extrabeds"=>$data['extrabeds'],
"guests_details"=>$data['guests_details'],"refcode"=>$data['refcode'],
"prebookingtoken"=>$data['prebookingtoken']
);
$result = $this->passToJsonCurl($url,$postData);
if(!empty($result)){
$result = json_decode($result);
$result->trackingId = $data['trackingId'];
$res = array('status'=>1,'data'=>$result);
}else{
$res = array('status'=>0,'message'=>'No data Found','code'=>'ER06');
}
}else{
$res = array('status'=>0,'message'=>'User Authentication Error','code'=>'ER10');
}
} catch(Exception $e){
$res = array('status'=>0,'message'=>'Ohh No!! Something Went South!!','code'=>'ER08');
}
return $res;
}
public function trawex_cancel_booking($data){
try{
$user_id = $this->auth_token_get($data['auth_token']);
if($user_id > 0){
$settings = getSettings();
$url = "https://trawex.biz/api/hotel_trawexv5/cancel_booking";
$postData = array(
"user_id"=>$settings['trawex_user_id'],
"user_password"=>$settings['trawex_user_password'],
"access"=>$settings['trawex_access'],
"ip_address"=>$settings['trawex_ip_address'],
'trackingId'=>$data['trackingId'],'productId'=>$data['productId'],
'supplierConfirmationNum'=>$data['supplierConfirmationNum'],
'reference'=>$data['reference']
);
$result = $this->passToJsonCurl($url,$postData);
if(!empty($result)){
$result = json_decode($result);
$result->trackingId = $data['trackingId'];
$res = array('status'=>1,'data'=>$result);
}else{
$res = array('status'=>0,'message'=>'No data Found','code'=>'ER06');
}
}else{
$res = array('status'=>0,'message'=>'User Authentication Error','code'=>'ER10');
}
} catch(Exception $e){
$re = array('status'=>0,'message'=>'Ohh No!! Something Went South!!','code'=>'ER08');
}
return $res;
}
public function passToJsonCurl($url='',$postData=array()){
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch,CURLOPT_POST,1);
curl_setopt($ch,CURLOPT_POSTFIELDS,json_encode($postData));
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch,CURLOPT_HTTPHEADER,array('Content-Type:application/json'));
$result = curl_exec($ch);
curl_close($ch);
return $result;
} }
/*******************************Flight API******************************************/
public function flight_authenticate(){
$data = (array)json_decode(file_get_contents('php://input'));
$data['auth_token'] = $this->auth_token;
$res = $this->Webservice_model->flight_authenticate($data);
if($res['status'] == 1){
$this->response($res['data']);
}else{
$this->errorResponse($res['code'],$res['message']);
}
}
} }
?> ?>
...@@ -175,6 +175,10 @@ ...@@ -175,6 +175,10 @@
'Organizer'=>array(1,2,3,4),'Booking'=>array(1,2,3,4), 'Organizer'=>array(1,2,3,4),'Booking'=>array(1,2,3,4),
'Notification'=>array(1,2,3,4),'HotelCity'=>array(1,2,3,4)); 'Notification'=>array(1,2,3,4),'HotelCity'=>array(1,2,3,4));
break; break;
case 5:
$menus = array('Customer'=>array(),'Customer_Booking'=>array());
break;
} }
return $menus; return $menus;
} }
...@@ -392,4 +396,4 @@ ...@@ -392,4 +396,4 @@
} }
return $langArr; return $langArr;
} }
?> ?>
\ No newline at end of file
...@@ -5,10 +5,12 @@ class Booking_model extends CI_Model { ...@@ -5,10 +5,12 @@ class Booking_model extends CI_Model {
parent::_construct(); parent::_construct();
} }
public function getBookingData($booking_id='',$provider_id='',$view='0,1,2,3,5,6'){ public function getBookingData($booking_id='',$provider_id='',$view='0,1,2,3,5,6',$customer_id='',$bookId=''){
$cond = (!empty($view))?" BOK.status IN ($view) ":" BOK.status != '4' "; $cond = (!empty($view))?" BOK.status IN ($view) ":" BOK.status != '4' ";
$cond .= (!empty($bookId))?" AND BOK.bookId='$bookId' ":"";
$cond .= (!empty($booking_id))?" AND BOK.id='$booking_id' ":""; $cond .= (!empty($booking_id))?" AND BOK.id='$booking_id' ":"";
$cond .= (!empty($provider_id))?" AND EVT.provider_id='$provider_id' ":""; $cond .= (!empty($provider_id))?" AND EVT.provider_id='$provider_id' ":"";
$cond .= (!empty($customer_id))?" AND BOK.customer_id='$customer_id' ":"";
$sql = "SELECT BOK.id AS booking_id,CUST.customer_id,CUST.name AS customer_name,EVT.provider_id, $sql = "SELECT BOK.id AS booking_id,CUST.customer_id,CUST.name AS customer_name,EVT.provider_id,
CUST.phone AS customer_phone,CUST.email AS customer_email,CUST.gender,EVT.venue_id, CUST.phone AS customer_phone,CUST.email AS customer_email,CUST.gender,EVT.venue_id,
...@@ -31,7 +33,7 @@ class Booking_model extends CI_Model { ...@@ -31,7 +33,7 @@ class Booking_model extends CI_Model {
WHERE $cond"; WHERE $cond";
$bookingData = $this->db->query($sql); $bookingData = $this->db->query($sql);
if(empty($bookingData)){ if($bookingData->num_rows() <= 0){
return 0; return 0;
} }
......
...@@ -9,7 +9,7 @@ class Login_model extends CI_Model { ...@@ -9,7 +9,7 @@ class Login_model extends CI_Model {
public function login($username, $password) { public function login($username, $password) {
$query = $this->db->query("SELECT * FROM users $query = $this->db->query("SELECT * FROM users
WHERE username='$username' AND password='$password' AND WHERE username='$username' AND password='$password' AND
user_type IN (1,2,4) AND status='1'"); user_type IN (1,2,4,5) AND status='1'");
if($query->num_rows() > 0 && !empty($query)){ if($query->num_rows() > 0 && !empty($query)){
$result = $query->row(); $result = $query->row();
...@@ -34,4 +34,4 @@ class Login_model extends CI_Model { ...@@ -34,4 +34,4 @@ class Login_model extends CI_Model {
return $result; return $result;
} }
} }
?> ?>
\ No newline at end of file
...@@ -456,7 +456,11 @@ class Organizer_model extends CI_Model { ...@@ -456,7 +456,11 @@ class Organizer_model extends CI_Model {
public function signIn($data){ public function signIn($data){
try{ try{
$sql = $this->db->query("SELECT USR.* FROM users AS USR INNER JOIN provider AS PDR ON (PDR.provider_id = USR.id) WHERE USR.password='".md5($data['password'])."' AND PDR.email='".$data['email_id']."' AND USR.user_type='".$data['user_type']."'"); if($data['user_type'] == '2'){
$sql = $this->db->query("SELECT USR.* FROM users AS USR INNER JOIN provider AS PDR ON (PDR.provider_id = USR.id) WHERE USR.password='".md5($data['password'])."' AND PDR.email='".$data['email_id']."' AND USR.user_type='".$data['user_type']."'");
}else{
$sql = $this->db->query("SELECT * FROM checker WHERE username='".$data['email_id']."' AND password='".$data['password']."' AND status='1'");
}
if(empty($sql) || empty($custData = $sql->row_array())){ if(empty($sql) || empty($custData = $sql->row_array())){
$res = array('status'=>0,'message'=>'User Doesnot Exist','code'=>'ER09'); $res = array('status'=>0,'message'=>'User Doesnot Exist','code'=>'ER09');
...@@ -475,9 +479,14 @@ class Organizer_model extends CI_Model { ...@@ -475,9 +479,14 @@ class Organizer_model extends CI_Model {
$res = array('status'=>0,'message'=>'New Password and Confirm Password Doesnot Match','code'=>'ER10'); $res = array('status'=>0,'message'=>'New Password and Confirm Password Doesnot Match','code'=>'ER10');
return $res; return $res;
} }
if($this->db->query("UPDATE users SET password='".md5($data['confirm_password'])."' WHERE id='".$data['user_id']."' AND user_type='".$data['user_type']."'")){ if($data['user_type'] == '2'){
$status = $this->db->query("UPDATE users SET password='".md5($data['confirm_password'])."' WHERE id='".$data['user_id']."' AND user_type='".$data['user_type']."'");
}else{
$status = $this->db->query("UPDATE checker SET password ='".md5($data['confirm_password'])."' WHERE id='".$data['user_id']."'");
}
if($status){
$res = array('status'=>1,'message'=>'Password Updated Successfully'); $res = array('status'=>1,'message'=>'Password Updated Successfully');
} }
} catch (Exception $e){ } catch (Exception $e){
$res = array('status'=>0,'message'=>'Ohh No!! Something Went South','code'=>'ER06'); $res = array('status'=>0,'message'=>'Ohh No!! Something Went South','code'=>'ER06');
} }
......
...@@ -8,7 +8,7 @@ class Staff_model extends CI_Model { ...@@ -8,7 +8,7 @@ class Staff_model extends CI_Model {
$cond = (!empty($view))?" AND status IN ($view) ":" status != '2' "; $cond = (!empty($view))?" AND status IN ($view) ":" status != '2' ";
$cond .= (!empty($staff_id))?" AND id='$staff_id' ":""; $cond .= (!empty($staff_id))?" AND id='$staff_id' ":"";
$staffData = $this->db->query("SELECT * FROM users WHERE user_type='4' ".$cond); $staffData = $this->db->query("SELECT * FROM users WHERE user_type IN (4,5) ".$cond);
if(!empty($staffData)){ if(!empty($staffData)){
return (!empty($staff_id))?$staffData->row():$staffData->result(); return (!empty($staff_id))?$staffData->row():$staffData->result();
...@@ -22,7 +22,7 @@ class Staff_model extends CI_Model { ...@@ -22,7 +22,7 @@ class Staff_model extends CI_Model {
$userNameChk = $this->db->query("SELECT * FROM users $userNameChk = $this->db->query("SELECT * FROM users
WHERE status!='2' AND username='".$staff_data['username']."' AND WHERE status!='2' AND username='".$staff_data['username']."' AND
user_type='4'"); user_type IN (4,5)");
if(!empty($userNameChk) && $userNameChk->num_rows() > 0) return 2; if(!empty($userNameChk) && $userNameChk->num_rows() > 0) return 2;
$status = $this->db->insert('users', $status = $this->db->insert('users',
...@@ -30,7 +30,7 @@ class Staff_model extends CI_Model { ...@@ -30,7 +30,7 @@ class Staff_model extends CI_Model {
'password'=>$staff_data['password'], 'password'=>$staff_data['password'],
'display_name'=>$staff_data['display_name'], 'display_name'=>$staff_data['display_name'],
'profile_image'=>$staff_data['profile_image'], 'profile_image'=>$staff_data['profile_image'],
'user_type'=>'4','status'=>'1')); 'user_type'=>$staff_data['user_type'],'status'=>'1'));
return $status; return $status;
} }
...@@ -39,7 +39,7 @@ class Staff_model extends CI_Model { ...@@ -39,7 +39,7 @@ class Staff_model extends CI_Model {
return 0; return 0;
$userNameChk = $this->db->query("SELECT * FROM users $userNameChk = $this->db->query("SELECT * FROM users
WHERE status!='2' AND username='".$staff_data['username']."' AND WHERE status!='2' AND username='".$staff_data['username']."' AND
user_type='4' AND id!='".$staff_id."'"); user_type IN (4,5) AND id!='".$staff_id."'");
if(!empty($userNameChk) && $userNameChk->num_rows() > 0) { return 2; } if(!empty($userNameChk) && $userNameChk->num_rows() > 0) { return 2; }
if(!isset($staff_data['profile_image']) || empty($staff_data['profile_image'])){ if(!isset($staff_data['profile_image']) || empty($staff_data['profile_image'])){
...@@ -58,4 +58,4 @@ class Staff_model extends CI_Model { ...@@ -58,4 +58,4 @@ class Staff_model extends CI_Model {
return $status; return $status;
} }
} }
?> ?>
\ No newline at end of file
...@@ -50,8 +50,27 @@ ...@@ -50,8 +50,27 @@
</div> </div>
<?php } ?> <?php } ?>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<?php if(!isset($staff_id) || empty($staff_id)){ ?>
<div class="form-group"> <div class="form-group">
<label>User Role</label>
<div class="row">
<div class="col-md-12">
<div class="col-md-3">
<input type="radio" class="required padLeft10" data-parsley-trigger="change"
required value="4" name="user_type" checked>
<label class="padLeft10">Staff User</label>
</div>
<div class="col-md-5">
<input type="radio" class="required padLeft10" data-parsley-trigger="change"
required value="5" name="user_type">
<label class="padLeft10">Customer User</label>
</div>
</div>
</div>
</div>
<?php } ?>
<div class="form-group padTop10">
<label>Profile Picture</label> <label>Profile Picture</label>
<div class="col-md-12" style="padding-bottom:10px;"> <div class="col-md-12" style="padding-bottom:10px;">
<div class="col-md-3"> <div class="col-md-3">
...@@ -75,4 +94,4 @@ ...@@ -75,4 +94,4 @@
</div> </div>
</div> </div>
</section> </section>
</div> </div>
\ No newline at end of file
...@@ -39,9 +39,10 @@ ...@@ -39,9 +39,10 @@
<thead> <thead>
<tr> <tr>
<th class="hidden">ID</th> <th class="hidden">ID</th>
<th width="50px;">Photo</th> <th width="50px;">Photo</th>
<th width="150px;">Name</th> <th width="130px;">Name</th>
<th width="150px;">Username</th> <th width="130px;">Username</th>
<th width="120px;">Role</th>
<th width="50px;">Status</th> <th width="50px;">Status</th>
<th width="200px;">Action</th> <th width="200px;">Action</th>
</tr> </tr>
...@@ -59,6 +60,7 @@ ...@@ -59,6 +60,7 @@
</th> </th>
<th class="center"><?= $staff->display_name ?></th> <th class="center"><?= $staff->display_name ?></th>
<th class="center"><?= $staff->username ?></th> <th class="center"><?= $staff->username ?></th>
<th class="center"><?= ($staff->user_type == 4)?'Staff User':'Customer Care' ?></th>
<th class="center" id="statusFlag_<?= $staff->id ?>"> <th class="center" id="statusFlag_<?= $staff->id ?>">
<?= ($staff->status == 1)?'Active':'De-active' ?> <?= ($staff->status == 1)?'Active':'De-active' ?>
</th> </th>
...@@ -90,4 +92,4 @@ ...@@ -90,4 +92,4 @@
</div> </div>
</div> </div>
</section> </section>
</div> </div>
\ No newline at end of file
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
<script src="<?= base_url('assets/js/bootbox.min.js') ?>"></script> <script src="<?= base_url('assets/js/bootbox.min.js') ?>"></script>
<script src="<?= base_url('assets/js/app.min.js') ?>"></script> <script src="<?= base_url('assets/js/app.min.js') ?>"></script>
<script src="<?= base_url('assets/js/locationpicker.js') ?>" type="text/javascript"></script> <script src="<?= base_url('assets/js/locationpicker.js') ?>" type="text/javascript"></script>
<script src="<?= base_url('assets/js/jquery-ui.min.js') ?>" type="text/javascript"></script>
<script src="<?= base_url('assets/js/custom-script.js?ts='.time()) ?>"></script> <script src="<?= base_url('assets/js/custom-script.js?ts='.time()) ?>"></script>
<script src="<?= base_url('assets/js/parsley.min.js') ?>"></script> <script src="<?= base_url('assets/js/parsley.min.js') ?>"></script>
<script src="<?= base_url('assets/js/bootstrap-datepicker.js') ?>"></script> <script src="<?= base_url('assets/js/bootstrap-datepicker.js') ?>"></script>
...@@ -66,4 +67,4 @@ ...@@ -66,4 +67,4 @@
}); });
}); });
<?php } ?> <?php } ?>
</script> </script>
\ No newline at end of file
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
<link rel="stylesheet" href="<?= base_url('assets/css/theme.css') ?>"> <link rel="stylesheet" href="<?= base_url('assets/css/theme.css') ?>">
<link rel="stylesheet" href="<?= base_url('assets/css/custom.css') ?>"> <link rel="stylesheet" href="<?= base_url('assets/css/custom.css') ?>">
<link rel="stylesheet" href="<?= base_url('assets/css/slick.min.css') ?>" type="text/css" > <link rel="stylesheet" href="<?= base_url('assets/css/slick.min.css') ?>" type="text/css" >
<link rel="stylesheet" href="<?= base_url('assets/css/jquery-ui.min.css') ?>" type="text/css" />
<script src="<?= base_url('assets/js/jQuery-2.1.4.min.js') ?>"></script> <script src="<?= base_url('assets/js/jQuery-2.1.4.min.js') ?>"></script>
<script src="https://cdn.ckeditor.com/4.5.7/standard/ckeditor.js"></script> <script src="https://cdn.ckeditor.com/4.5.7/standard/ckeditor.js"></script>
...@@ -32,4 +33,4 @@ ...@@ -32,4 +33,4 @@
<script type="text/javascript"> <script type="text/javascript">
report_data = ride_ids = []; report_data = ride_ids = [];
</script> </script>
</head> </head>
\ No newline at end of file
...@@ -21,6 +21,13 @@ ...@@ -21,6 +21,13 @@
<span>Dashboard</span> <span>Dashboard</span>
</a> </a>
</li> </li>
<?php }if(array_key_exists('Customer_Booking',$menus)){ ?>
<li>
<a href="<?= base_url('Customer_Booking') ?>">
<img src="<?=base_url("assets/images/m5.png") ?>">
<span>Care Home</span>
</a>
</li>
<?php } if(array_key_exists('Tag',$menus)){ ?> <?php } if(array_key_exists('Tag',$menus)){ ?>
<li> <li>
<a href="<?= base_url('Tag/listTags') ?>"> <a href="<?= base_url('Tag/listTags') ?>">
...@@ -168,16 +175,10 @@ ...@@ -168,16 +175,10 @@
</li> </li>
</ul> </ul>
</li> </li>
<?php } if(array_key_exists('Booking',$menus)){ ?>
<li>
<a href="<?= base_url('Booking/viewBookings') ?>">
<img src="<?=base_url("assets/images/m8.png") ?>">
<span>Booking Details</span></a>
</li>
<?php } if(array_key_exists('Promocode',$menus)){ ?> <?php } if(array_key_exists('Promocode',$menus)){ ?>
<li class="treeview"> <li class="treeview">
<a href="#"> <a href="#">
<img src="<?=base_url("assets/images/m8.png") ?>"> <img src="<?=base_url("assets/images/m2.png") ?>">
<span>Promocode Management</span> <span>Promocode Management</span>
<i class="fa fa-angle-left pull-right"></i> <i class="fa fa-angle-left pull-right"></i>
</a> </a>
...@@ -196,6 +197,18 @@ ...@@ -196,6 +197,18 @@
</li> </li>
</ul> </ul>
</li> </li>
<?php } if(array_key_exists('Booking',$menus)){ ?>
<li>
<a href="<?= base_url('Booking/viewBookings') ?>">
<img src="<?=base_url("assets/images/m8.png") ?>">
<span>Booking Details</span></a>
</li>
<?php } if(array_key_exists('HotelCity',$menus)){ ?>
<li>
<a href="<?= base_url('HotelCity/listHotelCity') ?>">
<img src="<?=base_url("assets/images/m4.png") ?>">
<span>Hotel Cities</span></a>
</li>
<?php } if(array_key_exists('',$menus)){ ?> <?php } if(array_key_exists('',$menus)){ ?>
<li><a href="<?= base_url('Provider/getProviderPayDetails') ?>"> <li><a href="<?= base_url('Provider/getProviderPayDetails') ?>">
<img src="<?=base_url("assets/images/m2.png") ?>"> <img src="<?=base_url("assets/images/m2.png") ?>">
......
...@@ -357,7 +357,7 @@ ...@@ -357,7 +357,7 @@
padding-bottom:20px !important; padding-bottom:20px !important;
} }
/* .padBottom10 { .padBottom10 {
padding-bottom:10px !important; padding-bottom:10px !important;
} }
...@@ -397,6 +397,10 @@ ...@@ -397,6 +397,10 @@
padding-top:20px !important; padding-top:20px !important;
} }
.padTop50 {
padding-top:50px !important;
}
.padTop300{ .padTop300{
padding-top: 300px; padding-top: 300px;
} }
...@@ -447,7 +451,7 @@ ...@@ -447,7 +451,7 @@
.padAll-20 { .padAll-20 {
padding: 20px; padding: 20px;
} */ }
.vechile-body { .vechile-body {
background-color:#f7f7f7; background-color:#f7f7f7;
...@@ -812,4 +816,4 @@ ...@@ -812,4 +816,4 @@
display: none; display: none;
overflow: hidden; overflow: hidden;
background-color: #f1f1f1; background-color: #f1f1f1;
} }
\ No newline at end of file
...@@ -1026,3 +1026,14 @@ jQuery('[id^="addMultiLang"]').on('click',function() { ...@@ -1026,3 +1026,14 @@ jQuery('[id^="addMultiLang"]').on('click',function() {
} }
}); });
jQuery('[id="custSearch"]').autocomplete({
source: base_url+'Customer_Booking/userSearch',
minLength: 1,
select : (e,data) => {
if(!data || data=='' || data==undefined || data=='undefined' || data==null || data=='null'){
return false;
}
jQuery('[name="user_id"]').val(data['item']['data']);
}
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment