Commit 8dd815b2 by Jansa Jose

J : flight booking in web

parent 39eee5d6
...@@ -330,7 +330,8 @@ class Api extends CI_Controller { ...@@ -330,7 +330,8 @@ class Api extends CI_Controller {
case 'WALLET': case 'WALLET':
return $this->Api_model->updateWalletTxn($txnData); return $this->Api_model->updateWalletTxn($txnData);
case 'HOTEL_BOOK': case 'HOTEL_BOOK':
if(isset($txnData['bookData']) && !empty($txnData['bookData'])){ if((isset($txnData['tnx_id']) && !empty($txnData['tnx_id'])) ||
(isset($txnData['bookData']) && !empty($txnData['bookData']))){
return $this->Api_model->hotelBooking($txnData); return $this->Api_model->hotelBooking($txnData);
} }
} }
......
...@@ -1834,14 +1834,14 @@ class Api_model extends CI_Model { ...@@ -1834,14 +1834,14 @@ class Api_model extends CI_Model {
"user_password"=>$settings['trawex_user_password'], "user_password"=>$settings['trawex_user_password'],
"access"=>$settings['trawex_access'], "access"=>$settings['trawex_access'],
"ip_address"=>$settings['trawex_ip_address'], "ip_address"=>$settings['trawex_ip_address'],
"TraceId"=>$data['TraceId'],"propertyid"=>$data['propertyid'], "TraceId"=>$data->TraceId,"propertyid"=>$data->propertyid,
"trackingId"=>$data['trackingId'],"sessionId"=>$data['sessionId'], "trackingId"=>$data->trackingId,"sessionId"=>$data->sessionId,
"productId"=>$data['productId'],"TokenId"=>$data['TokenId'], "productId"=>$data->productId,"TokenId"=>$data->TokenId,
"resultindex"=>$data['resultindex'],"hotelcode"=>$data['hotelcode'], "resultindex"=>$data->resultindex,"hotelcode"=>$data->hotelcode,
"changedOccupancy"=>$data['changedOccupancy'], "changedOccupancy"=>$data->changedOccupancy,
"extrabeds"=>$data['extrabeds'], "extrabeds"=>$data->extrabeds,
"guests_details"=>$data['guests_details'],"refcode"=>$data['refcode'], "guests_details"=>$data->guests_details,"refcode"=>$data->refcode,
"prebookingtoken"=>$data['prebookingtoken'] "prebookingtoken"=>$data->prebookingtoken
); );
$result = passToJsonCurl($url,$postData); $result = passToJsonCurl($url,$postData);
if(!empty($result)){ if(!empty($result)){
......
...@@ -195,31 +195,26 @@ class FlightServices_model extends CI_Model { ...@@ -195,31 +195,26 @@ class FlightServices_model extends CI_Model {
public function airportSearch($data){ public function airportSearch($data){
try{ try{
$user_id = $this->auth_token_get($data['auth_token']); $cond = '';
if($user_id > 0){ if(isset($data['query']) && !empty($data['query'])){
$cond = ''; $cond = "WHERE airport_code LIKE '%".$data['query']."%' OR airport_name LIKE '%".$data['query']."%'";
if(isset($data['query']) && !empty($data['query'])){ }
$cond = "WHERE airport_code LIKE '%".$data['query']."%' OR airport_name LIKE '%".$data['query']."%'"; $sql = "SELECT id FROM airport_details $cond";
} $count = $this->db->query($sql)->num_rows();
$sql = "SELECT id FROM airport_details $cond"; if($count > 0){
$count = $this->db->query($sql)->num_rows(); $perPage = 10;
if($count > 0){ $page = (isset($data['page']))?$data['page']:1;
$perPage = 10; $limit = ($page - 1) * $perPage;
$page = (isset($data['page']))?$data['page']:1; $meta = array('total_pages'=>ceil($count/$perPage),'total'=>$count,
$limit = ($page - 1) * $perPage; 'current_page'=>$page,'per_page'=>$perPage);
$meta = array('total_pages'=>ceil($count/$perPage),'total'=>$count, $sql = "SELECT * FROM airport_details $cond LIMIT $limit,$perPage";
'current_page'=>$page,'per_page'=>$perPage); $airPortList = $this->db->query($sql);
$sql = "SELECT * FROM airport_details $cond LIMIT $limit,$perPage"; if(!isset($airPortList) || empty($airPortList = $airPortList->result_array())){
$airPortList = $this->db->query($sql); $res = array('status'=>0,'message'=>'No data Found','code'=>'ER04');
if(!isset($airPortList) || empty($airPortList = $airPortList->result_array())){ return $res;
$res = array('status'=>0,'message'=>'No data Found','code'=>'ER04');
return $res;
}
$res =array('status'=>1,'data'=>array('airportlist'=>$airPortList,'meta'=>$meta));
} }
}else{ $res =array('status'=>1,'data'=>array('airportlist'=>$airPortList,'meta'=>$meta));
$res = array('status'=>0,'message'=>'User Authentication Error','code'=>'ER06'); }
}
}catch(Exception $e){ }catch(Exception $e){
$res = array('status'=>0,'message'=>'Ohh No!! Something Went South','code'=>'ER10'); $res = array('status'=>0,'message'=>'Ohh No!! Something Went South','code'=>'ER10');
} }
......
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