Commit 4760d1b6 by Jansa Jose

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

parents 07e38392 0869a7ed
...@@ -74,11 +74,11 @@ $active_group = 'default'; ...@@ -74,11 +74,11 @@ $active_group = 'default';
$query_builder = TRUE; $query_builder = TRUE;
$db['default'] = array( $db['default'] = array(
'dsn' => '', 'dsn' => '',
'hostname' => 'localhost', 'hostname' => '192.168.140.123',
'username' => 'root', 'username' => 'root',
'password' => 'Golden_123', 'password' => 'Golden_123',
'database' => 'timeout_uat', 'database' => 'tobin_eventTimeOut',
'dbdriver' => 'mysqli', 'dbdriver' => 'mysqli',
'dbprefix' => '', 'dbprefix' => '',
'pconnect' => FALSE, 'pconnect' => FALSE,
......
...@@ -20,7 +20,9 @@ if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') { ...@@ -20,7 +20,9 @@ if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') {
class Api extends CI_Controller { class Api extends CI_Controller {
var $auth_token; var $auth_token;
private $cipher = "AES-256-CBC"; private $cipher = "aes-256-cbc";
private $local_iv = "9H77F2KL7KRF4W51";
private $local_key = "af5b2a1h6947gt8fd045k78s2ah5609f";
public function __construct() { public function __construct() {
parent::__construct(); parent::__construct();
date_default_timezone_set("Asia/Riyadh"); date_default_timezone_set("Asia/Riyadh");
...@@ -31,10 +33,10 @@ class Api extends CI_Controller { ...@@ -31,10 +33,10 @@ class Api extends CI_Controller {
if($method == 'profile') { if($method == 'profile') {
$data = $_POST; $data = $_POST;
} }
if (isset(apache_request_headers()['Auth'])) { if (isset(apache_request_headers()['Auth']) || isset(apache_request_headers()['auth'])) {
$this->auth_token = apache_request_headers()['Auth']; $this->auth_token = (isset(apache_request_headers()['Auth']))?apache_request_headers()['Auth']:apache_request_headers()['auth'];
$data['auth_token'] = $this->auth_token; $data['auth_token'] = $this->auth_token;
} }
$res = $this->Validation_model->validation_check($method, $data); $res = $this->Validation_model->validation_check($method, $data);
if($res['state'] == 1) { if($res['state'] == 1) {
$this->errorResponse($res['response']['code'], $res['response']['message']); $this->errorResponse($res['response']['code'], $res['response']['message']);
...@@ -47,12 +49,11 @@ class Api extends CI_Controller { ...@@ -47,12 +49,11 @@ class Api extends CI_Controller {
$res = $this->Validation_model->validation_check('login',array('email_id'=>'adarsh')); $res = $this->Validation_model->validation_check('login',array('email_id'=>'adarsh'));
} }
public function response($data) { public function response($data='') {
$result = array( $result = array('code'=>1,'message'=>'Success');
'code' => 1, if(!empty($data)){
'message' => 'Success', $result['responseResult'] = $data;
'responseResult' =>$data }
);
print json_encode($result);exit; print json_encode($result);exit;
} }
...@@ -394,10 +395,7 @@ class Api extends CI_Controller { ...@@ -394,10 +395,7 @@ class Api extends CI_Controller {
if($noCard == 0){ if($noCard == 0){
$pText .= '11111100000|'.$cardNo.'|'.$expMonth.'|'.$expYear.'|'.$cvv.'|'.$holder.'|'.$cardType.'||'; $pText .= '11111100000|'.$cardNo.'|'.$expMonth.'|'.$expYear.'|'.$cvv.'|'.$holder.'|'.$cardType.'||';
} else { } else {
// No Card Payment Method Logic. // Provide Card Details Manually in Bayanpay Payment gateway.
// $holder = 'Basanta Mahunta'; $cardType = 'MasterCard'; $cardNo = '5111111111111118';
// $cvv = '100'; $expMonth = '06'; $expYear = '2022';
} }
} }
$pText .= '1110000|'.$last_id.'|'.$event_id.'|'.$booking_id.'||'; $pText .= '1110000|'.$last_id.'|'.$event_id.'|'.$booking_id.'||';
...@@ -468,7 +466,7 @@ class Api extends CI_Controller { ...@@ -468,7 +466,7 @@ class Api extends CI_Controller {
} }
if(!empty($transaction_id) && !empty($last_id)){ if(!empty($transaction_id) && !empty($last_id)){
$this->Api_model->update_payment($response,$transaction_id,$last_id,'1') ; $this->Api_model->update_payment($response,$transaction_id,$last_id,'1');
} }
if(!empty($booking_id)){ if(!empty($booking_id)){
...@@ -606,7 +604,10 @@ class Api extends CI_Controller { ...@@ -606,7 +604,10 @@ class Api extends CI_Controller {
empty($resp->txnCardDetails) || count($resp->txnCardDetails) <= 0){ empty($resp->txnCardDetails) || count($resp->txnCardDetails) <= 0){
$this->errorResponse('893','No Data Found'); $this->errorResponse('893','No Data Found');
} }
$this->response(array('saved_cards'=>$resp->txnCardDetails));
$cardData = json_encode(json_decode(json_encode($resp->txnCardDetails),true));
$resp = $this->encrypt($cardData,$this->local_key,$this->local_iv);
$this->response(array('saved_cards'=>$resp));
} }
function encryptePayData($merchant_iv='',$merchant_key='',$plainText='') { function encryptePayData($merchant_iv='',$merchant_key='',$plainText='') {
...@@ -644,21 +645,46 @@ class Api extends CI_Controller { ...@@ -644,21 +645,46 @@ class Api extends CI_Controller {
return ''; return '';
} }
if (in_array($this->cipher, openssl_get_cipher_methods())) { if (in_array($this->cipher, openssl_get_cipher_methods())) {
$ciphertext = openssl_encrypt($plainText, $this->cipher, $this->key, $options=0, $this->iv); $ciphertext = openssl_encrypt($plainText,$this->cipher,$mKey,$options=0,$mIv);
return $ciphertext; return $ciphertext;
} }
} }
public function decrypt($encText='',$mKey='',$mIv='') { public function decrypt($encText='',$mKey='',$mIv='') {
if(empty($plainText) || empty($mKey) || empty($mIv)){ if(empty($encText) || empty($mKey) || empty($mIv)){
return ''; return '';
} }
if (in_array($this->cipher, openssl_get_cipher_methods())) { if (in_array($this->cipher, openssl_get_cipher_methods())) {
$original_plaintext = openssl_decrypt($encText, $this->cipher, $this->key, $options=0, $this->iv); $original_plaintext = openssl_decrypt($encText,$this->cipher,$mKey,$options=0,$mIv);
return $original_plaintext; return $original_plaintext;
} }
} }
public function addCard(){
$data = (array) json_decode(file_get_contents('php://input'));
// $dmyData = '{"auth_token":"cc731b6bd572eb452d85c96aaec77898","cardNumber":"5111111111111118",
// "expMonthYear":"0622","cardHolderName":"John","cvv":"100","cardType":"MasterCard"}';
// $data['requestData'] = $this->encrypt($dmyData,$this->local_key,$this->local_iv);
$settings = getSettings();
$merchant_iv = $settings['merchant_iv'];
$merchant_key = $settings['merchant_key'];
$reqData = $this->decrypt($data['requestData'],$this->local_key,$this->local_iv);
if(empty($reqData) || empty($reqData=json_decode($reqData,true))){
redirect($redUrl.'failure');
}
$payData = array('auth_token'=>$reqData['auth_token'],'amount'=>'1','booking_id'=>'ADD_CARD');
$res = $this->Api_model->payNow($payData);
if($res['status']==1){
unset($reqData['auth_token']);
$this->paymentGateway(1,$res['transaction_id'],'test','ADD_CARD',$res['custData'],$reqData);
}else{
redirect($redUrl.'failure');
}
}
/*================ START : Checker API ================*/ /*================ START : Checker API ================*/
public function checker_bookingDetails(){ public function checker_bookingDetails(){
......
...@@ -12,7 +12,7 @@ class Booking extends CI_Controller { ...@@ -12,7 +12,7 @@ class Booking extends CI_Controller {
redirect(base_url()); redirect(base_url());
} }
} }
public function viewBookings(){ public function viewBookings(){
$template['page'] = 'Booking/viewBooking'; $template['page'] = 'Booking/viewBooking';
$template['menu'] = 'Booking Management'; $template['menu'] = 'Booking Management';
...@@ -22,7 +22,7 @@ class Booking extends CI_Controller { ...@@ -22,7 +22,7 @@ class Booking extends CI_Controller {
$template['page_head'] = "Booking Management"; $template['page_head'] = "Booking Management";
$provider_id = ($this->session->userdata('user_type')==2)?$this->session->userdata('id'):''; $provider_id = ($this->session->userdata('user_type')==2)?$this->session->userdata('id'):'';
$template['booking_data'] = $this->Booking_model->getBookingData('',$provider_id,'0,1,2,3,5'); $template['booking_data'] = $this->Booking_model->getBookingData('',$provider_id,'0,1,2,3,5,6');
$this->load->view('template',$template); $this->load->view('template',$template);
} }
...@@ -35,7 +35,7 @@ class Booking extends CI_Controller { ...@@ -35,7 +35,7 @@ class Booking extends CI_Controller {
$booking_id = (!is_numeric($_POST['booking_id']))? $booking_id = (!is_numeric($_POST['booking_id']))?
decode_param($_POST['booking_id']):$_POST['booking_id']; decode_param($_POST['booking_id']):$_POST['booking_id'];
$view_all = (isset($_POST['view_all'])&&$_POST['view_all'] != '')?$_POST['view_all']:'0,1,2,3,5'; $view_all = (isset($_POST['view_all'])&&$_POST['view_all'] != '')?$_POST['view_all']:'0,1,2,3,5,6';
$provider_id = ($this->session->userdata('user_type')==2)?$this->session->userdata('id'):''; $provider_id = ($this->session->userdata('user_type')==2)?$this->session->userdata('id'):'';
$bookData['bookData'] = $this->Booking_model->getBookingData($booking_id,$provider_id,$view_all); $bookData['bookData'] = $this->Booking_model->getBookingData($booking_id,$provider_id,$view_all);
...@@ -48,10 +48,11 @@ class Booking extends CI_Controller { ...@@ -48,10 +48,11 @@ class Booking extends CI_Controller {
if(!isset($_POST) || !isset($_POST['booking_id']) || empty($_POST['booking_id'])){ if(!isset($_POST) || !isset($_POST['booking_id']) || empty($_POST['booking_id'])){
echo json_encode(array('status'=>'0'));exit; echo json_encode(array('status'=>'0'));exit;
} }
$status = (isset($_POST['status']) && $_POST['status'] != '')?$_POST['status']:'1';
$booking_id = decode_param($_POST['booking_id']); $booking_id = decode_param($_POST['booking_id']);
$resp = $this->Booking_model->changeStatus($booking_id,'4'); $resp = $this->Booking_model->changeStatus($booking_id,$status);
if($resp){ if($resp){
echo json_encode(array('status'=>'1'));exit; echo json_encode(array('status'=>'1','data'=>array('booking_id'=>$_POST['booking_id'])));exit;
} }
echo json_encode(array('status'=>'0'));exit; echo json_encode(array('status'=>'0'));exit;
} }
......
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Customer_Booking extends CI_Controller {
public function __construct() {
parent::__construct();
date_default_timezone_set("Asia/Riyadh");
if(!$this->session->userdata('logged_in')) {
redirect(base_url('Login'));
}
$userType = $this->session->userdata['user_type'];
if($userType != 5){
redirect(base_url('Dashboard'));
}
}
public function index() {
$template['page'] = 'Customer_Booking/care_home';
$template['menu'] = 'Booking Management';
$template['smenu'] = 'View Bookings';
$template['pTitle'] = "View Bookings";
$template['pDescription'] = "View and Manage Bookings";
$template['page_head'] = "Booking Management";
if(isset($_POST) && !empty($_POST) &&
((isset($_POST['user_id']) && !empty($_POST['user_id'])) ||
(isset($_POST['booking_id']) && !empty($_POST['booking_id'])))){
$user_id = $booking_id = '';
$bookData = $custData = array();
$this->load->model('Booking_model');
$this->load->model('Customer_model');
if (isset($_POST['user_id']) && !empty($user_id = $_POST['user_id']) &&
isset($_POST['booking_id']) && !empty($booking_id = $_POST['booking_id'])){
$bookData = $this->Booking_model->getBookingData('','','','',$booking_id);
$custData = $this->Customer_model->getCustomerData(decode_param($user_id));
} else if (isset($_POST['user_id']) && !empty($user_id = $_POST['user_id'])){
$bookData = $this->Booking_model->getBookingData('','','',decode_param($user_id));
$custData = $this->Customer_model->getCustomerData(decode_param($user_id));
} else if (isset($_POST['booking_id']) && !empty($booking_id = $_POST['booking_id'])){
$bookData = $this->Booking_model->getBookingData('','','','',$booking_id);
if (!empty($bookData)){
$custData = $this->Customer_model->getCustomerData($bookData[0]->customer_id);
}
}
$template['bookData'] = $bookData;
$template['custData'] = $custData;
}
$this->load->view('template',$template);
}
public function userSearch(){
if(!isset($_GET) || empty($_GET) || !isset($_GET['term']) || empty($key = $_GET['term'])){
exit;
}
$sql = "SELECT customer_id,name,phone,email FROM customer
WHERE name LIKE '%".$key."%' OR phone LIKE '%".$key."%' OR email LIKE '%".$key."%' LIMIT 10";
$cust = $this->db->query($sql)->result_array();
if(empty($cust)){
exit;
}
$custDetails = array();
foreach ($cust AS $custData) {
$name = (!empty($custData['name']))?'Name : '.$custData['name']:'Name : -- ';
$name .= (!empty($custData['email']))?', Mail: '.$custData['email']:'';
$name .= (!empty($custData['phone']))?', Phone: '.$custData['phone']:'';
$cust_id = encode_param($custData['customer_id']);
$custDetails[] =array('data'=>$cust_id,'label'=>$name);
}
echo json_encode($custDetails);
}
}
?>
\ No newline at end of file
...@@ -6,12 +6,18 @@ class Dashboard extends CI_Controller { ...@@ -6,12 +6,18 @@ 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'));
$this->load->model('Dashboard_model');
} }
public function index() { public function index() {
...@@ -21,7 +27,5 @@ class Dashboard extends CI_Controller { ...@@ -21,7 +27,5 @@ class Dashboard extends CI_Controller {
$this->load->view('template',$template); $this->load->view('template',$template);
} }
} }
?> ?>
\ No newline at end of file
...@@ -95,6 +95,7 @@ class Event extends CI_Controller { ...@@ -95,6 +95,7 @@ class Event extends CI_Controller {
} }
$_POST['has_payment'] = (isset($_POST['has_payment']) && $_POST['has_payment'] == 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'] = ''; $_POST['seat_pricing'] = $_POST['custom_seat_layout'] = '';
if(isset($_POST['fare_type']) && $_POST['fare_type'] == 1){ if(isset($_POST['fare_type']) && $_POST['fare_type'] == 1){
...@@ -109,7 +110,7 @@ class Event extends CI_Controller { ...@@ -109,7 +110,7 @@ class Event extends CI_Controller {
'weekend_price'=>$_POST['weekend_price'][$i]); 'weekend_price'=>$_POST['weekend_price'][$i]);
} }
$_POST['custom_seat_layout'] = json_encode($cstmSeatLayout); $_POST['custom_seat_layout'] = json_encode($cstmSeatLayout);
} else if (isset($_POST['price']) && !empty($_POST['price']) && } else if (isset($_POST['price']) && $_POST['price'] != '' &&
isset($_POST['capacity']) && !empty($_POST['capacity'])){ isset($_POST['capacity']) && !empty($_POST['capacity'])){
$seatPriceArr = array('price'=>$_POST['price'],'capacity'=>$_POST['capacity']); $seatPriceArr = array('price'=>$_POST['price'],'capacity'=>$_POST['capacity']);
foreach($language AS $lang) { foreach($language AS $lang) {
...@@ -129,6 +130,7 @@ class Event extends CI_Controller { ...@@ -129,6 +130,7 @@ class Event extends CI_Controller {
'category_id'=>$_POST['category_id'], 'category_id'=>$_POST['category_id'],
'provider_id'=>$provider, 'provider_id'=>$provider,
'max_booking'=>$_POST['max_booking'], 'max_booking'=>$_POST['max_booking'],
'approve_booking'=>$_POST['approve_booking'],
'has_payment'=>$_POST['has_payment'], 'has_payment'=>$_POST['has_payment'],
'seat_pricing'=>$_POST['seat_pricing'], 'seat_pricing'=>$_POST['seat_pricing'],
'custom_seat_layout'=>$_POST['custom_seat_layout']); 'custom_seat_layout'=>$_POST['custom_seat_layout']);
...@@ -276,7 +278,9 @@ class Event extends CI_Controller { ...@@ -276,7 +278,9 @@ class Event extends CI_Controller {
$errMsg = 'Provide Proper Layout details'; $errMsg = 'Provide Proper Layout details';
} }
$_POST['has_payment'] = (isset($_POST['has_payment']) && $_POST['has_payment'] == 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'] = ''; $_POST['seat_pricing'] = $_POST['custom_seat_layout'] = '';
if(isset($_POST['fare_type']) && $_POST['fare_type'] == 1){ if(isset($_POST['fare_type']) && $_POST['fare_type'] == 1){
$cstmSeatLayout = array(); $cstmSeatLayout = array();
...@@ -290,7 +294,7 @@ class Event extends CI_Controller { ...@@ -290,7 +294,7 @@ class Event extends CI_Controller {
'weekend_price'=>$_POST['weekend_price'][$i]); 'weekend_price'=>$_POST['weekend_price'][$i]);
} }
$_POST['custom_seat_layout'] = json_encode($cstmSeatLayout); $_POST['custom_seat_layout'] = json_encode($cstmSeatLayout);
} else if(isset($_POST['price']) && !empty($_POST['price']) && } else if(isset($_POST['price']) && $_POST['price'] != '' &&
isset($_POST['capacity']) && !empty($_POST['capacity'])){ isset($_POST['capacity']) && !empty($_POST['capacity'])){
$seatPriceArr = array('price'=>$_POST['price'],'capacity'=>$_POST['capacity']); $seatPriceArr = array('price'=>$_POST['price'],'capacity'=>$_POST['capacity']);
foreach($language AS $lang) { foreach($language AS $lang) {
...@@ -312,6 +316,7 @@ class Event extends CI_Controller { ...@@ -312,6 +316,7 @@ class Event extends CI_Controller {
'max_booking'=>$_POST['max_booking'], 'max_booking'=>$_POST['max_booking'],
'has_payment'=>$_POST['has_payment'], 'has_payment'=>$_POST['has_payment'],
'seat_pricing'=>$_POST['seat_pricing'], 'seat_pricing'=>$_POST['seat_pricing'],
'approve_booking'=>$_POST['approve_booking'],
'custom_seat_layout'=>$_POST['custom_seat_layout']); 'custom_seat_layout'=>$_POST['custom_seat_layout']);
$languageArr = array(); $languageArr = array();
foreach($language AS $lang) { foreach($language AS $lang) {
......
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class HotelCity extends CI_Controller {
public function __construct() {
parent::__construct();
date_default_timezone_set("Asia/Riyadh");
$this->load->model('HotelCity_model');
$this->load->model('Dashboard_model');
if(!$this->session->userdata('logged_in')) {
redirect(base_url('Login'));
}
$role = roleManagement();
if(!array_key_exists('City',$role)){
redirect(base_url('Dashboard'));
}
}
function listHotelCity(){
$template['page'] = 'HotelCity/viewHotelCityList';
$template['menu'] = 'Hotel City Management';
$template['smenu'] = 'View Hotel City List';
$template['pTitle'] = "Hotel City Management";
$template['pDescription'] = "View Hotel City List";
$template['hotelCityData'] = $this->HotelCity_model->getHotelCityData();
$this->load->view('template',$template);
}
function addHotelCity(){
$this->load->model('HotelCity_model');
$template['hotelCityData'] = $this->HotelCity_model->getHotelCityData();
$template['page'] = 'HotelCity/hotelCityAddForm';
$template['menu'] = 'Hotel City Management';
$template['smenu'] = 'Add Hotel City';
$template['pTitle'] = "Add Hotel City";
$template['pDescription'] = "Create New Hotel City";
$this->load->view('template',$template);
}
function createHotelCity(){
$flashMsg = array('message'=>'Something went wrong, please try again..!','class'=>'error');
if(!isset($_POST) || empty($_POST)){
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('HotelCity/addHotelCity'));
}
$err = 0;
$errMsg = '';
if($err == 0 && (!isset($_POST['hotel_city_name_EN']) || empty($_POST['hotel_city_name_EN']))){
$err = 1;
$errMsg = 'Provide a Hotel City Name in English';
} else if($err == 0 && (!isset($_FILES) || !isset($_FILES['hotel_city_icon']) ||
empty($_FILES['hotel_city_icon']))){
$err = 1;
$errMsg = 'Provide a Hotel City Icon';
}
$latLng = getLocationLatLng($_POST['hotel_city_name_EN']);
if($err == 0 && empty($latLng)){
$err = 1;
$errMsg = 'Provide a proper Hotel City Name';
}
$_POST['hotel_city_lat'] = $latLng['lat'];
$_POST['hotel_city_lng'] = $latLng['lng'];
if($err == 0){
$config = set_upload_service("assets/uploads/services");
$this->load->library('upload');
$config['file_name'] = time()."_".$_FILES['hotel_city_icon']['name'];
$this->upload->initialize($config);
if(!$this->upload->do_upload('hotel_city_icon')){
$err = 1;
$errMsg = $this->upload->display_errors();
}else{
$upload_data = $this->upload->data();
$_POST['hotel_city_icon'] = $config['upload_path']."/".$upload_data['file_name'];
}
}
if($err == 1){
$flashMsg['message'] = $errMsg;
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('HotelCity/addHotelCity'));
}
$status = $this->HotelCity_model->createHotelCity($_POST);
if($status == 1){
$flashMsg['class'] = 'success';
$flashMsg['message'] = 'HotelCity Created';
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('HotelCity/listHotelCity'));
}
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('HotelCity/addHotelCity'));
}
function editHotelCity($hotel_city_id=''){
$flashMsg = array('message'=>'Something went wrong, please try again..!','class'=>'error');
if(empty($hotel_city_id) || empty(decode_param($hotel_city_id))){
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('HotelCity/listHotelCity'));
}
$template['page'] = 'HotelCity/hotelCityAddForm';
$template['menu'] = 'Hotel City Management';
$template['smenu'] = 'Edit Hotel City';
$template['pTitle'] = "Edit Hotel City";
$template['pDescription'] = "Update Hotel City Data";
$template['hotel_city_id'] = $hotel_city_id;
$template['hotelCityData'] = $this->HotelCity_model->getHotelCityData(decode_param($hotel_city_id));
$this->load->view('template',$template);
}
function updateHotelCity($hotel_city_id=''){
$flashMsg = array('message'=>'Something went wrong, please try again..!','class'=>'error');
$err = 0;
$errMsg = '';
if(!isset($_POST) || empty($_POST) || empty($hotel_city_id)){
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('HotelCity/listHotelCity'));
}
if($err == 0 && (!isset($_POST['hotel_city_name_EN']) || empty($_POST['hotel_city_name_EN']))){
$err = 1;
$errMsg = 'Provide a Hotel City Name in English';
}
if($err == 1){
$flashMsg['message'] = $errMsg;
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('HotelCity/editHotelCity/'.$hotel_city_id));
}
if(isset($_FILES) && isset($_FILES['hotel_city_icon']) && !empty($_FILES['hotel_city_icon'])){
$config = set_upload_service("assets/uploads/services");
$this->load->library('upload');
$config['file_name'] = time()."_".$_FILES['hotel_city_icon']['name'];
$this->upload->initialize($config);
if($this->upload->do_upload('hotel_city_icon')){
$upload_data = $this->upload->data();
$_POST['hotel_city_icon'] = $config['upload_path']."/".$upload_data['file_name'];
}
}
$latLng = getLocationLatLng($_POST['hotel_city_name_EN']);
if($err == 0 && empty($latLng)){
$err = 1;
$errMsg = 'Provide a proper Hotel City Name';
}
$_POST['hotel_city_lat'] = $latLng['lat'];
$_POST['hotel_city_lng'] = $latLng['lng'];
if($err == 0){
$config = set_upload_service("assets/uploads/services");
$this->load->library('upload');
$config['file_name'] = time()."_".$_FILES['hotel_city_icon']['name'];
$this->upload->initialize($config);
if(!$this->upload->do_upload('hotel_city_icon')){
$err = 1;
$errMsg = $this->upload->display_errors();
}else{
$upload_data = $this->upload->data();
$_POST['hotel_city_icon'] = $config['upload_path']."/".$upload_data['file_name'];
}
}
$status = $this->HotelCity_model->updateHotelCity(decode_param($hotel_city_id),$_POST);
if($status == 1){
$flashMsg['class'] = 'success';
$flashMsg['message'] = 'HotelCity Created';
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('HotelCity/listHotelCity'));
}
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('HotelCity/editHotelCity/'.$hotel_city_id));
}
function changeStatus(){
if(!isset($_POST) || !isset($_POST['hotel_city_id']) || empty($_POST['hotel_city_id']) ||
!isset($_POST['status']) || $_POST['status'] == ''){
echo json_encode(array('status'=>'0'));exit;
}
$status = $_POST['status'];
$hotel_city_id = decode_param($_POST['hotel_city_id']);
$resp = $this->HotelCity_model->changeStatus($hotel_city_id,$status);
if($resp){
echo json_encode(array('status'=>'1'));exit;
}
echo json_encode(array('status'=>'0'));exit;
}
}
?>
...@@ -30,9 +30,9 @@ class Webservice extends CI_Controller { ...@@ -30,9 +30,9 @@ class Webservice extends CI_Controller {
$data = $_POST; $data = $_POST;
} }
if (isset(apache_request_headers()['Auth']) || isset(apache_request_headers()['auth'])) { if (isset(apache_request_headers()['Auth']) || isset(apache_request_headers()['auth'])) {
$this->auth_token = (isset(apache_request_headers()['Auth']))?apache_request_headers()['Auth']:apache_request_headers()['auth']; $this->auth_token = (isset(apache_request_headers()['Auth']))?apache_request_headers()['Auth']:apache_request_headers()['auth'];
$data['auth_token'] = $this->auth_token; $data['auth_token'] = $this->auth_token;
} }
$res = $this->Validation_app_model->validation_check($method, $data); $res = $this->Validation_app_model->validation_check($method, $data);
if($res['state'] == 1) { if($res['state'] == 1) {
$this->errorResponse($res['response']['code'], $res['response']['message']); $this->errorResponse($res['response']['code'], $res['response']['message']);
...@@ -571,6 +571,16 @@ class Webservice extends CI_Controller { ...@@ -571,6 +571,16 @@ class Webservice extends CI_Controller {
} }
} }
public function create_guest_user() {
$res = $this->Webservice_model->createGuestUser();
if($res['status'] == 'success'){
$this->response($res['data']);
}
else{
$this->errorResponse($res['code'],$res['message']);
}
}
public function get_hotel_city_list(){ public function get_hotel_city_list(){
$data = $_GET; $data = $_GET;
$data['auth_token'] = $this->auth_token; $data['auth_token'] = $this->auth_token;
...@@ -666,5 +676,4 @@ class Webservice extends CI_Controller { ...@@ -666,5 +676,4 @@ class Webservice extends CI_Controller {
} }
?> ?>
...@@ -8,6 +8,7 @@ class Api_model extends CI_Model { ...@@ -8,6 +8,7 @@ class Api_model extends CI_Model {
public function login($data){ public function login($data){
try{ try{
$res = array('status'=>0,'message'=>'Something went wrong','code'=>'ER07');
$this->db->select('customer.name,customer.dob,customer.phone,customer.email,customer.profile_image $this->db->select('customer.name,customer.dob,customer.phone,customer.email,customer.profile_image
AS image,customer.gender,users.id AS userId,customer.profile_city AS city,customer.dob,customer.email_verified'); AS image,customer.gender,users.id AS userId,customer.profile_city AS city,customer.dob,customer.email_verified');
$this->db->where('users.status',1); $this->db->where('users.status',1);
...@@ -43,19 +44,23 @@ class Api_model extends CI_Model { ...@@ -43,19 +44,23 @@ class Api_model extends CI_Model {
try{ try{
$email = $data['email_id']; $email = $data['email_id'];
$phone = preg_replace('/\D/', '', $data['phone']); $phone = preg_replace('/\D/', '', $data['phone']);
$res_count = $phone_code = preg_replace('/\D/', '', $data['phone_code']);
$this->db->query("SELECT * FROM customer
INNER JOIN `users` ON users.id=customer.customer_id AND users.user_type='3' $sql = "SELECT * FROM customer
WHERE users.status!='2' AND INNER JOIN `users` ON users.id=customer.customer_id AND users.user_type='3'
(customer.email = '$email' OR customer.phone LIKE '%$phone')")->row(); WHERE users.status!='2' AND (customer.email = '$email' OR
(customer.phone_code='$phone_code' AND customer.phone LIKE '%$phone'))";
$res_count = $this->db->query($sql)->row();
if(count($res_count) > 0) { if(count($res_count) > 0) {
if($res_count->email == $data['email_id'] && $res_count->phone == $data['phone']){ if($res_count->email == $data['email_id'] && $res_count->phone == $data['phone']){
$res = array('status'=>0,'message'=>'Already have an account with email id and phone no. Please login','code'=>'ER12'); return array('status'=>0,'message'=>'Already have an account with email id and phone no. Please login','code'=>'ER12');
} else if($res_count->email == $data['email_id']){ } else if($res_count->email == $data['email_id']){
$res = array('status'=>0,'message'=>'Email id already exists','code'=>'ER09'); return array('status'=>0,'message'=>'Email id already exists','code'=>'ER09');
} else if(strpos($res_count->phone,$data['phone']) !== false) { } else if(strpos($res_count->phone,$data['phone'])!==false||$res_count->phone==$data['phone']){
$res = array('status'=>0,'message'=>'Phone no already exists','code'=>'ER10'); return array('status'=>0,'message'=>'Phone no already exists','code'=>'ER10');
}else{
return array('status'=>0,'message'=>'Something went wrong','code'=>'ER07');
} }
} else { } else {
$unique_id = uniqid().time(); $unique_id = uniqid().time();
...@@ -67,14 +72,8 @@ class Api_model extends CI_Model { ...@@ -67,14 +72,8 @@ class Api_model extends CI_Model {
$id = $this->db->insert_id(); $id = $this->db->insert_id();
if($id) { if($id) {
if(strpos($data['phone'],'+') === true){
$data['phone'] = str_replace('+','',$data['phone']);
}
if(strpos($data['phone'],'966') !== true){
$data['phone'] = '966'.$data['phone'];
}
$customer_data = array('customer_id'=>$id,'phone'=>$data['phone'], $customer_data = array('customer_id'=>$id,'phone'=>$data['phone'],
'phone_code'=>$data['phone_code'],
'email_verified'=>'0','email'=>$data['email_id'], 'email_verified'=>'0','email'=>$data['email_id'],
'name'=>$data['name'],'confirm_link'=>$unique_id); 'name'=>$data['name'],'confirm_link'=>$unique_id);
...@@ -97,7 +96,7 @@ class Api_model extends CI_Model { ...@@ -97,7 +96,7 @@ class Api_model extends CI_Model {
$this->send_mail($subject,$email_id,$message); $this->send_mail($subject,$email_id,$message);
$res = array('status'=>1,'data'=>''); return array('status'=>1,'data'=>'');
// $this->db->select('customer.name,customer.dob,customer.phone,customer.email,customer.profile_image AS image,customer.gender,users.id AS userId, customer.city'); // $this->db->select('customer.name,customer.dob,customer.phone,customer.email,customer.profile_image AS image,customer.gender,users.id AS userId, customer.city');
// $this->db->where('users.id',$id); // $this->db->where('users.id',$id);
...@@ -113,13 +112,12 @@ class Api_model extends CI_Model { ...@@ -113,13 +112,12 @@ class Api_model extends CI_Model {
// $res = array('status'=>0,'message'=>'No record found','code'=>'ER13'); // $res = array('status'=>0,'message'=>'No record found','code'=>'ER13');
// } // }
} else { } else {
$res = array('status'=>0,'message'=>'Registration failed please try again','code'=>'ER11'); return array('status'=>0,'message'=>'Registration failed please try again','code'=>'ER11');
} }
} }
} catch(Exception $e) { } catch(Exception $e) {
$res = array('status'=>0,'message'=>'Ohh No!! Something went South!!','code'=>'ER06'); return array('status'=>0,'message'=>'Ohh No!! Something went South!!','code'=>'ER06');
} }
return $res;
} }
function send_mail($subject,$email,$message,$attach=null) { function send_mail($subject,$email,$message,$attach=null) {
...@@ -148,13 +146,16 @@ class Api_model extends CI_Model { ...@@ -148,13 +146,16 @@ class Api_model extends CI_Model {
function forgot($data) { function forgot($data) {
try{ try{
$settings = getSettings();
$redUrl = $settings['web_base_url'];
$res_count = $this->db->where('email',$data['email_id'])->get('customer')->num_rows(); $res_count = $this->db->where('email',$data['email_id'])->get('customer')->num_rows();
if($res_count > 0) { if($res_count > 0) {
$unique_id = uniqid().time(); $unique_id = uniqid().time();
$this->db->where('email',$data['email_id'])->update('customer',array('reset_key'=>$unique_id)); $this->db->where('email',$data['email_id'])->update('customer',array('reset_key'=>$unique_id));
$subject = "TimeOut: Forgot Password"; $subject = "TimeOut: Forgot Password";
$url = 'https://timeout.sa/staging/forgot/?reset_key='.$unique_id; $url = $redUrl.'forgot?reset_key='.$unique_id;
$msgContent = "Hi, Welcome to TimeOut. Please use this link $msgContent = "Hi, Welcome to TimeOut. Please use this link
for reset your password: ".$url; for reset your password: ".$url;
$message = "<html><body><p>".$msgContent."</p></body></html>"; $message = "<html><body><p>".$msgContent."</p></body></html>";
...@@ -227,11 +228,12 @@ class Api_model extends CI_Model { ...@@ -227,11 +228,12 @@ class Api_model extends CI_Model {
function getCountry() { function getCountry() {
try { try {
$rs = $this->db->query("SELECT language_code,country_id,country_name,country_code, $rs = $this->db->query("SELECT CTRY.language_code,CTRY.country_id,CTRY.country_name,
language,currency,currency_symbol,conversion_rate CTRY.country_code,CTRY.language,CTRY.currency,CTRY.currency_symbol,
FROM country CTRY.conversion_rate,CTRY.phone_code
WHERE status = 1 FROM country AS CTRY
ORDER BY country_name")->result(); WHERE CTRY.status = 1
ORDER BY CTRY.country_name")->result();
if(count($rs) > 0) { if(count($rs) > 0) {
$res = array('status'=>1,'data'=>$rs); $res = array('status'=>1,'data'=>$rs);
} else { } else {
...@@ -393,7 +395,7 @@ class Api_model extends CI_Model { ...@@ -393,7 +395,7 @@ class Api_model extends CI_Model {
JOIN venue ON venue.id=events.venue_id JOIN venue ON venue.id=events.venue_id
LEFT JOIN event_gallery ON events.event_id=event_gallery.event_id AND LEFT JOIN event_gallery ON events.event_id=event_gallery.event_id AND
event_gallery.media_type=0 event_gallery.media_type=0
WHERE customer_id='$user_id' AND booking.status IN(0,1,2) WHERE customer_id='$user_id' AND booking.status IN(0,1,2,6)
GROUP BY booking.id ORDER BY booking.id DESC LIMIT 10"; GROUP BY booking.id ORDER BY booking.id DESC LIMIT 10";
$result = $this->db->query($sql)->result_array(); $result = $this->db->query($sql)->result_array();
...@@ -450,17 +452,12 @@ class Api_model extends CI_Model { ...@@ -450,17 +452,12 @@ class Api_model extends CI_Model {
try { try {
$user_id = $this->auth_token_get($data['auth_token']); $user_id = $this->auth_token_get($data['auth_token']);
if($user_id > 0) { if($user_id > 0) {
$res_count = $this->db->where('bookId',$data['bookingCode'])->where('status',1)->get('booking')->num_rows(); $rs = $this->db->where('bookId',$data['bookingCode'])->update('booking',array('status'=>0));
if($res_count > 0) { if($rs) {
$rs = $this->db->where('bookId',$data['bookingCode'])->update('booking',array('status'=>0)); $res = array('status'=>1,'data'=>null);
if($rs) { } else {
$res = array('status'=>1,'data'=>null); $res = array('status'=>0,'message'=>'Cancel submission failed','code'=>'ER25');
} else { }
$res = array('status'=>0,'message'=>'Cancel submission failed','code'=>'ER25');
}
} else {
$res = array('status'=>0,'message'=>'Invalid booking code','code'=>'ER24');
}
} else { } else {
$res = array('status'=>0,'message'=>'Invalid user','code'=>'ER19'); $res = array('status'=>0,'message'=>'Invalid user','code'=>'ER19');
} }
...@@ -598,10 +595,9 @@ class Api_model extends CI_Model { ...@@ -598,10 +595,9 @@ class Api_model extends CI_Model {
try{ try{
$user_id = $this->auth_token_get($data['auth_token']); $user_id = $this->auth_token_get($data['auth_token']);
if($user_id > 0) { if($user_id > 0) {
$post_data = $data; $post_data = $data;
$status = (isset($post_data['has_payment']) && $post_data['has_payment'] == 0)?'1':'3'; $status = (isset($post_data['has_payment']) && $post_data['has_payment'] == 0)?'1':'3';
$post_data['status'] = $status; $post_data['status'] = $status;
$post_data['bookId'] = 'TO'.date('ymd').str_pad(rand(1111,9999),4,0,STR_PAD_LEFT); $post_data['bookId'] = 'TO'.date('ymd').str_pad(rand(1111,9999),4,0,STR_PAD_LEFT);
$post_data['qrcode'] = genQRcode($post_data['bookId']); $post_data['qrcode'] = genQRcode($post_data['bookId']);
...@@ -609,15 +605,25 @@ class Api_model extends CI_Model { ...@@ -609,15 +605,25 @@ class Api_model extends CI_Model {
$post_data['booking_date'] = date('Y-m-d H:i:s'); $post_data['booking_date'] = date('Y-m-d H:i:s');
$post_data['ticket_details'] = json_encode($post_data['ticket_details']); $post_data['ticket_details'] = json_encode($post_data['ticket_details']);
if(!isset($post_data['amount']) || $post_data['amount'] == ''){
$post_data['amount'] = 0;
}
$evtData = $this->db->get_where('events',array('event_id'=>$post_data['event_id']));
$evtData = $evtData->row_array();
if(!empty($evtData) && isset($evtData['approve_booking']) && $evtData['approve_booking']=='1'){
$post_data['status'] = '6';
}
$promocodeData = array(); $promocodeData = array();
if(isset($post_data['promocode_id']) && !empty($post_data['promocode_id']) && if(isset($post_data['promocode_id']) && !empty($post_data['promocode_id']) &&
isset($post_data['redeem_amount']) && !empty($post_data['redeem_amount'])){ isset($post_data['redeem_amount']) && !empty($post_data['redeem_amount'])){
$status = ($post_data['status'] == '1')?1:0; $promoStatus = ($post_data['status'] == '1')?1:0;
$promocodeData = array('user_id'=>$user_id,'booking_id'=>$post_data['bookId'], $promocodeData = array('user_id'=>$user_id,'booking_id'=>$post_data['bookId'],
'promocode_id'=>$post_data['promocode_id'], 'promocode_id'=>$post_data['promocode_id'],
'redeem_amount'=>$post_data['redeem_amount'], 'redeem_amount'=>$post_data['redeem_amount'],
'created_date'=>date('Y-m-d H:i:s'),'status'=>$status); 'created_date'=>date('Y-m-d H:i:s'),'status'=>$promoStatus);
} }
unset($post_data['auth_token'],$post_data['has_payment'], unset($post_data['auth_token'],$post_data['has_payment'],
$post_data['promocode_id'],$post_data['redeem_amount']); $post_data['promocode_id'],$post_data['redeem_amount']);
...@@ -1100,7 +1106,7 @@ class Api_model extends CI_Model { ...@@ -1100,7 +1106,7 @@ class Api_model extends CI_Model {
INNER JOIN event_date_time ON events.event_id=event_date_time.event_id $case INNER JOIN event_date_time ON events.event_id=event_date_time.event_id $case
WHERE events.status = 1 AND event_date_time.status='1' $where WHERE events.status = 1 AND event_date_time.status='1' $where
GROUP BY events.event_id"; GROUP BY events.event_id";
$count = $this->db->query()->num_rows($sql); $count = $this->db->query($sql)->num_rows();
if(isset($data['venue_id']) && !empty($data['venue_id'])) { if(isset($data['venue_id']) && !empty($data['venue_id'])) {
$where .= " AND locality.id ='".$data['venue_id']."'"; $where .= " AND locality.id ='".$data['venue_id']."'";
...@@ -1332,31 +1338,29 @@ class Api_model extends CI_Model { ...@@ -1332,31 +1338,29 @@ class Api_model extends CI_Model {
if(empty($last_id)){ if(empty($last_id)){
return; return;
} }
$this->db->update('transaction', $this->db->update('transaction',array('transaction_id'=>$transactionid,
array('transaction_id'=>$transactionid, 'transaction_response'=>json_encode($response),
'transaction_response'=>json_encode($response), 'status'=>$status),
'status'=>$status), array('id'=>$last_id));
array('id'=>$last_id));
if($status == 1){ if($status == 1){
$trBook = $this->db->get_where('transaction',array('id'=>$last_id))->row_array(); $trBook = $this->db->get_where('transaction',array('id'=>$last_id))->row_array();
$book_id = $trBook['booking_id']; $book_id = $trBook['booking_id'];
$this->db->update('booking',array('status'=>'1'),array('bookId'=>$book_id)); $sql = "SELECT TEVT.event_name,CONCAT(EDATE.date,' ',EDATE.time) AS show_time,
$this->db->update('event_invites',array('status'=>'1'),array('book_id'=>$book_id)); CUST.name,CUST.email,CUST.phone,EVT.approve_booking
$this->db->update('promocode_used',array('status'=>'1'),array('booking_id'=>$book_id)); FROM booking AS BK
INNER JOIN events AS EVT ON (EVT.event_id=BK.event_id)
$bkData = $this->db->query(" INNER JOIN translator_event AS TEVT ON (TEVT.event_id=EVT.event_id)
SELECT TEVT.event_name,CONCAT(EDATE.date,' ',EDATE.time) AS show_time, INNER JOIN customer AS CUST ON (CUST.customer_id=BK.customer_id)
CUST.name,CUST.email,CUST.phone INNER JOIN event_date_time AS EDATE ON (EDATE.id=BK.event_date_id)
FROM booking AS BK WHERE BK.bookId='".$trBook['booking_id']."' AND EVT.status='1' AND
INNER JOIN events AS EVT ON (EVT.event_id=BK.event_id) BK.status='3' AND EDATE.status='1' AND TEVT.language_code='EN'";
INNER JOIN translator_event AS TEVT ON (TEVT.event_id=EVT.event_id) $bkData = $this->db->query($sql)->row_array();
INNER JOIN customer AS CUST ON (CUST.customer_id=BK.customer_id)
INNER JOIN event_date_time AS EDATE ON (EDATE.id=BK.event_date_id) $bokStatus = '1';
WHERE BK.bookId='".$trBook['booking_id']."' AND EVT.status='1' AND
BK.status='1' AND EDATE.status='1' AND TEVT.language_code='EN'")->row_array();
if(!empty($bkData)){ if(!empty($bkData)){
$bokStatus = (isset($bkData['approve_booking'])&&$bkData['approve_booking']=='1')?'6':'1';
$subject = "Your Tickets - TimeOut"; $subject = "Your Tickets - TimeOut";
$showTime = date("d'S F Y - h:i, (l)",strtotime($bkData['show_time'])); $showTime = date("d'S F Y - h:i, (l)",strtotime($bkData['show_time']));
$msgContent = "Hi, Your booking is confirmed for the event '".$bkData['event_name']. $msgContent = "Hi, Your booking is confirmed for the event '".$bkData['event_name'].
...@@ -1373,13 +1377,15 @@ class Api_model extends CI_Model { ...@@ -1373,13 +1377,15 @@ class Api_model extends CI_Model {
$this->send_mail($subject,$bkData['email'],$message); $this->send_mail($subject,$bkData['email'],$message);
if(isset($template['booking_sms']) && !empty($template['booking_sms'])){ if(isset($template['booking_sms']) && !empty($template['booking_sms'])){
$msgContent = str_replace( $msgContent = str_replace(array('{:event_name}','{:booking_id}','{:time}'),
array('{:event_name}','{:booking_id}','{:time}'), array($bkData['event_name'],$trBook['booking_id'],$showTime),
array($bkData['event_name'],$trBook['booking_id'],$showTime), $template['booking_sms']);
$template['booking_sms']);
} }
$this->sendSMS($bkData['phone'],$msgContent); $this->sendSMS($bkData['phone'],$msgContent);
} }
$this->db->update('booking',array('status'=>$bokStatus),array('bookId'=>$book_id));
$this->db->update('event_invites',array('status'=>'1'),array('book_id'=>$book_id));
$this->db->update('promocode_used',array('status'=>'1'),array('booking_id'=>$book_id));
} }
$res = array('status'=>1); $res = array('status'=>1);
}catch(Exception $e){ }catch(Exception $e){
...@@ -1476,6 +1482,8 @@ class Api_model extends CI_Model { ...@@ -1476,6 +1482,8 @@ class Api_model extends CI_Model {
} }
public function verifyMail($data = ''){ public function verifyMail($data = ''){
$settings = getSettings();
$redUrl = $settings['web_base_url'];
try{ try{
$cust = $this->db->query("SELECT CUST.customer_id,CUST.email,CUST.phone $cust = $this->db->query("SELECT CUST.customer_id,CUST.email,CUST.phone
FROM customer AS CUST FROM customer AS CUST
...@@ -1500,11 +1508,11 @@ class Api_model extends CI_Model { ...@@ -1500,11 +1508,11 @@ class Api_model extends CI_Model {
if($this->db->update('customer',array('confirm_link'=>'','email_verified'=>'1'), if($this->db->update('customer',array('confirm_link'=>'','email_verified'=>'1'),
array('customer_id'=>$cust['customer_id']))){ array('customer_id'=>$cust['customer_id']))){
header('Location:https://timeout.sa/staging/location?login=1'); header('Location:'.$redUrl.'location?login=1');
} }
} }
}catch(Exception $e){} }catch(Exception $e){}
header('Location:https://timeout.sa/staging/location'); header('Location:'.$redUrl.'location');
} }
public function checkSeatAvailability($data = ''){ public function checkSeatAvailability($data = ''){
...@@ -1726,7 +1734,7 @@ class Api_model extends CI_Model { ...@@ -1726,7 +1734,7 @@ class Api_model extends CI_Model {
->select('booking.id AS book_id,booking.bookId,customer.name AS customer_name, ->select('booking.id AS book_id,booking.bookId,customer.name AS customer_name,
booking.status,booking.no_of_ticket,booking.qrcode, booking.status,booking.no_of_ticket,booking.qrcode,
booking.ticket_details,event_date_time.date AS booking_date') booking.ticket_details,event_date_time.date AS booking_date')
->where('booking.bookId',$data['qr_pin']) ->where(array('booking.bookId'=>$data['qr_pin'],'status'=>'1'))
->from('booking') ->from('booking')
->join('events','booking.event_id = events.event_id') ->join('events','booking.event_id = events.event_id')
->join('event_date_time','booking.event_date_id = event_date_time.id') ->join('event_date_time','booking.event_date_id = event_date_time.id')
...@@ -1815,4 +1823,5 @@ class Api_model extends CI_Model { ...@@ -1815,4 +1823,5 @@ class Api_model extends CI_Model {
} }
return $res; return $res;
} }
} ?> }
?>
\ No newline at end of file
...@@ -5,7 +5,7 @@ class Booking_model extends CI_Model { ...@@ -5,7 +5,7 @@ class Booking_model extends CI_Model {
parent::_construct(); parent::_construct();
} }
public function getBookingData($booking_id='',$provider_id='',$view='0,1,2,3,5'){ public function getBookingData($booking_id='',$provider_id='',$view='0,1,2,3,5,6'){
$cond = (!empty($view))?" BOK.status IN ($view) ":" BOK.status != '4' "; $cond = (!empty($view))?" BOK.status IN ($view) ":" BOK.status != '4' ";
$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' ":"";
...@@ -95,7 +95,7 @@ class Booking_model extends CI_Model { ...@@ -95,7 +95,7 @@ class Booking_model extends CI_Model {
$end_date = date('Y-m-d',strtotime(trim($where_cond['end_date']).' 23:59')); $end_date = date('Y-m-d',strtotime(trim($where_cond['end_date']).' 23:59'));
$where_clause .= " BOK.booking_date <= '".$end_date."' "; $where_clause .= " BOK.booking_date <= '".$end_date."' ";
} }
if(!empty($where_cond['status'])){ if($where_cond['status'] != ''){
$where_clause .= (empty($where_clause))?' WHERE ':' AND '; $where_clause .= (empty($where_clause))?' WHERE ':' AND ';
$where_clause .= " BOK.status = '".$where_cond['status']."' "; $where_clause .= " BOK.status = '".$where_cond['status']."' ";
......
...@@ -5,10 +5,11 @@ class Country_model extends CI_Model { ...@@ -5,10 +5,11 @@ class Country_model extends CI_Model {
} }
public function getCountryData($country_id='',$view=''){ public function getCountryData($country_id='',$view=''){
$cond = (!empty($view))?" status IN ($view) ":" status != '2' "; $cond = (!empty($view))?" CTRY.status IN ($view) ":" CTRY.status != '2' ";
$cond .= (!empty($country_id))?" AND country_id='$country_id' ":""; $cond .= (!empty($country_id))?" AND CTRY.country_id='$country_id' ":"";
$countryData = $this->db->query("SELECT * FROM country WHERE $cond"); $sql = "SELECT CTRY.* FROM country AS CTRY WHERE $cond";
$countryData = $this->db->query($sql);
if(!empty($countryData)){ if(!empty($countryData)){
return (empty($country_id))?$countryData->result():$countryData->row(); return (empty($country_id))?$countryData->result():$countryData->row();
} }
...@@ -35,8 +36,7 @@ class Country_model extends CI_Model { ...@@ -35,8 +36,7 @@ class Country_model extends CI_Model {
if(empty($country_id)){ if(empty($country_id)){
return 0; return 0;
} }
$status = $this->db->update('country',array('status'=>$status), $status = $this->db->update('country',array('status'=>$status),array('country_id'=>$country_id));
array('country_id'=>$country_id));
return $status; return $status;
} }
......
...@@ -209,7 +209,7 @@ class Event_model extends CI_Model { ...@@ -209,7 +209,7 @@ class Event_model extends CI_Model {
if(empty($event_id) || empty($eventData)){ if(empty($event_id) || empty($eventData)){
return 0; return 0;
} }
$this->db->update('event_date_time',array('status'=>'0'),array('event_id'=>$event_id)); $this->db->update('event_date_time',array('status'=>'0'),array('event_id'=>$event_id,'status'=>'1'));
$status = $this->db->insert_batch('event_date_time',$eventData); $status = $this->db->insert_batch('event_date_time',$eventData);
return $status; return $status;
} }
......
<?php
class HotelCity_model extends CI_Model {
public function _consruct(){
parent::_construct();
}
public function getHotelCityData($hotelCity_id='',$view=''){
$cond = (!empty($view))?" status IN ($view) ":" status != '2' ";
$cond .= (!empty($hotelCity_id))?" AND hotel_city_id='$hotelCity_id' ":"";
$hotelCityData = $this->db->query("SELECT * FROM hotel_cities WHERE $cond");
if(!empty($hotelCityData)){
if(empty($hotelCity_id)){
$hotelCityData = $hotelCityData->result_array();
foreach ($hotelCityData AS $key => $hotelCity) {
$regData = langTranslator($hotelCity['hotel_city_id'],'HCTY','');
$hotelCityData[$key] = array_merge($hotelCityData[$key],$regData);
}
} else {
$regData = langTranslator($hotelCity_id,'HCTY','');
$hotelCityData = $hotelCityData->row_array();
$hotelCityData = array_merge($hotelCityData,$regData);
}
return json_decode(json_encode($hotelCityData));
} else {
return 0;
}
}
public function createHotelCity($hotelCityData = array()){
if(empty($hotelCityData)){
return 0;
}
$status = $this->db->insert('hotel_cities',array('hotel_city_icon'=>$hotelCityData['hotel_city_icon'],
'hotel_city_lat'=>$hotelCityData['hotel_city_lat'],
'hotel_city_lng'=>$hotelCityData['hotel_city_lng']));
if($status){
$hotelCity_id = $this->db->insert_id();
$languages = getLanguages();
if(!empty($languages)){
$insertArr = array();
foreach ($languages AS $lang) {
if(!isset($hotelCityData['hotel_city_name_'.$lang]) || empty($hotelCityData['hotel_city_name_'.$lang])){
continue;
}
$insertArr[] = array('hotel_city_id'=>$hotelCity_id,
'language_code'=>$lang,
'hotel_city_name'=>$hotelCityData['hotel_city_name_'.$lang]);
}
if(!empty($insertArr)){
$this->db->insert_batch('translator_hotel_city',$insertArr);
}
}
}
return $status;
}
public function updateHotelCity($hotelCity_id = '', $hotelCityData = array()){
if(empty($hotelCity_id) || empty($hotelCityData)){
return 0;
}
$languages = getLanguages();
if(!empty($languages)){
$insertArr = array();
foreach ($languages AS $lang) {
if(!isset($hotelCityData['hotel_city_name_'.$lang]) ||
empty($hotelCityData['hotel_city_name_'.$lang])){
unset($hotelCityData['hotel_city_name_'.$lang]);
continue;
}
$insertArr[] = array('hotel_city_id'=>$hotelCity_id,
'language_code'=>$lang,
'hotel_city_name'=>$hotelCityData['hotel_city_name_'.$lang]);
unset($hotelCityData['hotel_city_name_'.$lang]);
}
$this->db->delete('translator_hotel_city',array('hotel_city_id'=>$hotelCity_id));
if(!empty($insertArr)){
$this->db->insert_batch('translator_hotel_city',$insertArr);
}
}
$status = $this->db->update('hotel_cities',$hotelCityData,array('hotel_city_id'=>$hotelCity_id));
return $status;
}
public function changeStatus($hotelCity_id = '', $status = '0'){
if(empty($hotelCity_id)){
return 0;
}
$status = $this->db->update('hotel_cities',array('status'=>$status),
array('hotel_city_id'=>$hotelCity_id));
return $status;
}
}
?>
...@@ -415,6 +415,15 @@ class Validation_app_model extends CI_Model { ...@@ -415,6 +415,15 @@ class Validation_app_model extends CI_Model {
'code' => 'ER02', 'code' => 'ER02',
'message' => 'User id is null or empty' 'message' => 'User id is null or empty'
) )
),
'create_guest_user' => array(),
'update_user_visibility' => array(
'visible' => array(
'required' => array(
'code' => 'ER18',
'message' => 'Required field is null or empty'
)
)
) )
), ),
'upload_audio_message' => array( 'upload_audio_message' => array(
......
...@@ -47,6 +47,12 @@ class Validation_model extends CI_Model { ...@@ -47,6 +47,12 @@ class Validation_model extends CI_Model {
'code' => 'ER04', 'code' => 'ER04',
'message' => 'Password is null or empty' 'message' => 'Password is null or empty'
) , ) ,
) ,
'phone_code' => array(
'required' => array(
'code' => 'ER05',
'message' => 'ISD Code is null or empty'
) ,
) )
) , ) ,
'forgot' => array( 'forgot' => array(
...@@ -213,13 +219,7 @@ class Validation_model extends CI_Model { ...@@ -213,13 +219,7 @@ class Validation_model extends CI_Model {
'code' => 'ER33', 'code' => 'ER33',
'message' => 'Event date and time is null or empty' 'message' => 'Event date and time is null or empty'
) )
) , ),
'amount' => array(
'required' => array(
'code' => 'ER35',
'message' => 'Amount is null or empty'
)
) ,
'no_of_ticket' => array( 'no_of_ticket' => array(
'required' => array( 'required' => array(
'code' => 'ER36', 'code' => 'ER36',
...@@ -692,6 +692,14 @@ class Validation_model extends CI_Model { ...@@ -692,6 +692,14 @@ class Validation_model extends CI_Model {
) )
) )
), ),
'addCard' => array(
'requestData' => array(
'required' => array(
'code' => 'ER18',
'message' => 'Request Data is null or empty'
)
)
)
); );
public function _consruct(){ public function _consruct(){
......
...@@ -1061,7 +1061,7 @@ class Webservice_model extends CI_Model { ...@@ -1061,7 +1061,7 @@ class Webservice_model extends CI_Model {
$user_id = $this->auth_token_get($data['auth_token']); $user_id = $this->auth_token_get($data['auth_token']);
if($user_id > 0) { if($user_id > 0) {
$post_data = $data; $post_data = $data;
$status = '3';
$book_id = 'TO'.date('ymd').str_pad(rand(1111,9999),4,0,STR_PAD_LEFT); $book_id = 'TO'.date('ymd').str_pad(rand(1111,9999),4,0,STR_PAD_LEFT);
$post_data['bookId'] = $book_id; $post_data['bookId'] = $book_id;
$post_data['qrcode'] = genQRcode($post_data['bookId']); $post_data['qrcode'] = genQRcode($post_data['bookId']);
...@@ -1073,9 +1073,14 @@ class Webservice_model extends CI_Model { ...@@ -1073,9 +1073,14 @@ class Webservice_model extends CI_Model {
if(!isset($post_data['amount']) || empty($post_data['amount'])){ if(!isset($post_data['amount']) || empty($post_data['amount'])){
$post_data['amount'] = 0; $post_data['amount'] = 0;
} }
if(isset($post_data['has_payment']) && $post_data['has_payment'] == 0){ if(isset($post_data['has_payment']) && $post_data['has_payment'] == 0){
$post_data['status'] = '1'; $status = $post_data['status'] = '1';
}
$evtData = $this->db->get_where('events',array('event_id'=>$post_data['event_id']));
$evtData = $evtData->row_array();
if(!empty($evtData) && isset($evtData['approve_booking']) && $evtData['approve_booking']=='1'){
$post_data['status'] = '6';
} }
$promocodeData = array(); $promocodeData = array();
...@@ -1089,10 +1094,10 @@ class Webservice_model extends CI_Model { ...@@ -1089,10 +1094,10 @@ class Webservice_model extends CI_Model {
$post_data['amount'] = $post_data['discounted_price']; $post_data['amount'] = $post_data['discounted_price'];
$redeem_amount = $post_data['amount']-$post_data['discounted_price']; $redeem_amount = $post_data['amount']-$post_data['discounted_price'];
$status = ($post_data['status'] == '1')? 1 : 0; $promoStatus = ($post_data['status'] == '1')? 1 : 0;
$promocodeData = array('user_id'=>$user_id,'booking_id'=>$book_id, $promocodeData = array('user_id'=>$user_id,'booking_id'=>$book_id,
'promocode_id'=>$promo_id,'redeem_amount'=>$redeem_amount, 'promocode_id'=>$promo_id,'redeem_amount'=>$redeem_amount,
'created_date'=>date('Y-m-d H:i:s'),'status'=>$status); 'created_date'=>date('Y-m-d H:i:s'),'status'=>$promoStatus);
} }
$invite_ids = (isset($post_data['friends_ids']))?$post_data['friends_ids']:''; $invite_ids = (isset($post_data['friends_ids']))?$post_data['friends_ids']:'';
$invite_phone = (isset($post_data['invite_list']))?$post_data['invite_list']:''; $invite_phone = (isset($post_data['invite_list']))?$post_data['invite_list']:'';
...@@ -1127,7 +1132,7 @@ class Webservice_model extends CI_Model { ...@@ -1127,7 +1132,7 @@ class Webservice_model extends CI_Model {
$this->db->insert_batch('event_invites',$insertArr); $this->db->insert_batch('event_invites',$insertArr);
} }
if($post_data['status'] == 1){ if($status == 1){
$countryData = $this->getCountryData($user_id); $countryData = $this->getCountryData($user_id);
$lang = $countryData['language_code']; $lang = $countryData['language_code'];
...@@ -1197,16 +1202,11 @@ class Webservice_model extends CI_Model { ...@@ -1197,16 +1202,11 @@ class Webservice_model extends CI_Model {
try { try {
$user_id = $this->auth_token_get($data['auth_token']); $user_id = $this->auth_token_get($data['auth_token']);
if($user_id > 0) { if($user_id > 0) {
$res_count = $this->db->where('bookId',$data['booking_id'])->where('status',1)->get('booking')->num_rows(); $rs = $this->db->where('bookId',$data['booking_id'])->update('booking',array('status'=>0));
if($res_count > 0) { if($rs) {
$rs = $this->db->where('bookId',$data['booking_id'])->update('booking',array('status'=>0)); $res = array('status'=>1,'data'=>null);
if($rs) {
$res = array('status'=>1,'data'=>null);
} else {
$res = array('status'=>0,'message'=>'Cancel submission failed','code'=>'ER25');
}
} else { } else {
$res = array('status'=>0,'message'=>'Invalid booking code','code'=>'ER24'); $res = array('status'=>0,'message'=>'Cancel submission failed','code'=>'ER25');
} }
} else { } else {
$res = array('status'=>0,'message'=>'Invalid user','code'=>'ER19'); $res = array('status'=>0,'message'=>'Invalid user','code'=>'ER19');
...@@ -1374,7 +1374,7 @@ class Webservice_model extends CI_Model { ...@@ -1374,7 +1374,7 @@ class Webservice_model extends CI_Model {
SELECT BOK.id FROM booking AS BOK SELECT BOK.id FROM booking AS BOK
INNER JOIN events AS EVT ON (EVT.event_id=BOK.event_id) INNER JOIN events AS EVT ON (EVT.event_id=BOK.event_id)
INNER JOIN event_date_time AS EDT ON (EVT.event_id=EVT.event_id) INNER JOIN event_date_time AS EDT ON (EVT.event_id=EVT.event_id)
WHERE BOK.customer_id='$user_id' AND BOK.status IN (0,1,2) AND EVT.status='1' WHERE BOK.customer_id='$user_id' AND BOK.status IN (0,1,2,6) AND EVT.status='1'
GROUP BY BOK.id")->num_rows(); GROUP BY BOK.id")->num_rows();
if($count > 0) { if($count > 0) {
...@@ -1399,8 +1399,8 @@ class Webservice_model extends CI_Model { ...@@ -1399,8 +1399,8 @@ class Webservice_model extends CI_Model {
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) AND WHERE booking.customer_id = '$user_id' AND booking.status IN(0,1,2,6) AND
translator_event.language_code = '$lang' (translator_event.language_code='$lang' OR 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";
...@@ -1511,7 +1511,7 @@ class Webservice_model extends CI_Model { ...@@ -1511,7 +1511,7 @@ class Webservice_model extends CI_Model {
LEFT JOIN customer ON customer.customer_id = booking.customer_id LEFT JOIN customer ON customer.customer_id = booking.customer_id
LEFT JOIN review ON review.event_id = booking.event_id LEFT JOIN review ON review.event_id = booking.event_id
WHERE booking.customer_id = '$user_id' AND booking.status='2' AND WHERE booking.customer_id = '$user_id' AND booking.status='2' AND
translator_event.language_code='$lang' (translator_event.language_code='$lang' OR translator_event.language_code='EN')
ORDER BY booking.id DESC LIMIT 1"; ORDER BY booking.id DESC LIMIT 1";
$result = $this->db->query($sql)->row_array(); $result = $this->db->query($sql)->row_array();
...@@ -1831,10 +1831,10 @@ class Webservice_model extends CI_Model { ...@@ -1831,10 +1831,10 @@ class Webservice_model extends CI_Model {
CUST.profile_image_qr,CHT.type AS friend_status CUST.profile_image_qr,CHT.type AS friend_status
FROM customer AS CUST FROM customer AS CUST
LEFT JOIN chats AS CHT ON ((CUST.customer_id=CHT.from_user OR CUST.customer_id=CHT.to_user) AND CHT.type=1) LEFT JOIN chats AS CHT ON ((CUST.customer_id=CHT.from_user OR CUST.customer_id=CHT.to_user) AND CHT.type=1)
WHERE ($phNumbers) AND CUST.enable_chat='1' AND
WHERE (".$phNumbers.") AND
customer_id NOT IN (SELECT from_user FROM chats WHERE (from_user=$user_id AND type='2') OR (to_user =$user_id AND type='2')) AND customer_id NOT IN (SELECT from_user FROM chats WHERE (from_user=$user_id AND type='2') OR (to_user =$user_id AND type='2')) AND
customer_id NOT IN (SELECT to_user FROM chats WHERE (from_user=$user_id AND type='2') OR (to_user =$user_id AND type='2'))"); customer_id NOT IN (SELECT to_user FROM chats WHERE (from_user=$user_id AND type='2') OR (to_user =$user_id AND type='2'))
GROUP BY CUST.customer_id");
$respArr['status'] = 1; $respArr['status'] = 1;
$respArr['data'] = (!empty($result) && !empty($result=$result->result_array()))?$result:[]; $respArr['data'] = (!empty($result) && !empty($result=$result->result_array()))?$result:[];
...@@ -1869,11 +1869,12 @@ class Webservice_model extends CI_Model { ...@@ -1869,11 +1869,12 @@ class Webservice_model extends CI_Model {
public function get_friend_requests($data){ public function get_friend_requests($data){
$respArr = array('status'=>0,'code'=>'918','message'=>'No Request for you'); $respArr = array('status'=>0,'code'=>'918','message'=>'No Request for you');
$user_id = $this->auth_token_get($data['auth_token']); $user_id = $this->auth_token_get($data['auth_token']);
$result = $this->db->query("SELECT CUST.name,CUST.phone,CUST.profile_image,CUST.profile_image_qr, $result = $this->db->query("SELECT CUST.name,CUST.phone,CUST.profile_image,CUST.profile_image_qr,
CUST.customer_id CUST.customer_id
FROM customer AS CUST FROM customer AS CUST
INNER JOIN chats AS CHT ON (CUST.customer_id = CHT.from_user) INNER JOIN chats AS CHT ON (CUST.customer_id = CHT.from_user)
WHERE type='0' AND to_user='".$user_id."'"); WHERE type='0' AND to_user='$user_id'
GROUP BY CUST.customer_id");
if(!empty($result) && !empty($result = $result->result())){ if(!empty($result) && !empty($result = $result->result())){
$respArr['status'] = 1; $respArr['status'] = 1;
$respArr['data'] = $result; $respArr['data'] = $result;
...@@ -1892,9 +1893,9 @@ class Webservice_model extends CI_Model { ...@@ -1892,9 +1893,9 @@ class Webservice_model extends CI_Model {
continue; continue;
} }
$fromUsrId = ''; $fromUsrId = '';
if($value['to_user']==$user_id){ if($value['to_user'] == $user_id) {
$fromUsrId = $value['from_user']; $fromUsrId = $value['from_user'];
} else if ($value['from_user'] == $user_id){ } else if ($value['from_user'] == $user_id) {
$fromUsrId = $value['to_user']; $fromUsrId = $value['to_user'];
} else { } else {
continue; continue;
...@@ -1902,7 +1903,8 @@ class Webservice_model extends CI_Model { ...@@ -1902,7 +1903,8 @@ class Webservice_model extends CI_Model {
$sql = "SELECT CUST.name,CUST.phone,CUST.profile_image,CUST.profile_image_qr, $sql = "SELECT CUST.name,CUST.phone,CUST.profile_image,CUST.profile_image_qr,
CUST.customer_id,CUST.fcm_token CUST.customer_id,CUST.fcm_token
FROM customer AS CUST FROM customer AS CUST
WHERE CUST.customer_id='$fromUsrId'"; WHERE CUST.customer_id='$fromUsrId' AND CUST.enable_chat='1'
GROUP BY CUST.customer_id";
$cust = $this->db->query($sql); $cust = $this->db->query($sql);
if(!empty($cust) && !empty($cust = $cust->row_array())){ if(!empty($cust) && !empty($cust = $cust->row_array())){
$custData[] = $cust; $custData[] = $cust;
...@@ -2040,6 +2042,42 @@ class Webservice_model extends CI_Model { ...@@ -2040,6 +2042,42 @@ class Webservice_model extends CI_Model {
$this->image_lib->resize(); $this->image_lib->resize();
} }
public function createGuestUser(){
$res = array('status'=>0,'message'=>'Something went wrong','code'=>'ER10');
$status = $this->db->insert('users',array('display_name'=>'Guest','user_type'=>'6'));
if(!$status || empty($guest_id = $this->db->insert_id())){
return $res;
}
$guestInfo = array('customer_id'=>$guest_id,'name'=>'Guest','phone_verified'=>'1');
$status = $this->db->insert('customer',$guestInfo);
if(!$status){
return $res;
}
$auth_token = md5(microtime().rand());
$this->generateAuth($guest_id,$auth_token);
return array('status'=>'success','data'=>array('auth_token'=>$auth_token));
}
public function update_user_visibility($data){
$res = array('status'=>0,'message'=>'Ohh No!! Something went South!!','code'=>'ER06');
try{
$user_id = $this->auth_token_get($data['auth_token']);
if($user_id > 0) {
$status = $this->db->update('customer',array('enable_chat'=>$data['visible']),
array('customer_id'=>$user_id));
$res = array('status'=>1);
} else {
$res = array('status'=>0,'message'=>'Invalid user','code'=>'ER19');
}
}
catch(Exception $e) {
$res = array('status'=>0,'message'=>'Ohh No!! Something went South!!','code'=>'ER06');
}
return $res;
}
public function get_hotel_city_list($data){ public function get_hotel_city_list($data){
try{ try{
$user_id = $this->auth_token_get($data['auth_token']); $user_id = $this->auth_token_get($data['auth_token']);
......
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
<option selected disabled>Select Booking Status</option> <option selected disabled>Select Booking Status</option>
<option value="">All Bookings</option> <option value="">All Bookings</option>
<?php <?php
$status = array('2'=>'Completed','1'=>'Bookings','3'=>'Pending','0'=>'Cancelled','4'=>'Deleted'); $status = array('2'=>'Completed','1'=>'Bookings','3'=>'Pending','0'=>'Cancelled','4'=>'Deleted','5'=>'Payment Failed');
foreach ($status as $key => $stat) { foreach ($status as $key => $stat) {
echo '<option value="'.$key.'">'.$stat.'</option>'; echo '<option value="'.$key.'">'.$stat.'</option>';
} }
......
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
<th class="center"><?= $booking->customer_name ?></th> <th class="center"><?= $booking->customer_name ?></th>
<th class="center"><?= $booking->date.' '.$booking->time ?></th> <th class="center"><?= $booking->date.' '.$booking->time ?></th>
<th class="center"><?= $booking->amount ?></th> <th class="center"><?= $booking->amount ?></th>
<th class="center"> <th class="center" id="bookingStatus_<?= encode_param($booking->booking_id) ?>">
<?php <?php
switch($booking->book_status){ switch($booking->book_status){
case 0: echo 'Cancelled'; break; case 0: echo 'Cancelled'; break;
...@@ -68,16 +68,28 @@ ...@@ -68,16 +68,28 @@
case 3: echo 'Pending'; break; case 3: echo 'Pending'; break;
case 4: echo 'Deleted'; break; case 4: echo 'Deleted'; break;
case 5: echo 'Payment Failed'; break; case 5: echo 'Payment Failed'; break;
case 6: echo 'Waiting for Aproval'; break;
} }
?> ?>
</th> </th>
<td class="center"> <td class="center">
<a class="btn btn-sm btn-info" id="viewBooking" booking_id="<?= encode_param($booking->booking_id) ?>"> <a class="cpoint text-primary" id="viewBooking"
booking_id="<?= encode_param($booking->booking_id) ?>">
<i class="fa fa-fw fa-eye"></i>View <i class="fa fa-fw fa-eye"></i>View
</a> </a> <br>
<!-- <a class="btn btn-sm btn-danger" status="2" onclick="confirmDelete(jQuery(this),'Booking/changeStatus',{'booking_id':'<?= encode_param($booking->booking_id) ?>'})"> <?php
<i class="fa fa-fw fa-trash"></i>Delete if($this->session->userdata('user_type')==2 && $booking->book_status == '6'){
</a> --> $msg = "Are you sure to Aprove this booking ?";
$bookId = encode_param($booking->booking_id);
$param = "{'booking_id':'$bookId','alertMsg':'$msg'}"; ?>
<a id="approveBooking_<?= encode_param($booking->booking_id) ?>"
class="cpoint text-success" status="1" call_back="updateBokApproved"
status_id="<?= encode_param($booking->booking_id) ?>"
onclick="confirmDelete(jQuery(this),'Booking/changeStatus',<?= $param ?>)">
<i class="fa fa-fw fa-check"></i>Approve
</a>
<?php } ?>
<?php } ?> <?php } ?>
</td> </td>
</tr> </tr>
......
<div class="content-wrapper" >
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
<?= $page_title ?>
<small><?= $page_desc ?></small>
</h1>
<ol class="breadcrumb">
<li><a href="<?= base_url() ?>"><i class="fa fa-star-o" aria-hidden="true"></i>Home</a></li>
<li><?= $menu ?></li>
<li class="active"><?= $sub_menu ?></li>
</ol>
</section>
<!-- Main content -->
<section class="content">
<div class="row">
<div class="col-md-12">
<?php if($this->session->flashdata('message')) {
$flashdata = $this->session->flashdata('message'); ?>
<div class="alert alert-<?= $flashdata['class'] ?>">
<button class="close" data-dismiss="alert" type="button">×</button>
<?= $flashdata['message'] ?>
</div>
<?php } ?>
</div>
<div class="col-xs-12">
<div class="box box-warning">
<div class="box-header">
<h3 class="box-title">Search Conditions</h3>
</div>
<div class="box-body">
<form id="where_cond">
<div class="col-md-12">
<?php if($this->session->userdata['user_type'] == 1){ ?>
<div class="col-md-3">
<div class="form-group ">
<label>Select Organizer</label>
<div class="col-md-12">
<select name="provider_id" class="form-control" data-parsley-trigger="change">
<option selected disabled>Select Organizer</option>
<option value="">All Bookings</option>
<?php
if(!empty($providerData)){
foreach ($providerData as $provider) {
echo '<option value="'.$provider->provider_id.'">'.$provider->name.'</option>';
}
}
?>
</select>
</div>
</div>
</div>
<?php } else { ?>
<input type="hidden" name="provider_id" value="<?= $this->session->userdata['id'] ?>">
<?php } ?>
<div class="col-md-6">
<label>Select Report Generation Date Range</label>
<div class="form-group ">
<div class="col-md-6">
<div class="input-group date" data-provide="datepicker">
<input id="datepicker" type="text" class="form-control" data-parsley-trigger="change" data-parsley-minlength="2" name="start_date" placeholder="Start Date" autocomplete="off">
<div class="input-group-addon">
<i class="fa fa-calendar"></i>
</div>
</div>
</div>
<div class="col-md-6">
<div class="input-group date" data-provide="datepicker">
<input id="datepicker" type="text" class="form-control" data-parsley-trigger="change" data-parsley-minlength="2" name="end_date" placeholder="End Date" autocomplete="off">
<div class="input-group-addon">
<i class="fa fa-calendar"></i>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-3">
<div class="form-group ">
<label>Select Booking Status</label>
<div class="col-md-12">
<select name="status" class="form-control" data-parsley-trigger="change">
<option selected disabled>Select Booking Status</option>
<option value="">All Bookings</option>
<?php
$status = array('2'=>'Completed','1'=>'Bookings','3'=>'Pending','0'=>'Cancelled','4'=>'Deleted');
foreach ($status as $key => $stat) {
echo '<option value="'.$key.'">'.$stat.'</option>';
}
?>
</select>
</div>
</div>
</div>
</div>
</form>
<div class="with-border" style="padding-top:70px;">
<h4 class="box-title" >Fields to View In Report</h4>
</div>
<div class="col-md-12" style="padding-top:20px;">
<div class="col-md-3">
<input name="fieldType" type="radio" checked="checked" style="padding-left: 10px;" action="hide"
value="all">
<label style="padding-left:15px;">All Fields</label>
</div>
<div class="col-md-3">
<input name="fieldType" type="radio" onclick="checkChild($(this));" action="show" value="custom">
<label style="padding-left:15px;">Custom Fields</label>
</div>
</div>
<div class="col-md-12">
<form id="field_list">
<table class="table table-striped hide" id="customFields">
<tbody>
<?php
$html = '';
$count = 0;
$rowFlg = 0;
$tables = array('booking_details' =>
array('name' => 'Basic Details',
'fields' =>
array('BOK.bookId AS Book_ID'=>'Book ID',
'CONCAT(EDT.date,\' \',EDT.time) AS Show_Time'=>'Show Time',
'BOK.qrcode AS QR_Code'=>'QR Code',
'BOK.no_of_ticket AS No_Of_Ticket'=>'No Of Ticket',
'BOK.ticket_details AS Ticket_Details'=>'Ticked Details',
'BOK.amount AS Amount'=>'Booking Amount',
'BOK.reserved_by AS Reserved_By'=>'Reserved By',
'BOK.status AS Book_Status'=>'Booking Status'
)
),
array('name' => 'Event Details',
'fields' =>
array('EVT.event_name_en AS Event_Name'=>'Event Name',
'EVT.event_description_en'=>'Event Discription',
'ECAT.category AS Category'=>'Event Category',
'ECAT.category_description AS Category_Description'=>'Category Description'
)
),
array('name' => 'Customer Details',
'fields' =>
array('CUST.name AS Customer_Name'=>'Customer Name',
'CUST.phone AS Customer_Phone'=>'Customer Phone',
'CUST.email AS Customer_Email'=>'Customer Email',
'CUST.city AS Customer_City'=>'Customer City'
)
),
array('name' => 'Provider Details',
'fields' =>
array('PRV.name AS Provider_Name'=>'Provider Name',
'PRV.phone AS Provider_Phone'=>'Provider Phone',
'PRV.email AS Provider_Email'=>'Provider Email'
)
),
array('name' => 'Venue Details',
'fields' =>
array('VEN.venue_name AS Venue_Name'=>'Venue Name',
'VEN.venue_details AS Venue_Details'=>'Venue Details',
'REG.name AS Region'=>'Region',
'VEN.location AS Location'=>'Location'
)
)
);
$baseHtml = '<tr>{:baseHtml}</tr>';
$ottrHtml = '<td><div class="box-body" style="padding-left: 100px">
<label>
<input type="checkbox" id="table_{:table}" table="{:table}" onclick="checkChild($(this));" >
{:table_name}
</label>
{:innerHtml}
</div></td>';
$innerHtml = '<div class="form-group"><div class="col-sm-10"><div class="checkbox">
<label>
<input type="checkbox" name="{:field_alias}" id="table_{:table}_{:field_alias}" value="{:field_alias}">
{:field_name}
</label>
</div></div></div>';
$htmlArr = array();
$allFields = array();
foreach($tables AS $table => $tableDetails){
$fieldsHtml = '';
foreach ($tableDetails['fields'] as $alias => $field) {
$allFields[] = $alias;
$fieldsHtml .= str_replace(array('{:field_alias}','{:field_name}'),
array($alias,$field), $innerHtml);
}
$fieldsHtml = str_replace('{:table}',$table,$fieldsHtml);
$html .= str_replace(array('{:table}','{:table_name}','{:innerHtml}'),
array($table,$tableDetails['name'],$fieldsHtml,), $ottrHtml);
if($count == 2){
$rowFlg = 1; $count = 0;
$htmlArr[] = str_replace('{:baseHtml}',$html,$baseHtml);
$html = '';
}else{
$count+=1;
}
}
if($rowFlg == 0){
$html = str_replace('{:baseHtml}',$html,$baseHtml);
}else{
$lstRw = str_replace('{:baseHtml}',$html,$baseHtml);
$html = implode('', $htmlArr);
$html .= $lstRw;
}
echo $html;
?>
</tbody>
</table>
</form>
</div>
<div class="col-md-12">
<div class="box-footer" >
<input type="hidden" id="all_fields" all_fields="<?= implode(',',$allFields) ?>">
<button id="rGenerate" type="submit" action="view" dmclick="0" class="btn btn-primary">
View Report
</button>
<button id="rGenerate" type="submit" action="export" dmclick="0" class="btn btn-info">
Export Report
</button>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-12">
<div class="box box-warning hide" id="report_table_html">
<div class="box-body">
<div class="col-md-12">
<table id="report_table" class="table table-bordered table-striped datatable">
<thead>
<tr>
<th width="60px;">Book ID</th>
<th width="120px;">Event</th>
<th width="120px;">Customer Name</th>
<th width="80px;">Amount</th>
<th width="100px;">Show Time</th>
<th width="50px;">Status</th>
<th width="50px;">Action</th>
</tr>
</thead>
<tbody id="report_table_body">
<!-- REPORT TABLE BODY -->
</tbody>
</table>
</div>
</div>
</div>
</div>
</section>
</div>
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery('[name^="BOK.bookId"],[name^="CONCAT(EDT.date,\' \',EDT.time)"],[name^="BOK.amount"],[name^="BOK.status"],[name^="EVT.event_name_en"],[name^="CUST.name"]').prop("checked", true).parent().closest('div').addClass('disable-block');
});
</script>
\ No newline at end of file
...@@ -100,6 +100,17 @@ ...@@ -100,6 +100,17 @@
</div> </div>
</div> </div>
</div> </div>
<div class="col-md-12">
<div class="col-md-5">
<div class="form-group">
<label>Phone Code</label>
<input type="text" class="form-control required" data-parsley-trigger="change"
data-parsley-minlength="2" data-parsley-pattern="^[0-9]+$"
name="phone_code" required="" value="<?= (isset($countryData->phone_code))?$countryData->phone_code:'' ?>"placeholder="Phone Code">
<span class="glyphicon form-control-feedback"></span>
</div>
</div>
</div>
<div class="col-md-12"> <div class="col-md-12">
<div class="box-footer textCenterAlign"> <div class="box-footer textCenterAlign">
<button type="submit" class="btn btn-primary">Submit</button> <button type="submit" class="btn btn-primary">Submit</button>
......
<div class="content-wrapper" >
<section class="content-header">
<h1>
<?= $pTitle ?>
<small><?= $pDescription ?></small>
</h1>
<ol class="breadcrumb">
<li><a href="<?= base_url() ?>"><i class="fa fa-star-o" aria-hidden="true"></i>Home</a></li>
<li><?= $menu ?></li>
<li class="active"><?= $smenu ?></li>
</ol>
</section>
<!-- Main content -->
<section class="content">
<div class="row">
<div class="col-md-12">
<?php if($this->session->flashdata('message')) {
$flashdata = $this->session->flashdata('message'); ?>
<div class="alert alert-<?= $flashdata['class'] ?>">
<button class="close" data-dismiss="alert" type="button">×</button>
<?= $flashdata['message'] ?>
</div>
<?php } ?>
</div>
<div class="col-xs-12">
<div class="box box-warning marginBottom-10">
<div class="box-body">
<form role="form" action="<?= base_url('Customer_Booking') ?>" method="post"
class="validate" data-parsley-validate="" enctype="multipart/form-data">
<div class="col-md-6">
<div class="form-group">
<label>Customer Name, Email or Phone</label>
<div>
<input class="form-control" id="custSearch" placeholder="Enter Customer Details">
<input type="hidden" name="user_id">
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Customer Name, Email or Phone</label>
<div>
<input type="text" placeholder="Enter Booking ID" name="booking_id" data-parsley-minlength="12" class="form-control" data-parsley-pattern="^[a-zA-Z0-9]+$" data-parsley-maxlength="12">
</div>
</div>
</div>
<div class="col-md-12">
<button class="float-right">Get Booking Details</button>
</div>
</form>
</div>
</div>
<?php if(isset($bookData) && isset($custData)){ ?>
<?php if(empty($bookData) && empty($custData)){ ?>
<div class="box box-warning">
<div class="box-header with-border">
<div class="col-md-12 textCenterAlign">No Data Found</div>
</div>
</div>
<?php } else { ?>
<?php if (!empty($custData)) { ?>
<div class="box box-warning">
<div class="box-header with-border">
<div class="col-md-6"><h3 class="box-title">Customer Details</h3></div>
</div>
<div class="box-body">
<div class="col-md-12">
<div class="col-md-2">
<div class="form-group has-feedback">
<img src="<?= base_url($custData->profile_image) ?>" class="cpoint"
onclick="viewImageModal('Profile Image','<?= base_url($custData->profile_image) ?>');"
onerror="this.src='<?=base_url("assets/images/user_avatar.jpg")?>';" height="100" width="100" />
</div>
</div>
<div class="col-md-5">
<div class="row">
<div class="col-md-3"><span>Name </span></div>
<div class="col-md-7"><span>:</span>
<label class="padLeft20"><?= $custData->name ?></label>
</div>
</div>
<div class="row">
<div class="col-md-3"><span>Email </span></div>
<div class="col-md-7"><span>:</span>
<label class="padLeft20"><?= $custData->email ?></label>
</div>
</div>
<div class="row">
<div class="col-md-3"><span>Phone </span></div>
<div class="col-md-7"><span>:</span>
<label class="padLeft20"><?= $custData->phone ?></label>
</div>
</div>
<div class="row">
<div class="col-md-3"><span>DOB </span></div>
<div class="col-md-7"><span>:</span>
<label class="padLeft20"><?= $custData->dob ?></label>
</div>
</div>
</div>
</div>
</div>
</div>
<?php } ?>
<?php if (!empty($bookData)) { ?>
<div class="box box-warning">
<div class="box-header with-border">
<div class="col-md-6"><h3 class="box-title">Booking Details</h3></div>
</div>
<div class="box-body">
<table id="mechanicUsers" class="table table-bordered table-striped datatable ">
<thead>
<tr>
<th class="hidden">ID</th>
<th width="50px;">Book ID</th>
<th width="100px;">Event</th>
<th width="130px;">Event Name</th>
<th width="130px;">Customer</th>
<th width="130px;">Scheduled On</th>
<th width="50px;">Amount</th>
<th width="50px;">Status</th>
<th width="40px;">Action</th>
</tr>
</thead>
<tbody>
<?php foreach($bookData as $booking) { ?>
<tr>
<th class="hidden"><?= $booking->booking_id ?></th>
<th class="center"><?= $booking->bookId ?></th>
<th class="center"><?= $booking->category_name_EN ?></th>
<th class="center"><?= $booking->event_name_EN ?></th>
<th class="center"><?= $booking->customer_name ?></th>
<th class="center"><?= $booking->date.' '.$booking->time ?></th>
<th class="center"><?= $booking->amount ?></th>
<th class="center">
<?php
switch($booking->book_status){
case 0: echo 'Cancelled'; break;
case 1: echo 'Booked'; break;
case 2: echo 'Completed'; break;
case 3: echo 'Pending'; break;
case 4: echo 'Deleted'; break;
case 5: echo 'Payment Failed'; break;
}
?>
</th>
<td class="center">
<a class="btn btn-sm btn-info" id="viewBooking" booking_id="<?= encode_param($booking->booking_id) ?>">
<i class="fa fa-fw fa-eye"></i>View
</a>
</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
<?php } ?>
<?php } ?>
<?php } ?>
</div>
</div>
</section>
</div>
\ No newline at end of file
...@@ -228,10 +228,21 @@ ...@@ -228,10 +228,21 @@
data-parsley-minlength="2" name="max_booking" value="14" data-parsley-minlength="2" name="max_booking" value="14"
placeholder="Maximum Seat Can Book Per Transaction (Default 14)"> placeholder="Maximum Seat Can Book Per Transaction (Default 14)">
</div> </div>
<div class="form-group"> <div class="row">
<label>Payment Mode</label><br> <div class="col-md-5">
<input type="checkbox" name="has_payment" value="1" checked> <div class="form-group">
<p style="display:-webkit-inline-box;padding-left: 15px;">Enable Payment</p> <label>Payment Mode</label><br>
<input type="checkbox" name="has_payment" value="1" checked>
<p style="display:-webkit-inline-box;padding-left: 15px;">Enable Payment</p>
</div>
</div>
<div class="col-md-7">
<div class="form-group">
<label>Booking Approval</label><br>
<input type="checkbox" name="approve_booking" value="1">
<p style="display:-webkit-inline-box;padding-left: 15px;">Enable Booking Approval</p>
</div>
</div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label>Event Images</label> <label>Event Images</label>
......
...@@ -229,14 +229,25 @@ ...@@ -229,14 +229,25 @@
<div class="form-group"> <div class="form-group">
<label>Maximum Seat Booking</label> <label>Maximum Seat Booking</label>
<input type="text" class="form-control" data-parsley-trigger="change" <input type="text" class="form-control" data-parsley-trigger="change"
data-parsley-minlength="2" name="max_booking" value="14" data-parsley-minlength="2" name="max_booking" placeholder="Maximum Seat Can Book Per Transaction (Default 14)" value="<?= $event_data->max_booking ?>">
placeholder="Maximum Seat Can Book Per Transaction (Default 14)"
value="<?= $event_data->max_booking ?>">
</div> </div>
<div class="form-group"> <div class="row">
<label>Payment Mode</label><br> <div class="col-md-5">
<input type="checkbox" name="has_payment" value="1" <?= ($event_data->has_payment == 1)?'checked':'' ?>> <div class="form-group">
<p style="display:-webkit-inline-box;padding-left: 15px;">Enable Payment</p> <label>Payment Mode</label><br>
<input type="checkbox" <?= ($event_data->has_payment == 1)?'checked':'' ?>
name="has_payment" value="1" >
<p style="display:-webkit-inline-box;padding-left: 15px;">Enable Payment</p>
</div>
</div>
<div class="col-md-7">
<div class="form-group">
<label>Booking Approval</label><br>
<input type="checkbox" <?= ($event_data->approve_booking==1)?'checked':'' ?>
name="approve_booking" value="1" >
<p style="display:-webkit-inline-box;padding-left: 15px;">Enable Booking Approval</p>
</div>
</div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label>Event Images</label> <label>Event Images</label>
......
<?php
$language = getLanguages();
?>
<div class="content-wrapper">
<section class="content-header">
<h1>
<?= $pTitle ?>
<small><?= $pDescription ?></small>
</h1>
<ol class="breadcrumb">
<li><a href="<?= base_url() ?>"><i class="fa fa-star-o" aria-hidden="true"></i>Home</a></li>
<li><?= $menu ?></li>
<li class="active"><?= $smenu ?></li>
</ol>
</section>
<section class="content">
<div class="row">
<div class="col-md-12">
<?php
$url = (!isset($hotel_city_id)||empty($hotel_city_id))
?'HotelCity/createHotelCity':'HotelCity/updateHotelCity/'.$hotel_city_id;
if($this->session->flashdata('message')) {
$flashdata = $this->session->flashdata('message'); ?>
<div class="alert alert-<?= $flashdata['class'] ?>">
<button class="close" data-dismiss="alert" type="button">×</button>
<?= $flashdata['message'] ?>
</div>
<?php } ?>
</div>
<div class="col-md-12">
<div class="box box-warning">
<div class="box-body">
<form role="form" action="<?= base_url($url) ?>" method="post"
class="validate" data-parsley-validate="" enctype="multipart/form-data">
<div class="col-md-6">
<div class="form-group">
<label>Hotel City Name</label>
<?php foreach($language AS $lang) {
$hotel_city_name = (isset($hotelCityData->{'hotel_city_name_'.$lang}))?$hotelCityData->{'hotel_city_name_'.$lang}:'' ?>
<div class="row">
<div class="col-md-12">
<input type="text" class="form-control <?= ($lang == 'EN')?'required':'' ?>"
name="hotel_city_name_<?= $lang ?>" data-parsley-trigger="change" data-parsley-minlength="2" placeholder="Hotel City Name (<?= $lang ?>)" value="<?= $hotel_city_name ?>">
<span class="glyphicon form-control-feedback"></span>
</div>
</div>
<br>
<?php } ?>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Hotel City Icon</label>
<div class="col-md-12" style="padding-bottom:10px;">
<div class="col-md-3">
<img id="image_id" src="<?= (isset($hotelCityData->hotel_city_icon))?base_url($hotelCityData->hotel_city_icon):'' ?>" onerror="this.src='<?=base_url("assets/images/no_image_text.png")?>';" height="75" width="75" />
</div>
<div class="col-md-9" style="padding-top: 25px;">
<input name="hotel_city_icon"
class="<?= (!isset($hotelCityData->hotel_city_icon) || empty(isset($hotelCityData->hotel_city_icon)))?'required':'' ?>" type="file" accept="image/*" onchange="setImg(this,'image_id');" />
</div>
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Country</label>
<div class="row">
<div class="col-md-12">
<input type="text" class="form-control" name="country"
data-parsley-trigger="change" data-parsley-minlength="2"
placeholder="Country Name" value="<?= (isset($hotelCityData->country))?$hotelCityData->country:'' ?>">
<span class="glyphicon form-control-feedback"></span>
</div>
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Country Code</label>
<div class="row">
<div class="col-md-12">
<input type="text" class="form-control" name="country_code"
data-parsley-trigger="change" data-parsley-minlength="2"
placeholder="Country Code" value="<?= (isset($hotelCityData->country_code))?$hotelCityData->country_code:'' ?>">
<span class="glyphicon form-control-feedback"></span>
</div>
</div>
</div>
</div>
<div class="col-md-12">
<div class="box-footer textCenterAlign">
<button type="submit" class="btn btn-primary">Submit</button>
<a href="<?= base_url('HotelCity/listHotelCity') ?>" class="btn btn-primary">Cancel</a>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</section>
</div>
\ No newline at end of file
<?php
$role = roleManagement();
$pAccess = $role['City'];
?>
<div class="content-wrapper" >
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
<?= $pTitle ?>
<small><?= $pDescription ?></small>
</h1>
<ol class="breadcrumb">
<li><a href="<?= base_url() ?>"><i class="fa fa-star-o" aria-hidden="true"></i>Home</a></li>
<li><?= $menu ?></li>
<li class="active"><?= $smenu ?></li>
</ol>
</section>
<!-- Main content -->
<section class="content">
<div class="row">
<div class="col-md-12">
<?php if($this->session->flashdata('message')) {
$flashdata = $this->session->flashdata('message'); ?>
<div class="alert alert-<?= $flashdata['class'] ?>">
<button class="close" data-dismiss="alert" type="button">×</button>
<?= $flashdata['message'] ?>
</div>
<?php } ?>
</div>
<div class="col-xs-12">
<div class="box box-warning">
<div class="box-header with-border">
<div class="col-md-6"><h3 class="box-title">Hotel City List</h3></div>
<div class="col-md-6" align="right">
<?php if(in_array('1',$pAccess)){ ?>
<a class="btn btn-sm btn-primary" href="<?= base_url('HotelCity/addHotelCity') ?>">
Add New Hotel City
</a>
<?php } ?>
<a class="btn btn-sm btn-primary" href="<?= base_url() ?>">Back</a>
</div>
</div>
<div class="box-body">
<table id="mechanicUsers" class="table table-bordered table-striped datatable ">
<thead>
<tr>
<th class="hidden">ID</th>
<th width="50px;">Icon</th>
<th width="125px;">Hotel City (English)</th>
<th width="125px;">Country</th>
<th width="100px;">Status</th>
<?php if(in_array('2',$pAccess)||in_array('3',$pAccess)||in_array('4',$pAccess)){?>
<th width="200px;">Action</th>
<?php } ?>
</tr>
</thead>
<tbody>
<?php
if(!empty($hotelCityData)){
foreach($hotelCityData as $hotelCity) { ?>
<tr>
<th class="hidden"><?= $hotelCity->hotel_city_id ?></th>
<th class="center textCenterAlign">
<img id="image_id" src="<?= base_url($hotelCity->hotel_city_icon) ?>"
onerror="this.src='<?=base_url("assets/images/no_image_text.png")?>';"
height="50" width="50" />
</th>
<th class="center"><?= (isset($hotelCity->hotel_city_name_EN))?$hotelCity->hotel_city_name_EN:'' ?></th>
<th class="center">
<?php
echo (isset($hotelCity->country))?$hotelCity->country:'';
echo (isset($hotelCity->country_code))?' ('.$hotelCity->country_code.')':'';
?>
</th>
<th class="center" id="statusFlag_<?= $hotelCity->hotel_city_id ?>">
<?= ($hotelCity->status == 1)?'Active':'De-activate' ?>
</th>
<?php if(in_array('2',$pAccess)||in_array('3',$pAccess)||in_array('4',$pAccess)){?>
<td class="center">
<?php if(in_array('2',$pAccess)){ ?>
<a class="btn btn-sm btn-primary"
href="<?= base_url('HotelCity/editHotelCity/'.encode_param($hotelCity->hotel_city_id))?>">
<i class="fa fa-fw fa-edit"></i>Edit
</a>
<?php } ?>
<?php if(in_array('3',$pAccess)){ ?>
<a class="btn btn-sm btn-danger" onclick="confirmDelete(jQuery(this),'HotelCity/changeStatus',{'hotel_city_id':'<?=encode_param($hotelCity->hotel_city_id)?>'})"
status="2"><i class="fa fa-fw fa-trash"></i>Delete
</a>
<?php } ?>
<?php if(in_array('4',$pAccess)){
$status = 0; $btnName = 'De-activate'; $btnClass = 'btn-warning';
if($hotelCity->status != 1){
$status = 1; $btnName = 'Activate'; $btnClass = 'btn-success';
} ?>
<a class="btn btn-sm <?= $btnClass ?>" onclick="updateStatus(jQuery(this),'HotelCity/changeStatus',{'hotel_city_id':'<?= encode_param($hotelCity->hotel_city_id) ?>'})"
status="<?= $status ?>" status_id="<?= $hotelCity->hotel_city_id ?>">
<i class="fa fa-cog"><?= $btnName ?></i>
</a>
<?php } ?>
</td>
<?php } ?>
</tr>
<?php } } ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</section>
</div>
\ No newline at end of file
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
<label>Promo Valid From</label> <label>Promo Valid From</label>
<input id="date" type="text" class="form-control required" required autocomplete="off" <input id="date" type="text" class="form-control required" required autocomplete="off"
data-parsley-trigger="change" name="start_date" placeholder="Promo Valid From" data-parsley-trigger="change" name="start_date" placeholder="Promo Valid From"
value="<?= (isset($promo->start_date))?$promo->start_date:'' ?>"> value="<?= (isset($promo->start_date))?date('m/d/Y',strtotime($promo->start_date)):'' ?>">
<div class="input-group-addon"style="padding-top:29px;border-color:#ffffff!important;"> <div class="input-group-addon"style="padding-top:29px;border-color:#ffffff!important;">
<i class="fa fa-calendar"></i> <i class="fa fa-calendar"></i>
</div> </div>
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
<label>Promo Valid To</label> <label>Promo Valid To</label>
<input id="date" type="text" class="form-control required" required autocomplete="off" <input id="date" type="text" class="form-control required" required autocomplete="off"
data-parsley-trigger="change" name="end_date" placeholder="Promo Valid To" data-parsley-trigger="change" name="end_date" placeholder="Promo Valid To"
value="<?= (isset($promo->end_date))?$promo->end_date:'' ?>"> value="<?= (isset($promo->end_date))?date('m/d/Y',strtotime($promo->end_date)):'' ?>">
<div class="input-group-addon"style="padding-top:29px;border-color:#ffffff!important;"> <div class="input-group-addon"style="padding-top:29px;border-color:#ffffff!important;">
<i class="fa fa-calendar"></i> <i class="fa fa-calendar"></i>
</div> </div>
......
...@@ -62,6 +62,11 @@ ...@@ -62,6 +62,11 @@
<label>Admin Email-ID</label> <label>Admin Email-ID</label>
<input type="email" name="admin_mail_id" class="form-control required" placeholder="Admin Email-ID" value="<?= $data['admin_mail_id'] ?>"> <input type="email" name="admin_mail_id" class="form-control required" placeholder="Admin Email-ID" value="<?= $data['admin_mail_id'] ?>">
</div> </div>
<div class="form-group col-xs-6">
<label>Web Base URL</label>
<input type="text" name="web_base_url" class="form-control required"
placeholder="Web Base URL" value="<?= $data['web_base_url'] ?>">
</div>
</div> </div>
<div class="form-group col-xs-5"> <div class="form-group col-xs-5">
<div class="form-group"> <div class="form-group">
......
...@@ -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") ?>">
......
/*! jQuery UI - v1.10.1 - 2013-02-15
* http://jqueryui.com
* Includes: jquery.ui.core.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css
* Copyright (c) 2013 jQuery Foundation and other contributors Licensed MIT */
.ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-clearfix{min-height:0}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-accordion .ui-accordion-header{display:block;cursor:pointer;position:relative;margin-top:2px;padding:.5em .5em .5em .7em;min-height:0}.ui-accordion .ui-accordion-icons{padding-left:2.2em}.ui-accordion .ui-accordion-noicons{padding-left:.7em}.ui-accordion .ui-accordion-icons .ui-accordion-icons{padding-left:2.2em}.ui-accordion .ui-accordion-header .ui-accordion-header-icon{position:absolute;left:.5em;top:50%;margin-top:-8px}.ui-accordion .ui-accordion-content{padding:1em 2.2em;border-top:0;overflow:auto}.ui-autocomplete{position:absolute;top:0;left:0;cursor:default}.ui-button{display:inline-block;position:relative;padding:0;line-height:normal;margin-right:.1em;cursor:pointer;vertical-align:middle;text-align:center;overflow:visible}.ui-button,.ui-button:link,.ui-button:visited,.ui-button:hover,.ui-button:active{text-decoration:none}.ui-button-icon-only{width:2.2em}button.ui-button-icon-only{width:2.4em}.ui-button-icons-only{width:3.4em}button.ui-button-icons-only{width:3.7em}.ui-button .ui-button-text{display:block;line-height:normal}.ui-button-text-only .ui-button-text{padding:.4em 1em}.ui-button-icon-only .ui-button-text,.ui-button-icons-only .ui-button-text{padding:.4em;text-indent:-9999999px}.ui-button-text-icon-primary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 1em .4em 2.1em}.ui-button-text-icon-secondary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 2.1em .4em 1em}.ui-button-text-icons .ui-button-text{padding-left:2.1em;padding-right:2.1em}input.ui-button{padding:.4em 1em}.ui-button-icon-only .ui-icon,.ui-button-text-icon-primary .ui-icon,.ui-button-text-icon-secondary .ui-icon,.ui-button-text-icons .ui-icon,.ui-button-icons-only .ui-icon{position:absolute;top:50%;margin-top:-8px}.ui-button-icon-only .ui-icon{left:50%;margin-left:-8px}.ui-button-text-icon-primary .ui-button-icon-primary,.ui-button-text-icons .ui-button-icon-primary,.ui-button-icons-only .ui-button-icon-primary{left:.5em}.ui-button-text-icon-secondary .ui-button-icon-secondary,.ui-button-text-icons .ui-button-icon-secondary,.ui-button-icons-only .ui-button-icon-secondary{right:.5em}.ui-buttonset{margin-right:7px}.ui-buttonset .ui-button{margin-left:0;margin-right:-.3em}input.ui-button::-moz-focus-inner,button.ui-button::-moz-focus-inner{border:0;padding:0}.ui-datepicker{width:17em;padding:.2em .2em 0;display:none}.ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0}.ui-datepicker .ui-datepicker-prev,.ui-datepicker .ui-datepicker-next{position:absolute;top:2px;width:1.8em;height:1.8em}.ui-datepicker .ui-datepicker-prev-hover,.ui-datepicker .ui-datepicker-next-hover{top:1px}.ui-datepicker .ui-datepicker-prev{left:2px}.ui-datepicker .ui-datepicker-next{right:2px}.ui-datepicker .ui-datepicker-prev-hover{left:1px}.ui-datepicker .ui-datepicker-next-hover{right:1px}.ui-datepicker .ui-datepicker-prev span,.ui-datepicker .ui-datepicker-next span{display:block;position:absolute;left:50%;margin-left:-8px;top:50%;margin-top:-8px}.ui-datepicker .ui-datepicker-title{margin:0 2.3em;line-height:1.8em;text-align:center}.ui-datepicker .ui-datepicker-title select{font-size:1em;margin:1px 0}.ui-datepicker select.ui-datepicker-month-year{width:100%}.ui-datepicker select.ui-datepicker-month,.ui-datepicker select.ui-datepicker-year{width:49%}.ui-datepicker table{width:100%;font-size:.9em;border-collapse:collapse;margin:0 0 .4em}.ui-datepicker th{padding:.7em .3em;text-align:center;font-weight:bold;border:0}.ui-datepicker td{border:0;padding:1px}.ui-datepicker td span,.ui-datepicker td a{display:block;padding:.2em;text-align:right;text-decoration:none}.ui-datepicker .ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0 0;padding:0 .2em;border-left:0;border-right:0;border-bottom:0}.ui-datepicker .ui-datepicker-buttonpane button{float:right;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em .6em;width:auto;overflow:visible}.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left}.ui-datepicker.ui-datepicker-multi{width:auto}.ui-datepicker-multi .ui-datepicker-group{float:left}.ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}.ui-datepicker-multi-2 .ui-datepicker-group{width:50%}.ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}.ui-datepicker-multi-4 .ui-datepicker-group{width:25%}.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:0}.ui-datepicker-multi .ui-datepicker-buttonpane{clear:left}.ui-datepicker-row-break{clear:both;width:100%;font-size:0}.ui-datepicker-rtl{direction:rtl}.ui-datepicker-rtl .ui-datepicker-prev{right:2px;left:auto}.ui-datepicker-rtl .ui-datepicker-next{left:2px;right:auto}.ui-datepicker-rtl .ui-datepicker-prev:hover{right:1px;left:auto}.ui-datepicker-rtl .ui-datepicker-next:hover{left:1px;right:auto}.ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right}.ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left}.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,.ui-datepicker-rtl .ui-datepicker-group{float:right}.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0;border-left-width:1px}.ui-dialog{position:absolute;top:0;left:0;padding:.2em;outline:0}.ui-dialog .ui-dialog-titlebar{padding:.4em 1em;position:relative}.ui-dialog .ui-dialog-title{float:left;margin:.1em 0;white-space:nowrap;width:90%;overflow:hidden;text-overflow:ellipsis}.ui-dialog .ui-dialog-titlebar-close{position:absolute;right:.3em;top:50%;width:21px;margin:-10px 0 0 0;padding:1px;height:20px}.ui-dialog .ui-dialog-content{position:relative;border:0;padding:.5em 1em;background:none;overflow:auto}.ui-dialog .ui-dialog-buttonpane{text-align:left;border-width:1px 0 0 0;background-image:none;margin-top:.5em;padding:.3em 1em .5em .4em}.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset{float:right}.ui-dialog .ui-dialog-buttonpane button{margin:.5em .4em .5em 0;cursor:pointer}.ui-dialog .ui-resizable-se{width:12px;height:12px;right:-5px;bottom:-5px;background-position:16px 16px}.ui-draggable .ui-dialog-titlebar{cursor:move}.ui-menu{list-style:none;padding:2px;margin:0;display:block;outline:none}.ui-menu .ui-menu{margin-top:-3px;position:absolute}.ui-menu .ui-menu-item{margin:0;padding:0;width:100%}.ui-menu .ui-menu-divider{margin:5px -2px 5px -2px;height:0;font-size:0;line-height:0;border-width:1px 0 0 0}.ui-menu .ui-menu-item a{text-decoration:none;display:block;padding:2px .4em;line-height:1.5;min-height:0;font-weight:normal}.ui-menu .ui-menu-item a.ui-state-focus,.ui-menu .ui-menu-item a.ui-state-active{font-weight:normal;margin:-1px}.ui-menu .ui-state-disabled{font-weight:normal;margin:.4em 0 .2em;line-height:1.5}.ui-menu .ui-state-disabled a{cursor:default}.ui-menu-icons{position:relative}.ui-menu-icons .ui-menu-item a{position:relative;padding-left:2em}.ui-menu .ui-icon{position:absolute;top:.2em;left:.2em}.ui-menu .ui-menu-icon{position:static;float:right}.ui-progressbar{height:2em;text-align:left;overflow:hidden}.ui-progressbar .ui-progressbar-value{margin:-1px;height:100%}.ui-progressbar .ui-progressbar-overlay{background:url("images/animated-overlay.gif");height:100%;filter:alpha(opacity=25);opacity:0.25}.ui-progressbar-indeterminate .ui-progressbar-value{background-image:none}.ui-resizable{position:relative}.ui-resizable-handle{position:absolute;font-size:0.1px;display:block}.ui-resizable-disabled .ui-resizable-handle,.ui-resizable-autohide .ui-resizable-handle{display:none}.ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;left:0}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0}.ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%}.ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%}.ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px}.ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px}.ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px}.ui-selectable-helper{position:absolute;z-index:100;border:1px dotted black}.ui-slider{position:relative;text-align:left}.ui-slider .ui-slider-handle{position:absolute;z-index:2;width:1.2em;height:1.2em;cursor:default}.ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;background-position:0 0}.ui-slider.ui-state-disabled .ui-slider-handle,.ui-slider.ui-state-disabled .ui-slider-range{filter:inherit}.ui-slider-horizontal{height:.8em}.ui-slider-horizontal .ui-slider-handle{top:-.3em;margin-left:-.6em}.ui-slider-horizontal .ui-slider-range{top:0;height:100%}.ui-slider-horizontal .ui-slider-range-min{left:0}.ui-slider-horizontal .ui-slider-range-max{right:0}.ui-slider-vertical{width:.8em;height:100px}.ui-slider-vertical .ui-slider-handle{left:-.3em;margin-left:0;margin-bottom:-.6em}.ui-slider-vertical .ui-slider-range{left:0;width:100%}.ui-slider-vertical .ui-slider-range-min{bottom:0}.ui-slider-vertical .ui-slider-range-max{top:0}.ui-spinner{position:relative;display:inline-block;overflow:hidden;padding:0;vertical-align:middle}.ui-spinner-input{border:none;background:none;color:inherit;padding:0;margin:.2em 0;vertical-align:middle;margin-left:.4em;margin-right:22px}.ui-spinner-button{width:16px;height:50%;font-size:.5em;padding:0;margin:0;text-align:center;position:absolute;cursor:default;display:block;overflow:hidden;right:0}.ui-spinner a.ui-spinner-button{border-top:none;border-bottom:none;border-right:none}.ui-spinner .ui-icon{position:absolute;margin-top:-8px;top:50%;left:0}.ui-spinner-up{top:0}.ui-spinner-down{bottom:0}.ui-spinner .ui-icon-triangle-1-s{background-position:-65px -16px}.ui-tabs{position:relative;padding:.2em}.ui-tabs .ui-tabs-nav{margin:0;padding:.2em .2em 0}.ui-tabs .ui-tabs-nav li{list-style:none;float:left;position:relative;top:0;margin:1px .2em 0 0;border-bottom:0;padding:0;white-space:nowrap}.ui-tabs .ui-tabs-nav li a{float:left;padding:.5em 1em;text-decoration:none}.ui-tabs .ui-tabs-nav li.ui-tabs-active{margin-bottom:-1px;padding-bottom:1px}.ui-tabs .ui-tabs-nav li.ui-tabs-active a,.ui-tabs .ui-tabs-nav li.ui-state-disabled a,.ui-tabs .ui-tabs-nav li.ui-tabs-loading a{cursor:text}.ui-tabs .ui-tabs-nav li a,.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active a{cursor:pointer}.ui-tabs .ui-tabs-panel{display:block;border-width:0;padding:1em 1.4em;background:none}.ui-tooltip{padding:8px;position:absolute;z-index:9999;max-width:300px;-webkit-box-shadow:0 0 5px #aaa;box-shadow:0 0 5px #aaa}body .ui-tooltip{border-width:2px}/*! jQuery UI - v1.10.1 - 2013-02-15
* http://jqueryui.com
* Includes: jquery.ui.theme.css
* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */
.ui-widget{font-family:Verdana,Arial,sans-serif;font-size:1.1em}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Verdana,Arial,sans-serif;font-size:1em}.ui-widget-content{border:1px solid #aaa;background:#fff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x;color:#222}.ui-widget-content a{color:#222}.ui-widget-header{border:1px solid #aaa;background:#ccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x;color:#222;font-weight:bold}.ui-widget-header a{color:#222}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default{border:1px solid #d3d3d3;background:#e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x;font-weight:normal;color:#555}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited{color:#555;text-decoration:none}.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus{border:1px solid #999;background:#dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x;font-weight:normal;color:#212121}.ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited{color:#212121;text-decoration:none}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active{border:1px solid #aaa;background:#fff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x;font-weight:normal;color:#212121}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#212121;text-decoration:none}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #fcefa1;background:#fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x;color:#363636}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#363636}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #cd0a0a;background:#fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x;color:#cd0a0a}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#cd0a0a}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#cd0a0a}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:bold}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:normal}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}.ui-state-disabled .ui-icon{filter:Alpha(Opacity=35)}.ui-icon{width:16px;height:16px;background-position:16px 16px}.ui-icon,.ui-widget-content .ui-icon{background-image:url(images/ui-icons_222222_256x240.png)}.ui-widget-header .ui-icon{background-image:url(images/ui-icons_222222_256x240.png)}.ui-state-default .ui-icon{background-image:url(images/ui-icons_888888_256x240.png)}.ui-state-hover .ui-icon,.ui-state-focus .ui-icon{background-image:url(images/ui-icons_454545_256x240.png)}.ui-state-active .ui-icon{background-image:url(images/ui-icons_454545_256x240.png)}.ui-state-highlight .ui-icon{background-image:url(images/ui-icons_2e83ff_256x240.png)}.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url(images/ui-icons_cd0a0a_256x240.png)}.ui-icon-carat-1-n{background-position:0 0}.ui-icon-carat-1-ne{background-position:-16px 0}.ui-icon-carat-1-e{background-position:-32px 0}.ui-icon-carat-1-se{background-position:-48px 0}.ui-icon-carat-1-s{background-position:-64px 0}.ui-icon-carat-1-sw{background-position:-80px 0}.ui-icon-carat-1-w{background-position:-96px 0}.ui-icon-carat-1-nw{background-position:-112px 0}.ui-icon-carat-2-n-s{background-position:-128px 0}.ui-icon-carat-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-64px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-64px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:0 -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:0 -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:0 -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-on{background-position:-96px -144px}.ui-icon-radio-off{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:0 -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-seek-first{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:0 -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{border-top-left-radius:4px}.ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{border-top-right-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{border-bottom-left-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{border-bottom-right-radius:4px}.ui-widget-overlay{background:#aaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30)}.ui-widget-shadow{margin:-8px 0 0 -8px;padding:8px;background:#aaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30);border-radius:8px}
\ No newline at end of file
...@@ -603,7 +603,7 @@ function viewBooking(booking_id){ ...@@ -603,7 +603,7 @@ function viewBooking(booking_id){
jQuery.ajax({ jQuery.ajax({
url : base_url+"Booking/getBookingData", url : base_url+"Booking/getBookingData",
type : 'POST', type : 'POST',
data : {'booking_id':booking_id,'view_all':'0,1,2,3,4,5'}, data : {'booking_id':booking_id,'view_all':'0,1,2,3,4,5,6'},
success: function(resp){ success: function(resp){
if(resp == '' || resp == undefined || resp == 'undefined' || resp == null || resp == 'null'){ if(resp == '' || resp == undefined || resp == 'undefined' || resp == null || resp == 'null'){
remModalLoader(); remModalLoader();
...@@ -933,8 +933,22 @@ function setPromoStatus(elmId,data){ ...@@ -933,8 +933,22 @@ function setPromoStatus(elmId,data){
jQuery('[id="statusFlag_'+elmId+'"]').html(data['c_status']); jQuery('[id="statusFlag_'+elmId+'"]').html(data['c_status']);
} }
function updateBokApproved(elmId,data){
if(data==undefined || data=='undefined' || data==null || data=='null' || data=='' ||
elmId==undefined || elmId=='undefined' || elmId==null || elmId=='null' || elmId==''){
return false;
}
jQuery('[id="bookingStatus_'+elmId+'"]').html('Booked');
console.log('[id="bookingStatus_'+elmId+'"]');
jQuery('[id="approveBooking_'+elmId+'"]').remove();
}
function confirmDelete(thisObj,fnName,params){ function confirmDelete(thisObj,fnName,params){
if(confirm("Are you sure to delete permanently?")){ var msg = "Are you sure to delete permanently ?";
if(params.alertMsg){
msg = params.alertMsg;
}
if(confirm(msg)){
updateStatus(thisObj,fnName,params,status); updateStatus(thisObj,fnName,params,status);
} }
} }
......
This source diff could not be displayed because it is too large. You can view the blob instead.
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