Commit b8a59eca by Tobin

t : crone tab changes and checker issue fixing

parent 0f0e5792
......@@ -94,8 +94,8 @@ class Event extends CI_Controller {
$errMsg = 'Provide Proper Layout details';
}
$_POST['has_payment'] = (isset($_POST['has_payment']) && $_POST['has_payment'] == 1)?'1':'0';
$_POST['approve_booking'] = (isset($_POST['approve_booking']) && $_POST['approve_booking']==1)?'1':'0';
$_POST['has_payment'] = (isset($_POST['has_payment']) && $_POST['has_payment'] == 1)?1:0;
$_POST['approve_booking'] = (isset($_POST['approve_booking'])&&$_POST['approve_booking']==1)?1:0;
$_POST['seat_pricing'] = $_POST['custom_seat_layout'] = '';
if(isset($_POST['fare_type']) && $_POST['fare_type'] == 1){
......
......@@ -684,6 +684,28 @@ class Webservice extends CI_Controller {
}
}
public function flight_availability_search(){
$data = (array)json_decode(file_get_contents('php://input'));
$data['auth_token'] = $this->auth_token;
$res = $this->Webservice_model->flight_availability_search($data);
if($res['status'] == 1){
$this->response($res['data']);
}else{
$this->errorResponse($res['code'],$res['message']);
}
}
public function flight_fare_rules(){
$data = (array)json_decode(file_get_contents('php://input'));
$data['auth_token'] = $this->auth_token;
$res = $this->Webservice_model->flight_fare_rules($data);
if($res['status'] == 1){
$this->response($res['data']);
}else{
$this->errorResponse($res['code'],$res['message']);
}
}
......
......@@ -9,10 +9,15 @@
$sql = "UPDATE booking
INNER JOIN event_date_time ON event_date_time.id = booking.event_date_id
SET booking.status = '2'
WHERE event_date_time.date < '$todate' and event_date_time.time < 'now()' and booking.status='1'";
SET booking.status='2'
WHERE event_date_time.date<'$todate' and event_date_time.time<'now()' and booking.status='1'";
$result = mysqli_query($conn, $sql);
$sql = "UPDATE booking
INNER JOIN event_date_time ON event_date_time.id = booking.event_date_id
SET booking.status='0'
WHERE event_date_time.date<'$todate' and event_date_time.time<'now()' and booking.status='6'";
$result = mysqli_query($conn, $sql);
$sql = "UPDATE booking
INNER JOIN transaction ON transaction.booking_id = booking.bookId
......
......@@ -792,6 +792,82 @@ class Validation_app_model extends CI_Model {
)
),
),
'flight_authenticate'=>array(
'auth_token' => array(
'required' => array(
'code' => 'ER02',
'message' => 'User Id is null or empty'
)
)
),
'flight_availability_search'=>array(
'auth_token' => array(
'required' => array(
'code' => 'ER02',
'message' => 'User Id is null or empty'
)
),
'journey_type' => array(
'required' => array(
'code' => 'ER02',
'message' => 'Journey Type is null or empty'
)
),
'airport_from_code' => array(
'required' => array(
'code' => 'ER02',
'message' => 'Airport From Code is null or empty'
)
),
'airport_to_code' => array(
'required' => array(
'code' => 'ER02',
'message' => 'airport To Code is null or empty'
)
),
'departure_date' => array(
'required' => array(
'code' => 'ER02',
'message' => 'Departure Date is null or empty'
)
),
'return_date' => array(
'required' => array(
'code' => 'ER02',
'message' => 'Return Date is null or empty'
)
),
'adult_flight' => array(
'required' => array(
'code' => 'ER02',
'message' => 'Adult Flight is null or empty'
)
),
'child_flight' => array(
'required' => array(
'code' => 'ER02',
'message' => 'Child Flight is null or empty'
)
),
'infant_flight' => array(
'required' => array(
'code' => 'ER02',
'message' => 'Infant Flight is null or empty'
)
),
'class' => array(
'required' => array(
'code' => 'ER02',
'message' => 'Class Field is null or empty'
)
),
'target' => array(
'required' => array(
'code' => 'ER02',
'message' => 'Target Field is null or empty'
)
),
),
);
public function validation_check($method_name, $parms) {
......
......@@ -2088,7 +2088,7 @@ class Webservice_model extends CI_Model {
}
$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";
WHERE HC.status=1 $cond GROUP BY HC.hotel_city_id";
$count = $this->db->query($sql)->num_rows();
if($count >= 1){
$perPage = 10;
......@@ -2326,14 +2326,66 @@ class Webservice_model extends CI_Model {
return $res;
}
public function flight_authenticate($data){
try{
$user_id = $this->auth_token_get($data['auth_token']);
if($user_id > 0){
$settings = getSettings();
$url = "https://trawex.biz/api/flight_trawex/authenticate?user_id=".$settings['trawex_user_id']."&user_password=".$settings['trawex_user_password']."&access=".$settings['trawex_access']."&ip_address=".$settings['trawex_ip_address']."";
$result = $this->passToJsonCurl($url,'');
if(!empty($result)){
$result = json_decode($result);
$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 flight_availability_search($data){
try{
$user_id = $this->auth_token_get($data['auth_token']);
if($user_id > 0){
$settings = getSettings();
$url = "https://trawex.biz/api/flight_trawex/flight_availability_search?user_id=".$settings['trawex_user_id']."&user_password=".$settings['trawex_user_password']."&access=".$settings['trawex_access']."&ip_address=".$settings['trawex_ip_address']."&session_id=".$data['session_id']."&journey_type=".$data['journey_type']."&airport_from_code=".$data['airport_from_code']."&airport_to_code=".$data['airport_to_code']."&departure_date=".$data['departure_date']."&return_date=".$data['return_date']."&adult_flight=".$data['adult_flight']."&child_flight=".$data['child_flight']."&infant_flight=".$data['infant_flight']."&class=".$data['class']."&target=".$data['target']."";
$result = $this->passToJsonCurl($url,'');
if(!empty($result)){
$result = json_decode($result);
$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'=>'ER08');
}
}catch(Exception $e){
$res = array('status'=>0,'message'=>'Ohh No!! Something Went South','code'=>'ER08');
}
return $res;
}
public function flight_fare_rules($data){
try{
}catch(Exception $e){
$res = array('status'=>0,'message'=>'Ohh No!! Something Went South','code'=>'ER08');
}
}
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_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);
......
......@@ -99,7 +99,7 @@
<input type="radio" name="locality_type" value="0" checked>
<label class="padAll-10">Use Existing Locality</label>
</div>
<div class="col-md-4">
<div class="col-md-5">
<input class="marginLeft15" type="radio" name="locality_type" value="1">
<label class="padAll-10">Add New Locality</label>
</div>
......
......@@ -1024,7 +1024,6 @@ jQuery('[id^="addMultiLang"]').on('click',function() {
thisObj.html('+ Hide Add More Language Option');
jQuery('[id="showMultiLangBlock_'+block+'"]').removeClass('hide');
}
});
jQuery('[id="custSearch"]').autocomplete({
......
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