Commit b97bc6a7 by Tobin

dc

parent 04538925
...@@ -22,7 +22,7 @@ class FlightServices extends CI_Controller { ...@@ -22,7 +22,7 @@ class FlightServices 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('Flight_model'); $this->load->model('FlightServices_model');
$this->load->model('Validation_flight_model'); $this->load->model('Validation_flight_model');
$method = $this->router->fetch_method(); $method = $this->router->fetch_method();
$data = (array) json_decode(file_get_contents('php://input')); $data = (array) json_decode(file_get_contents('php://input'));
...@@ -64,7 +64,7 @@ class FlightServices extends CI_Controller { ...@@ -64,7 +64,7 @@ class FlightServices extends CI_Controller {
public function flight_authenticate(){ public function flight_authenticate(){
$data = (array)json_decode(file_get_contents('php://input')); $data = (array)json_decode(file_get_contents('php://input'));
$data['auth_token'] = $this->auth_token; $data['auth_token'] = $this->auth_token;
$res = $this->Flight_model->flight_authenticate($data); $res = $this->FlightServices_model->flight_authenticate($data);
if($res['status'] == 1){ if($res['status'] == 1){
$this->response($res['data']); $this->response($res['data']);
}else{ }else{
...@@ -75,7 +75,7 @@ class FlightServices extends CI_Controller { ...@@ -75,7 +75,7 @@ class FlightServices extends CI_Controller {
public function flight_availability_search(){ public function flight_availability_search(){
$data = (array)json_decode(file_get_contents('php://input')); $data = (array)json_decode(file_get_contents('php://input'));
$data['auth_token'] = $this->auth_token; $data['auth_token'] = $this->auth_token;
$res = $this->Flight_model->flight_availability_search($data); $res = $this->FlightServices_model->flight_availability_search($data);
if($res['status'] == 1){ if($res['status'] == 1){
$this->response($res['data']); $this->response($res['data']);
}else{ }else{
...@@ -86,7 +86,7 @@ class FlightServices extends CI_Controller { ...@@ -86,7 +86,7 @@ class FlightServices extends CI_Controller {
public function flight_fare_rules(){ public function flight_fare_rules(){
$data = (array)json_decode(file_get_contents('php://input')); $data = (array)json_decode(file_get_contents('php://input'));
$data['auth_token'] = $this->auth_token; $data['auth_token'] = $this->auth_token;
$res = $this->Flight_model->flight_fare_rules($data); $res = $this->FlightServices_model->flight_fare_rules($data);
if($res['status'] == 1){ if($res['status'] == 1){
$this->response($res['data']); $this->response($res['data']);
}else{ }else{
...@@ -97,7 +97,7 @@ class FlightServices extends CI_Controller { ...@@ -97,7 +97,7 @@ class FlightServices extends CI_Controller {
public function flight_revalidate(){ public function flight_revalidate(){
$data = (array)json_decode(file_get_contents('php://input')); $data = (array)json_decode(file_get_contents('php://input'));
$data['auth_token'] = $this->auth_token; $data['auth_token'] = $this->auth_token;
$res = $this->Flight_model->flight_revalidate($data); $res = $this->FlightServices_model->flight_revalidate($data);
if($res['status'] == 1){ if($res['status'] == 1){
$this->response($res['data']); $this->response($res['data']);
}else{ }else{
...@@ -108,7 +108,7 @@ class FlightServices extends CI_Controller { ...@@ -108,7 +108,7 @@ class FlightServices extends CI_Controller {
public function flight_book(){ public function flight_book(){
$data = (array)json_decode(file_get_contents('php://input')); $data = (array)json_decode(file_get_contents('php://input'));
$data['auth_token'] = $this->auth_token; $data['auth_token'] = $this->auth_token;
$res = $thia->Flight_model->flight_book($data); $res = $thia->FlightServices_model->flight_book($data);
if($res['status'] == 1){ if($res['status'] == 1){
$this->response($res['data']); $this->response($res['data']);
}else{ }else{
...@@ -119,7 +119,7 @@ class FlightServices extends CI_Controller { ...@@ -119,7 +119,7 @@ class FlightServices extends CI_Controller {
public function flight_ticket_order(){ public function flight_ticket_order(){
$data = (array)json_decode(file_get_contents('php://input')); $data = (array)json_decode(file_get_contents('php://input'));
$data['auth_token'] = $this->auth_token; $data['auth_token'] = $this->auth_token;
$res = $this->Flight_model->flight_ticket_order($data); $res = $this->FlightServices_model->flight_ticket_order($data);
if($res['status'] == 1){ if($res['status'] == 1){
$this->response($res['data']); $this->response($res['data']);
}else{ }else{
...@@ -130,7 +130,7 @@ class FlightServices extends CI_Controller { ...@@ -130,7 +130,7 @@ class FlightServices extends CI_Controller {
public function flight_trip_details(){ public function flight_trip_details(){
$data = (array)json_decode(file_get_contents('php://input')); $data = (array)json_decode(file_get_contents('php://input'));
$data['auth_token'] = $this->auth_token; $data['auth_token'] = $this->auth_token;
$res = $this->Flight_model->flight_trip_details($data); $res = $this->FlightServices_model->flight_trip_details($data);
if($res['status'] == 1){ if($res['status'] == 1){
$this->response($res['data']); $this->response($res['data']);
}else{ }else{
...@@ -141,7 +141,7 @@ class FlightServices extends CI_Controller { ...@@ -141,7 +141,7 @@ class FlightServices extends CI_Controller {
public function cancel_flights(){ public function cancel_flights(){
$data = (array)json_decode(file_get_contents('php://input')); $data = (array)json_decode(file_get_contents('php://input'));
$data['auth_token'] = $this->auth_token; $data['auth_token'] = $this->auth_token;
$res = $this->Flight_model->cancel_flights($data); $res = $this->FlightServices_model->cancel_flights($data);
if($res['status'] == 1){ if($res['status'] == 1){
$this->response($res['data']); $this->response($res['data']);
}else{ }else{
...@@ -152,7 +152,7 @@ class FlightServices extends CI_Controller { ...@@ -152,7 +152,7 @@ class FlightServices extends CI_Controller {
public function airportSearch(){ public function airportSearch(){
$data = $_GET; $data = $_GET;
$data['auth_token'] = $this->auth_token; $data['auth_token'] = $this->auth_token;
$res = $this->Flight_model->airportSearch($data); $res = $this->FlightServices_model->airportSearch($data);
if($res['status'] == 1){ if($res['status'] == 1){
$this->response($res['data']); $this->response($res['data']);
}else{ }else{
......
...@@ -22,7 +22,7 @@ class HotelServices extends CI_Controller { ...@@ -22,7 +22,7 @@ class HotelServices 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('Hotel_model'); $this->load->model('HotelServices_model');
$this->load->model('Validation_hotel_model'); $this->load->model('Validation_hotel_model');
$method = $this->router->fetch_method(); $method = $this->router->fetch_method();
$data = (array) json_decode(file_get_contents('php://input')); $data = (array) json_decode(file_get_contents('php://input'));
...@@ -63,8 +63,7 @@ class HotelServices extends CI_Controller { ...@@ -63,8 +63,7 @@ class HotelServices extends CI_Controller {
public function get_hotel_city_list(){ public function get_hotel_city_list(){
$data = $_GET; $data = $_GET;
$data['auth_token'] = $this->auth_token; $res = $this->HotelServices_model->get_hotel_city_list($data);
$res = $this->Hotel_model->get_hotel_city_list($data);
if($res['status'] == 1){ if($res['status'] == 1){
$this->response($res['data']); $this->response($res['data']);
}else{ }else{
...@@ -75,7 +74,7 @@ class HotelServices extends CI_Controller { ...@@ -75,7 +74,7 @@ class HotelServices extends CI_Controller {
public function hotel_search(){ public function hotel_search(){
$data = (array)json_decode(file_get_contents('php://input')); $data = (array)json_decode(file_get_contents('php://input'));
$data['auth_token'] = $this->auth_token; $data['auth_token'] = $this->auth_token;
$res = $this->Hotel_model->hotel_search($data); $res = $this->HotelServices_model->hotel_search($data);
if($res['status'] == 1){ if($res['status'] == 1){
$this->response($res['data']); $this->response($res['data']);
}else{ }else{
...@@ -86,7 +85,7 @@ class HotelServices extends CI_Controller { ...@@ -86,7 +85,7 @@ class HotelServices extends CI_Controller {
public function get_specific_hotel_content(){ public function get_specific_hotel_content(){
$data = (array)json_decode(file_get_contents('php://input')); $data = (array)json_decode(file_get_contents('php://input'));
$data['auth_token'] = $this->auth_token; $data['auth_token'] = $this->auth_token;
$res = $this->Hotel_model->get_specific_hotel_content($data); $res = $this->HotelServices_model->get_specific_hotel_content($data);
if($res['status'] == 1){ if($res['status'] == 1){
$this->response($res['data']); $this->response($res['data']);
}else{ }else{
...@@ -97,7 +96,7 @@ class HotelServices extends CI_Controller { ...@@ -97,7 +96,7 @@ class HotelServices extends CI_Controller {
public function get_room_rates(){ public function get_room_rates(){
$data = (array)json_decode(file_get_contents('php://input')); $data = (array)json_decode(file_get_contents('php://input'));
$data['auth_token'] = $this->auth_token; $data['auth_token'] = $this->auth_token;
$res = $this->Hotel_model->get_room_rates($data); $res = $this->HotelServices_model->get_room_rates($data);
if($res['status'] == 1){ if($res['status'] == 1){
$this->response($res['data']); $this->response($res['data']);
}else{ }else{
...@@ -108,7 +107,7 @@ class HotelServices extends CI_Controller { ...@@ -108,7 +107,7 @@ class HotelServices extends CI_Controller {
public function get_rate_rules(){ public function get_rate_rules(){
$data = (array) json_decode(file_get_contents('php://input')); $data = (array) json_decode(file_get_contents('php://input'));
$data['auth_token'] = $this->auth_token; $data['auth_token'] = $this->auth_token;
$res = $this->Hotel_model->get_rate_rules($data); $res = $this->HotelServices_model->get_rate_rules($data);
if($res['status'] == 1){ if($res['status'] == 1){
$this->response($res['data']); $this->response($res['data']);
}else{ }else{
...@@ -119,7 +118,7 @@ class HotelServices extends CI_Controller { ...@@ -119,7 +118,7 @@ class HotelServices extends CI_Controller {
public function hotel_book(){ public function hotel_book(){
$data = (array)json_decode(file_get_contents('php://input')); $data = (array)json_decode(file_get_contents('php://input'));
$data['auth_token'] = $this->auth_token; $data['auth_token'] = $this->auth_token;
$res = $this->Hotel_model->hotel_book($data); $res = $this->HotelServices_model->hotel_book($data);
if($res['status'] == 1){ if($res['status'] == 1){
$this->response($res['data']); $this->response($res['data']);
}else{ }else{
...@@ -130,7 +129,7 @@ class HotelServices extends CI_Controller { ...@@ -130,7 +129,7 @@ class HotelServices extends CI_Controller {
public function trawex_cancel_booking(){ public function trawex_cancel_booking(){
$data = (array)json_decode(file_get_contents('php://input')); $data = (array)json_decode(file_get_contents('php://input'));
$data['auth_token'] = $this->auth_token; $data['auth_token'] = $this->auth_token;
$res = $this->Hotel_model->trawex_cancel_booking($data); $res = $this->HotelServices_model->trawex_cancel_booking($data);
if($res['status'] == 1){ if($res['status'] == 1){
$this->response($res['data']); $this->response($res['data']);
}else{ }else{
......
...@@ -1428,19 +1428,28 @@ class Webservice_model extends CI_Model { ...@@ -1428,19 +1428,28 @@ class Webservice_model extends CI_Model {
translator_event.event_name,booking.qrcode AS event_image, translator_event.event_name,booking.qrcode AS event_image,
venue.location,event_date_time.time,booking.event_id, venue.location,event_date_time.time,booking.event_id,
booking.no_of_ticket AS ticket_count,events.has_payment, booking.no_of_ticket AS ticket_count,events.has_payment,
booking.status AS booking_status booking.status AS booking_status,transaction.status AS transaction_status
FROM booking FROM booking
INNER JOIN events ON booking.event_id = events.event_id INNER JOIN events ON booking.event_id = events.event_id
INNER JOIN event_date_time ON booking.event_date_id = event_date_time.id INNER JOIN event_date_time ON booking.event_date_id = event_date_time.id
INNER JOIN venue ON venue.id = events.venue_id INNER JOIN venue ON venue.id = events.venue_id
INNER JOIN translator_event ON translator_event.event_id=events.event_id INNER JOIN translator_event ON translator_event.event_id=events.event_id
WHERE booking.customer_id = '$user_id' AND booking.status IN(0,1,2,6) LEFT JOIN transaction ON transaction.booking_id=booking.bookId
WHERE booking.customer_id = '$user_id' AND booking.status IN (0,1,2,6)
AND (translator_event.language_code='$lang' OR AND (translator_event.language_code='$lang' OR
translator_event.language_code='EN') translator_event.language_code='EN')
GROUP BY booking.id GROUP BY booking.id
ORDER BY booking.id DESC ORDER BY booking.id DESC
LIMIT $page_limit, $per_page"; LIMIT $page_limit, $per_page";
$result = $this->db->query($sql)->result_array(); $result = $this->db->query($sql)->result_array();
if(!empty($result)){
foreach ($result AS $key => $value) {
if($value['has_payment'] == '1' && $value['transaction_status'] != '1'){
unset($result[$key]);
}
}
$result = array_values($result);
}
$meta = array('total_pages'=>ceil($count/$per_page), $meta = array('total_pages'=>ceil($count/$per_page),
'total'=>$count, 'total'=>$count,
'current_page'=>$page, 'current_page'=>$page,
......
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