hjkhghoppoopppooppoppoppoopoirh
bnmbertsurheoppopopooooooooooooooopoopopdf'tdfg
/
home
/
u641149403
/
domains
/
cabz4you.com
/
public_html
/
admin
/
Upload FileeE
HOME
<?php require_once 'header.php'; require_once 'navbar.php'; $type = $_GET['type'] ?? 'All'; $table_data = []; if (!empty($_POST['date'])) { [$d1, $d2] = explode('-', $_POST['date']); $date1 = date('Y-m-d', strtotime(trim($d1))); $date2 = date('Y-m-d', strtotime(trim($d2))); $filter = "AND DATE(pickup_date) BETWEEN '$date1' AND '$date2'"; } else { $filter = ''; } $type = $conn->real_escape_string($type); $cond = $type !== 'All' ? "status = '$type'" : '1=1'; $sql = "SELECT *, booking_quotation.id AS bk_id FROM booking_quotation LEFT JOIN users ON users.id = booking_quotation.user_id WHERE $cond $filter ORDER BY booking_quotation.id DESC"; $res = $conn->query($sql); $table_data = $res && $res->num_rows ? $res->fetch_all(MYSQLI_ASSOC) : []; ?> <!-- Page content --> <div class="container-fluid pt-8"> <div class="page-header row mt-0 p-3"> <div class="col-lg-6"><h3><?= $type ?> Quotation </h3></div> <div class="col-lg-4 text-right"> <form method="post"> <div class="input-group daterange"> <input id="reportrange" type="text" name="date" class="form-control" placeholder="Search"> <i class="ni ni-calendar-grid-58"></i> <div class="input-group-append"> <button class="btn btn-success" type="submit">Go</button> </div> </div> </form> </div> </div> <div class="card shadow"> <div class="card-body"> <div class="table-responsive" style="overflow-x:auto;"> <table id="example" class="table text-center table-striped table-bordered text-nowrap"> <thead class=""> <tr> <th class="wd-15p">S.No</th> <th class="wd-15p">View</th> <th class="wd-15p">Action</th> <th class="wd-15p">Quotation ID</th> <th class="wd-15p">Status</th> <th class="wd-15p">From </th> <th class="wd-15p">To</th> <th class="wd-15p">Booking Stops</th> <th class="wd-15p">Pickup Address</th> <th class="wd-20p">Name</th> <th class="wd-20p">Contact</th> <th class="wd-20p">Email</th> <th class="wd-20p">Trip Type</th> <th class="wd-20p">Cab Type</th> <th class="wd-15p">Pickup Date</th> <th class="wd-20p">pickup time</th> <th class="wd-20p">Drop Date</th> <th class="wd-15p">Amount</th> <th class="wd-15p">Your Commission</th> <th class="wd-15p">Toll</th> <th class="wd-15p">State Tax</th> <th class="wd-15p">Parking</th> <th class="wd-15p">No. of Passenger</th> <th class="wd-15p">Number Of Days</th> <th class="wd-15p">Luggage</th> <th class="wd-15p">Extra Price</th> <th class="wd-15p">Night Charge</th> <th class="wd-15p">Remark</th> </tr> </thead> <tbody> <?php $x = 1; foreach ($table_data as $hh) { ?> <tr> <td><?= $x++; ?></td> <td class="action"><a href="javascript:void[0]" class="badge p-2 view_btn" style="background: #000;color: #fff!important;"><i class="fas fa-pencil-alt"></i></a></td> <td> <div class="dropdown"> <button class="btn btn-dark btn-sm dropdown-toggle" type="button" data-toggle="dropdown">Action <span class="caret"></span></button> <ul class="dropdown-menu p-2" id="buttons"> <?php if ($hh['status'] == 'Pending') { ?> <li><button id="383" onclick="change_status(<?= $hh['bk_id']; ?>,'Confirmed');" class="btn btn-success mt-1 mb-1 w-100" type="button"> Confirmed</button></li> <li><button onclick="change_status(<?= $hh['bk_id'] ?>,'Cancel');" class="btn btn-warning mt-1 mb-1 w-100" type="button"> Cancel </button></li> <?php } ?> <li><a href="edit_quotation?id=<?= $hh['bk_id'] ?>" class="btn btn-success mt-1 mb-1 w-100">Edit</a></li> <li><button onclick="del(<?= $hh['bk_id'] ?>);" class="btn btn-danger mt-1 mb-1 w-100" type="button"> Delete </button></li> <li><a href="quotation.php?id=<?= $hh['bk_id'] ?>" class="btn btn-primary text-white mt-1 mb-1 w-100"> Generate Quotation </a></li> </ul> </div> </td> <td class="list_booking">PT<?= $hh['bk_id']; ?></td> <td class="status"> <?php if ($hh['status'] == 'Pending') { ?> <label class="badge badge-warning"><?= $hh['status'] ?></label> <?php } elseif ($hh['status'] == 'Confirmed') { ?> <label class="badge badge-success"><?= $hh['status'] ?></label> <?php } else { ?> <label class="badge badge-danger">Cancel</label> <?php } ?> </td> <td class="from"><?= $hh['booking_from'] ?></td> <td class="to"><?= $hh['booking_to']; ?></td> <td class="booking_stop text-left"><?php $i = 1; if (!empty($hh['booking_stops'])) { $booking_stop = explode('/', $hh['booking_stops']); foreach ($booking_stop as $booking_s) { echo $i++ . '. ' . $booking_s . '<br>'; } } ?> </td> <td class="pickup_address"><?= $hh['pickup_address']; ?></td> <td class="name"><?= $hh['name']; ?></td> <td class="contact"><?= $hh['contact']; ?></td> <td class="email"><?= $hh['email']; ?></td> <td class="trip_type"><?= $hh['trip_type']; ?></td> <td class="cab_type"><?= $hh['cab_type']; ?></td> <td class="pickup_date"><?= $hh['pickup_date']; ?></td> <td class="pickup_time"><?= date("h:i A", strtotime($hh['pickup_time'])); ?></td> <td class="drop_date"> <?php if ($hh['drop_date'] == 0) { echo "<b>N.A.</b>"; } else { echo $hh['drop_date']; } ?> </td> <td class="amount"><?= $hh['price']; ?></td> <td class="commission"><?= $hh['admin_commission']; ?></td> <td class="toll_tax"> <?php if ($hh['toll_tax'] == 0) echo "Excluding"; else echo "Including" ?> </td> <td class="state_tax"> <?php if ($hh['state_tax'] == 0) echo "Excluding"; else echo "Including" ?> </td> <td class="parking"> <?php if ($hh['parking'] == 0) echo "Excluding"; else echo "Including" ?> </td> <td class="passenger"><?= $hh['number_passenger']; ?></td> <td class="no_of_day"><?= $hh['no_of_day']; ?></td> <td class="luggage"><?= $hh['luggage']; ?></td> <td class="extra_price"><?= $hh['after_extra_price']; ?></td> <td class="night_charge"><?= $hh['night_charge']; ?></td> <td class="remark"><?= $hh['remark']; ?></td> </tr> <?php } ?> </tbody> </table> </div> </div> </div> </div> <div class="modal fade" id="view_modal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <h3 class="modal-title" id="exampleModalLabel">Details</h3> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <div class="modal-body"> <table class="table table-bordered"> <tr> <th class="wd-15p">Quotation Id</th> <td id="book_id" class="pl-5 ml-5"> </td> <tr> <tr> <th class="wd-15p">Status</th> <td id="status" class="pl-5 ml-5"></td> </tr> <tr> <th class="wd-15p">From</th> <td id="from" class="pl-5 ml-5"></td> </tr> <tr> <th class="wd-15p">To</th> <td id="to" class="pl-5 ml-5"></td> </tr> <tr> <th class="wd-15p">Booking Stops</th> <td id="booking_stop" class="pl-5 ml-5"></td> </tr> <tr> <th class="wd-15p">Pickup Address</th> <td id="pickup_address" class="pl-5 ml-5"></td> </tr> <tr> <th class="wd-15p">Name</th> <td id="name" class="pl-5 ml-5"></td> </tr> <tr> <th class="wd-15p">Contact</th> <td id="contact" class="pl-5 ml-5"></td> </tr> <tr> <th class="wd-15p">Email</th> <td id="email" class="pl-5 ml-5"></td> </tr> <tr> <th class="wd-15p">Pickup Date</th> <td id="pickup_date" class="pl-5 ml-5"></td> </tr> <tr> <th class="wd-15p">Drop Date</th> <td id="drop_date" class="pl-5 ml-5"></td> </tr> <tr> <th class="wd-15p">Pickup Time</th> <td id="pickup_time" class="pl-5 ml-5"></td> </tr> <tr> <th class="wd-15p">Cab Type</th> <td id="cab_type" class="pl-5 ml-5"></td> </tr> <tr> <th class="wd-15p">Trip Type</th> <td id="trip_type" class="pl-5 ml-5"></td> </tr> <tr> <th class="wd-15p">Amount</th> <td id="amount" class="pl-5 ml-5"></td> </tr> <tr> <th class="wd-15p">Your Commission</th> <td id="commissions" class="pl-5 ml-5"></td> </tr> <tr> <th class="wd-15p">Toll</th> <td id="toll_tax" class="pl-5 ml-5"></td> </tr> <tr> <th class="wd-15p">State Tax</th> <td id="state_tax" class="pl-5 ml-5"></td> </tr> <tr> <th class="wd-15p">Parking</th> <td id="parking" class="pl-5 ml-5"></td> </tr> <tr> <th class="wd-15p">No. Of Passenger</th> <td id="passenger" class="pl-5 ml-5"></td> </tr> <tr> <th class="wd-15p">No. Of Days</th> <td id="no_of_day" class="pl-5 ml-5"></td> </tr> <tr> <th class="wd-15p">Luggage</th> <td id="luggage" class="pl-5 ml-5"></td> </tr> <tr> <th class="wd-15p">Extra Price</th> <td id="extra_price" class="pl-5 ml-5"></td> </tr> <tr> <th class="wd-15p">Night Charge</th> <td id="night_charge" class="pl-5 ml-5"></td> </tr> <tr> <th class="wd-15p">Remark</th> <td id="remark" class="pl-5 ml-5"></td> </tr> </table> </div> </div> </div> </div> <?php require_once 'footer.php'; require_once 'jslinks.php'; ?> <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.bundle.min.js"></script> <script src="assets/js/datatable.js"></script> <script> $('.view_btn').click(function (e) { e.preventDefault(); var book_id = $(this).closest('tr').find('.list_booking').text(); var status = $(this).closest('tr').find('.status').text(); var from = $(this).closest('tr').find('.from').text(); var to = $(this).closest('tr').find('.to').text(); var booking_stop = $(this).closest('tr').find('.booking_stop').text(); var pickup_address = $(this).closest('tr').find('.pickup_address').text(); var name = $(this).closest('tr').find('.name').text(); var contact = $(this).closest('tr').find('.contact').text(); var email = $(this).closest('tr').find('.email').text(); var pickup_date = $(this).closest('tr').find('.pickup_date').text(); var drop_date = $(this).closest('tr').find('.drop_date').text(); var pickup_time = $(this).closest('tr').find('.pickup_time').text(); var cab_type = $(this).closest('tr').find('.cab_type').text(); var trip_type = $(this).closest('tr').find('.trip_type').text(); var amount = $(this).closest('tr').find('.amount').text(); var commission = $(this).closest('tr').find('.commission').text(); var drop_address = $(this).closest('tr').find('.drop_address').text(); var toll_tax = $(this).closest('tr').find('.toll_tax').text(); var state_tax = $(this).closest('tr').find('.state_tax').text(); var parking = $(this).closest('tr').find('.parking').text(); var passenger = $(this).closest('tr').find('.passenger').text(); var no_of_day = $(this).closest('tr').find('.no_of_day').text(); var luggage = $(this).closest('tr').find('.luggage').text(); var extra_price = $(this).closest('tr').find('.extra_price').text(); var night_charge = $(this).closest('tr').find('.night_charge').text(); var remark = $(this).closest('tr').find('.remark').text(); $('#book_id').html(book_id); $('#status').html(status); $('#from').html(from); $('#to').html(to); $('#booking_stop').html(booking_stop); $('#pickup_address').html(pickup_address); $('#name').html(name); $('#contact').html(contact); $('#email').html(email); $('#pickup_date').html(pickup_date); $('#drop_date').html(drop_date); $('#pickup_time').html(pickup_time); $('#cab_type').html(cab_type); $('#trip_type').html(trip_type); $('#amount').html(amount); $('#commissions').html(commission); $('#drop_address').html(drop_address); $('#toll_tax').html(toll_tax); $('#state_tax').html(state_tax); $('#parking').html(parking); $('#passenger').html(passenger); $('#no_of_day').html(no_of_day); $('#luggage').html(luggage); $('#extra_price').html(extra_price); $('#night_charge').html(night_charge); $('#remark').html(remark); $('#view_modal').modal('show'); }); function change_status(id, status) { var confir = confirm("Are you sure to " + status + " this quotation?"); if (confir) { $.ajax({ type: "POST", url: "ajax_enquiry.php", data: { quotation_id: id, status: status, }, success: function (data) { if (data == 1) { $('#success-msg').show(); setTimeout(function () { location.reload() }, 2000) } else { $('#error-msg').show(); } } }); } } function del(id) { var confir = confirm("Do you really want to delete!!!"); if (confir) { $.ajax({ type: "POST", url: "ajax_enquiry.php", data: { delete_id: id, }, success: function (data) { if (data == 1) { $('#success-msg').text('Success! Record deleted successfully.'); $('#success-msg').show(); setTimeout(function () { location.reload() }, 2000) } else { $('#error-msg').show(); } } }); } } </script>