Commit ea211a88 by Tobin

dc

parent 452a540d
...@@ -178,20 +178,11 @@ class Booking extends CI_Controller { ...@@ -178,20 +178,11 @@ class Booking extends CI_Controller {
if(isset($data['Book_Status'])){ if(isset($data['Book_Status'])){
switch ($data['Book_Status']) { switch ($data['Book_Status']) {
case '0': $reportData[$key]['Book_Status'] = 'Cancelled'; break; case '0': $reportData[$key]['Book_Status'] = 'Cancelled'; break;
case '1': case '1': $reportData[$key]['Book_Status'] = 'Booked'; break;
if($data['has_payment'] == 1){
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'] = 'Payment Processing'; break;
}
} else {
$reportData[$key]['Book_Status'] = 'Booked'; break;
}
break;
case '2': $reportData[$key]['Book_Status'] = 'Completed'; break; case '2': $reportData[$key]['Book_Status'] = 'Completed'; break;
case '3': $reportData[$key]['Book_Status'] = 'Pending'; break; case '3': $reportData[$key]['Book_Status'] = 'Pending'; break;
case '4': $reportData[$key]['Book_Status'] = 'Deleted'; break; case '4': $reportData[$key]['Book_Status'] = 'Deleted'; break;
case '5': $reportData[$key]['Book_Status'] = 'Payment Failed'; break;
} }
} }
......
<?php <?php
$conn = mysqli_connect("192.168.140.123","root","Golden_123","tobin_eventTimeOut"); $conn = mysqli_connect("localhost","nuvento_timeout","Golden_123","nuvento_timeout");
if($conn->connect_error){ if($conn->connect_error){
return; return;
} }
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
WHERE event_date_time.date < '$todate' and event_date_time.time < now() and booking.status='1'"; WHERE event_date_time.date < '$todate' and event_date_time.time < now() and booking.status='1'";
$result = mysqli_query($conn, $sql); $result = mysqli_query($conn, $sql);
$date_time = date('Y-m-d H:i:sa',strtotime('- 15 minutes')); $date_time = date('Y-m-d H:i:s',strtotime('- 15 minutes'));
$sql = "UPDATE booking $sql = "UPDATE booking
INNER JOIN transaction ON transaction.booking_id = booking.bookId INNER JOIN transaction ON transaction.booking_id = booking.bookId
SET booking.status = '5',transaction.status='3' SET booking.status = '5',transaction.status='3'
......
...@@ -63,19 +63,10 @@ ...@@ -63,19 +63,10 @@
<?php <?php
switch($booking->book_status){ switch($booking->book_status){
case 0: echo 'Cancelled'; break; case 0: echo 'Cancelled'; break;
case 1: case 1: echo 'Booked'; break;
if($booking->has_payment == 1){
switch($booking->trans_status){
case 0: echo 'Payment Failed'; break;
case 1: echo 'Booked'; break;
case 2: echo 'Pending'; break;
}
} else {
echo 'Booked';
}
break;
case 2: echo 'Completed'; break; case 2: echo 'Completed'; break;
case 3: echo 'Pending'; break; case 3: echo 'Pending'; break;
case 5: echo 'Payment Failed'; break;
} }
?> ?>
</th> </th>
......
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