Commit f9008b14 by Tobin

dc

parent 90058168
......@@ -183,10 +183,10 @@ class Booking extends CI_Controller {
switch($data['trans_status']){
case 0: $reportData[$key]['Book_Status'] = 'Payment Failed'; break;
case 1: $reportData[$key]['Book_Status'] = 'Booked'; break;
case 2: $reportData[$key]['Book_Status'] = 'Pending'; break;
case 2: $reportData[$key]['Book_Status'] = 'Payment Processing'; break;
}
} else {
echo 'Booked';
$reportData[$key]['Book_Status'] = 'Booked'; break;
}
break;
case '2': $reportData[$key]['Book_Status'] = 'Completed'; break;
......
......@@ -418,8 +418,8 @@ class Api_model extends CI_Model {
if($user_id > 0) {
$res_count = $this->db->where('bookId',$data['bookingCode'])->get('booking')->num_rows();
if($res_count > 0) {
$rs = $this->db->where('bookId',$data['bookingCode'])->update('booking',array('status'=>1));
if($rs) {
// $rs = $this->db->where('bookId',$data['bookingCode'])->update('booking',array('status'=>1));
// if($rs) {
$result = $this->db->select('booking.id AS book_id,booking.event_id,booking.bookId AS bookingCode,booking.qrcode,booking.no_of_ticket,booking.amount,booking.status AS book_status,events.event_name,events.event_discription,event_gallery.media_url,venue.location,customer.name AS customer_name,customer.profile_image,venue.venue_name,venue.location_lat AS lat,venue.location_lng AS lng, booking.ticket_details,event_date_time.date,event_date_time.time')->where('booking.bookId',$data['bookingCode'])->from('booking')->join('events','booking.event_id = events.event_id')->join('event_date_time','booking.event_date_id = event_date_time.id')->join('venue', 'venue.id = events.venue_id')->join('event_gallery', 'events.event_id = event_gallery.event_id', 'LEFT')->join('customer','customer.customer_id = booking.customer_id')->get()->row();
if(count($result)>0){
......@@ -427,9 +427,9 @@ class Api_model extends CI_Model {
} else {
$res = array('status'=>0,'message'=>'Invalid booking code','code'=>'ER24');
}
} else {
$res = array('status'=>0,'message'=>'Confirm submission failed','code'=>'ER26');
}
// } else {
// $res = array('status'=>0,'message'=>'Confirm submission failed','code'=>'ER26');
// }
} else {
$res = array('status'=>0,'message'=>'Invalid booking code','code'=>'ER24');
}
......@@ -986,7 +986,17 @@ class Api_model extends CI_Model {
function update_payment($response,$transactionid,$last_id,$status){
try{
$this->db->update('transaction',array('transaction_id'=>$transactionid,'transaction_response'=>json_encode($response),'status'=>$status),array('id'=>$last_id));
$this->db->update('transaction',
array('transaction_id'=>$transactionid,
'transaction_response'=>json_encode($response),
'status'=>$status),
array('id'=>$last_id));
if($status == 1){
$trBook = $this->db->get_where('transaction',array('id'=>$last_id))->row_array();
$this->db->update('booking',array('status'=>'1'),
array('bookId'=>$trBook['booking_id']));
}
$res = array('status'=>1);
}catch(Exception $e){
$res = array('status'=>0,'message'=>'Ohh No!! Something went South!!','code'=>'ER06');
......@@ -1084,7 +1094,7 @@ class Api_model extends CI_Model {
$result = $this->db
->select('booking.id AS book_id,booking.bookId,customer.name AS customer_name,
booking.status,booking.no_of_ticket,booking.qrcode,
booking.ticket_details,booking.booking_date')
booking.ticket_details,event_date_time.date AS booking_date')
->where('booking.bookId',$data['qr_pin'])
->from('booking')
->join('events','booking.event_id = events.event_id')
......
......@@ -62,21 +62,21 @@ class Booking_model extends CI_Model {
if(!empty($where_cond['start_date']) && !empty($where_cond['end_date'])){
$where_clause .= (empty($where_clause))?' WHERE ':' AND ';
$end_date = strtotime(trim($where_cond['end_date']).' 12:00');
$start_date = strtotime(trim($where_cond['start_date']).' 12:00');
$end_date = date('Y-m-d',strtotime(trim($where_cond['end_date']).' 24:59'));
$start_date = date('Y-m-d',strtotime(trim($where_cond['start_date']).' 12:00'));
$where_clause .= " BOK.booking_date >= '".$start_date."' AND
BOK.booking_date <= '".$end_date."' ";
}
if(!empty($where_cond['start_date'])){
$where_clause .= (empty($where_clause))?' WHERE ':' AND ';
$start_date = strtotime(trim($where_cond['start_date']).' 12:00');
$start_date = date('Y-m-d',strtotime(trim($where_cond['start_date']).' 12:00'));
$where_clause .= " BOK.booking_date >= '".$start_date."' ";
}
if(!empty($where_cond['end_date'])){
$where_clause .= (empty($where_clause))?' WHERE ':' AND ';
$end_date = strtotime(trim($where_cond['end_date']).' 12:00');
$end_date = date('Y-m-d',strtotime(trim($where_cond['end_date']).' 23:59'));
$where_clause .= " BOK.booking_date <= '".$end_date."' ";
}
if(!empty($where_cond['status'])){
......@@ -96,12 +96,11 @@ class Booking_model extends CI_Model {
INNER JOIN host_categories AS HCAT ON (HCAT.host_cat_id=VEN.host_cat_id)
INNER JOIN event_date_time AS EDT ON (EDT.id=BOK.event_date_id)
INNER JOIN region AS REG ON (REG.id=VEN.region_id)
INNER JOIN provider AS PRV ON (PRV.provider_id=EVT.provider_id)
LEFT JOIN provider AS PRV ON (PRV.provider_id=EVT.provider_id)
LEFT JOIN transaction AS TRANS ON (TRANS.booking_id=BOK.bookId)
".$where_clause."
GROUP BY Booking_ID
ORDER BY BOK.id ASC";
$data = $this->db->query($sql);
if(!empty($data)){
$resData = $data->result_array();
......
......@@ -953,6 +953,7 @@ function event($data) {
$post_data['qrcode'] = genQRcode($post_data['bookId']);
$rs = $this->db->insert('booking', $post_data);
$id = $this->db->insert_id();
$post_data['booking_date'] = date('Y-m-d H:i:s');
if($id){
$res = array('status'=>1,'data'=>array('bookingCode'=>$post_data['bookId']));
} else {
......
......@@ -38,7 +38,7 @@
<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 Organizer</option>
<option value="">All Bookings</option>
<?php
if(!empty($providerData)){
foreach ($providerData as $provider) {
......@@ -77,13 +77,13 @@
</div>
<div class="col-md-3">
<div class="form-group ">
<label>Select Ride Status</label>
<label>Select Booking Status</label>
<div class="col-md-12">
<select name="status" class="form-control" data-parsley-trigger="change">
<option selected disabled>Select Ride Status</option>
<option selected disabled>Select Booking Status</option>
<option value="">All Bookings</option>
<?php
$status = array('2'=>'Completed','1'=>'Booked','3'=>'Pending','0'=>'Cancelled','4'=>'Deleted');
$status = array('2'=>'Completed','1'=>'Bookings','3'=>'Pending','0'=>'Cancelled','4'=>'Deleted');
foreach ($status as $key => $stat) {
echo '<option value="'.$key.'">'.$stat.'</option>';
}
......
......@@ -5,15 +5,17 @@
switch($userType){
case 1:
$menus = array('Dashboard','Tag','Host','City','Category','Venue','Event','Organizer','Checker',
'Customer','Booking','Commission','Staff','CMS','Notification','Settings');
$menus = array('Dashboard','Tag','Host','City','Category','Venue','Event','Organizer',
'Checker','Customer','Booking','Commission','Staff','CMS',
'Notification','Settings');
break;
case 2:
$menus = array('Dashboard','Tag','Host','City','Category','Venue','Event','Checker',
'Commission');
'Organizer','Customer','Booking','Notification');
break;
case 4:
$menus = array('Dashboard');
$menus = array('Dashboard','Tag','Host','City','Category','Venue','Event','Checker',
'Customer','Booking');
break;
}
?>
......
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