Commit c609a986 by Tobin

Merge branch 'master' of https://gitlab.techware.co.in/timeout/timeOut into tobin

parents ce4bb13f b286762f
...@@ -159,5 +159,16 @@ class FlightServices extends CI_Controller { ...@@ -159,5 +159,16 @@ class FlightServices extends CI_Controller {
$this->errorResponse($res['code'],$res['message']); $this->errorResponse($res['code'],$res['message']);
} }
} }
public function flight_details(){
$data = (array)json_decode(file_get_contents('php://input'));
$data['auth_token'] = $this->auth_token;
$res = $this->FlightServices_model->flight_details($data);
if($res['status'] == 1){
$this->response($res['data']);
}else{
$this->errorResponse($res['code'],$res['message']);
}
}
} }
?> ?>
...@@ -226,6 +226,26 @@ class FlightServices_model extends CI_Model { ...@@ -226,6 +226,26 @@ class FlightServices_model extends CI_Model {
return $res; return $res;
} }
public function flight_details($data){
try{
$user_id = $this->auth_token_get($data['auth_token']);
if($user_id > 0){
$sql = "SELECT * FROM flight_details WHERE flight_code='".$data['flight_code']."'";
$query = $this->db->query($sql);
if(empty($query) || empty($flightDetails = $query->row_array())){
$res = array('status'=>0,'message'=>'No Data Found','code'=>'ER06');
return $res;
}
$res = array('status'=>1,'data'=>$flightDetails);
}else{
$res = array('status'=>0,'message'=>'User Authentication Error','code'=>'ER08');
}
}catch(Exception $e){
$res = array('status'=>0,'message'=>'Ohh No!! Something Went South','code'=>'ER10');
}
return $res;
}
public function passToJsonCurl($url='',$postData=array()){ public function passToJsonCurl($url='',$postData=array()){
$ch = curl_init(); $ch = curl_init();
curl_setopt($ch,CURLOPT_URL,$url); curl_setopt($ch,CURLOPT_URL,$url);
......
...@@ -74,9 +74,10 @@ class HotelServices_model extends CI_Model { ...@@ -74,9 +74,10 @@ class HotelServices_model extends CI_Model {
$trackingId = time().rand(100000,999999); $trackingId = time().rand(100000,999999);
$settings = getSettings(); $settings = getSettings();
if(!isset($data['nextToken']) && empty($data['nextToken'])){ if(!isset($data['nextToken']) && empty($data['nextToken'])){
$this->db->select('nationality'); $this->db->select('nationality');
$userData = $this->db->get_where('customer',array('customer_id'=>$user_id))->row_array(); $userData = $this->db->get_where('customer',array('customer_id'=>$user_id))->row_array();
$countryData = $this->getCountryData($user_id); $countryData = $this->getCountryData($user_id);
$currency = (isset($data['currency']) && !empty($data['currency']))?$data['currency']:$countryData['currency'];
} }
$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"; $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'])){ if(!isset($data['nextToken']) && empty($data['nextToken'])){
...@@ -90,7 +91,7 @@ class HotelServices_model extends CI_Model { ...@@ -90,7 +91,7 @@ class HotelServices_model extends CI_Model {
'child'=>$data['child'],'child_age'=>$data['child_age'], 'child'=>$data['child'],'child_age'=>$data['child_age'],
'checkin'=>$data['checkin'],'checkout'=>$data['checkout'], 'checkin'=>$data['checkin'],'checkout'=>$data['checkout'],
'client_nationality'=>$userData['nationality'], 'client_nationality'=>$userData['nationality'],
'requiredCurrency'=>$countryData['currency']); 'requiredCurrency'=>$currency);
} }
$postFields = (isset($data['nextToken']) && !empty($data['nextToken']))?'':$postData; $postFields = (isset($data['nextToken']) && !empty($data['nextToken']))?'':$postData;
......
...@@ -415,7 +415,21 @@ class Validation_flight_model extends CI_Model { ...@@ -415,7 +415,21 @@ class Validation_flight_model extends CI_Model {
'message' => 'User Id is null or empty' 'message' => 'User Id is null or empty'
) )
) )
) ),
'flight_details'=>array(
'auth_token' => array(
'required' => array(
'code' => 'ER02',
'message' => 'User Id is null or empty'
)
),
'flight_code' => array(
'required' => array(
'code' => 'ER20',
'message' => 'Flight Code is null or empty'
)
),
),
); );
public function validation_check($method_name, $parms) { public function validation_check($method_name, $parms) {
......
...@@ -1163,7 +1163,7 @@ class Webservice_model extends CI_Model { ...@@ -1163,7 +1163,7 @@ class Webservice_model extends CI_Model {
$bookId = $post_data['bookId']; $bookId = $post_data['bookId'];
$lang = $countryData['language_code']; $lang = $countryData['language_code'];
$sql = "SELECT TEVT.event_name,CUST.name,CUST.email,CUST.phone, $sql = "SELECT TEVT.event_name,CUST.name,CUST.email,CUST.phone,
CONCAT(EDATE.date,' ',EDATE.time) AS show_time,PDR.fcm_token CONCAT(EDATE.date,' ',EDATE.time) AS show_time,PDR.fcm_token,BK.qrcode
FROM booking AS BK FROM booking AS BK
INNER JOIN events AS EVT ON (EVT.event_id=BK.event_id) INNER JOIN events AS EVT ON (EVT.event_id=BK.event_id)
INNER JOIN provider AS PDR ON (PDR.provider_id=EVT.provider_id) INNER JOIN provider AS PDR ON (PDR.provider_id=EVT.provider_id)
...@@ -1197,7 +1197,7 @@ class Webservice_model extends CI_Model { ...@@ -1197,7 +1197,7 @@ class Webservice_model extends CI_Model {
} }
$this->sendSMS($bkData['phone'],$msgContent); $this->sendSMS($bkData['phone'],$msgContent);
$msg = "Hi, You are invited for the event '".$bkData['event_name']."', and show is on '".$showTime."'. Booking ID ".$post_data['bookId']; $msg = "Hi, You are invited for the event '".$bkData['event_name']."', and show is on '".$showTime."'. Booking ID ".$post_data['bookId'].". Find the QR Code ".base_url('/'.$bkData['qrcode']);
if(!empty($invite_ids)){ if(!empty($invite_ids)){
foreach($invite_ids AS $userId) { foreach($invite_ids AS $userId) {
$usrData = $this->db->get_where('customer', $usrData = $this->db->get_where('customer',
......
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