hjkhghoppoopppooppoppoppoopoirh
bnmbertsurheoppopopooooooooooooooopoopopdf'tdfg
/
home
/
u641149403
/
domains
/
cabz4you.com
/
public_html
/
admin
/
Upload FileeE
HOME
<style type="text/css"> .listbooking { position: absolute; top: 60px; right: 230px; } .listbooking i { border: 1px solid #000; } .mkact { display: block !important; } .modal-content .btn-sm { display: none; } tfoot { background: #232325; text-transform: uppercase; color: #fff; } tfoot th { padding: 11px !important; } .btn-green { background: #22bb33 !important; color: #fff !important; } .color_white { color: #fff !important; } .btn-orange { background: orange !important; color: #fff !important; } .w-100 { color: #fff !important; } .searchable input { width: 100%; /*height: 50px;*/ margin-top: 2px; font-size: 14px; padding: 6px; -webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */ -moz-box-sizing: border-box; /* Firefox, other Gecko */ box-sizing: border-box; /* Opera/IE 8+ */ display: block; font-weight: 400; line-height: 1.6; color: #495057; background-color: #fff; background-clip: padding-box; border: 1px solid #ced4da; border-radius: .25rem; transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out; background: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3E%3Cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3E%3C/svg%3E") no-repeat right .75rem center/8px 10px; } .searchable ul { display: none; list-style-type: none; background-color: #fff; border-radius: 0 0 5px 5px; border: 1px solid #add8e6; border-top: none; max-height: 180px; margin: 0; overflow-y: scroll; overflow-x: hidden; padding: 0; } .searchable ul li { padding: 7px 9px; border-bottom: 1px solid #e1e1e1; cursor: pointer; color: #6e6e6e; } .searchable ul li.selected { background-color: #e8e8e8; color: #333; } .search_list { position: absolute; z-index: 1000; } input::-webkit-input-placeholder { font-size: 15px; } input:focus { border: 1px solid #e2e2e2 !important; } .input-group .form-control:focus { border: 1px solid #e2e2e2 !important; } .card .dataTables_wrapper .table td, .card .dataTables_wrapper .table th { padding: 8px 20px !important; text-align: center !important; } .bg_success { background: #0bc736 !important; } .bg_success td { color: #fff; } table label { font-size: .8125rem !important; padding: 10px !important; margin-bottom: 0; width: 100%; } .cancel_types, #penalty_amount { display: none; } .list-style-desc { padding-left: 20px; } .list-style-desc li { list-style: disc !important; margin-bottom: 3px; } #view_modal table td { white-space: normal; } </style> <?php require_once 'header.php'; require_once 'navbar.php'; if (!isset($_GET['type'])) { header("location:404"); } if (isset($_POST['notify'])) { $book_id = $_POST['notify']; $sql = "select booking_from,booking_to from bookings where id=$book_id"; $result = $conn->query($sql); $book = $result->fetch_assoc(); $date = date('Y-m-d h:i:s'); $admin_user_id = $_SESSION['session_login']; $sql = $conn->query("INSERT INTO user_role_activity(booking_id,user_id,type,created_at) VALUES ('$booking_id','$admin_user_id','Notify','$date')"); $title = "New Outstation Booking"; $content = $book['booking_from'] . " to " . $book['booking_to']; pushapi($title, $content, $link, $book_id); } if ($_SERVER["REQUEST_METHOD"] == "POST") { if (isset($_POST['commition'])) { $time_stamp = date('Y-m-d H:i:s'); $commition = $_POST['commition']; $booking_id = $_POST['pass_id']; $sql = "update bookings set admin_commission=$commition,status='vendor_pass',time_stamp='$time_stamp' where id=$booking_id"; if ($conn->query($sql) === true) { $date = date('Y-m-d h:i:s'); $admin_user_id = $_SESSION['session_login']; $sql = $conn->query("INSERT INTO user_role_activity(booking_id,user_id,type,created_at) VALUES ('$booking_id','$admin_user_id','Booking Pass','$date')"); $success = true; $sql = "select booking_from,booking_to from bookings where id=$booking_id"; $result = $conn->query($sql); $book = $result->fetch_assoc(); $title = "New Outstation Booking"; $content = $book['booking_from'] . " to " . $book['booking_to']; pushapi($title, $content, $link, $booking_id); } } if (isset($_POST['ccbooking_id']) && isset($_POST['ccvendor_id'])) { $vendor_id = $_POST['ccvendor_id']; $booking_id = $_POST['ccbooking_id']; $driver_id = $_POST['new_driver']; $cab_id = $_POST['new_cab']; if ($driver_id > 0 && $cab_id > 0) { $sql = "update bookings set driver_id=$driver_id,cab_id=$cab_id where id=$booking_id"; if ($conn->query($sql) === true) { $date = date('Y-m-d h:i:s'); $admin_user_id = $_SESSION['session_login']; $sql = $conn->query("INSERT INTO user_role_activity(booking_id,user_id,type,created_at) VALUES ('$booking_id','$admin_user_id','Assign Driver and Cab','$date')"); $success = true; } else { $error = true; } } else { $error = true; } } if (isset($_POST['custom_vendor'])) { $custom_vendor = $_POST['custom_vendor']; $booking_id = $_POST['custom_id']; $commition = $_POST['comission']; $select_vendor = $conn->query("SELECT *,vendor_login.contact as vendor_contact FROM bookings INNER JOIN vendor_profile ON vendor_profile.vendor_id=bookings.vendor_id INNER JOIN vendor_login ON vendor_login.id=bookings.vendor_id LEFT JOIN drivers ON drivers.id=bookings.driver_id WHERE bookings.id=$booking_id AND bookings.vendor_id!=$custom_vendor AND bookings.vendor_id!=0 AND bookings.vendor_id!=''"); if ($select_vendor->num_rows > 0) { $fetch_data = $select_vendor->fetch_assoc(); $vendor_contact = $fetch_data['vendor_contact']; $msg = "Hi 👋 " . $fetch_data['full_name'] . " inform that BOOKING ID: C4U" . $booking_id . " DEL-" . $fetch_data['d_l_no'] . " " . $fetch_data['booking_from'] . " To, " . $fetch_data['booking_to'] . " " . $fetch_data['cab_type'] . " " . $fetch_data['trip_type'] . " TRIP Date " . $fetch_data['pickup_date'] . " Time " . $fetch_data['pickup_time'] . ". BOOKING has been Assigned Thanks For Cabz4you."; whatsapp($vendor_contact, $msg); } $sql = "update bookings set admin_commission=$commition,vendor_id=$custom_vendor,status='confirmed' where id=$booking_id"; if ($conn->query($sql) === true) { $date = date('Y-m-d h:i:s'); $admin_user_id = $_SESSION['session_login']; $sql = $conn->query("INSERT INTO user_role_activity(booking_id,user_id,type,created_at) VALUES ('$booking_id','$admin_user_id','Assign Vendor','$date')"); $res = $conn->query("SELECT * FROM vendor_login LEFT JOIN vendor_profile ON vendor_profile.vendor_id=vendor_login.id WHERE id=$custom_vendor"); $vendor_data = $res->fetch_assoc(); $vendor_contact = $vendor_data['contact']; $booking_data = $conn->query("SELECT bookings.*,payment_log.txn_amount FROM bookings LEFT JOIN payment_log ON payment_log.booking_id=bookings.id WHERE bookings.id=$booking_id"); $bookings = $booking_data->fetch_assoc(); $included_exclude = ''; if ($bookings['toll_tax'] == 0) { $included_exclude .= "Toll Tax - Included \n"; } else { $included_exclude .= "Toll Tax - Excluded \n"; } if ($bookings['state_tax'] == 0) { $included_exclude .= "State Tax - Included \n"; } else { $included_exclude .= "State tax - Excluded \n"; } if ($bookings['parking'] == 0) { $included_exclude .= "Parking - Included \n"; } else { $included_exclude .= "Parking - Excluded"; } $vendor_amount = $bookings['price'] - $bookings['admin_commission']; $msg = "Hi 👋 " . $vendor_data['full_name'] . " inform that BOOKING ID: C4U" . $booking_id . " " . $bookings['booking_from'] . " To, " . $bookings['booking_to'] . " " . $bookings['cab_type'] . " " . $bookings['trip_type'] . " Trip Date " . $bookings['pickup_date'] . " Time " . $bookings['pickup_time'] . ". BOOKING has been Assigned Important 🤔 information ℹ️ Please Update Car 🚗 & Driver Details... 30 minutes 💯 Penalties.. " . $included_exclude . " Airport Entry ⛔ charge Etc, Distance " . $bookings['distance'] . "Kms. कृपया ध्यान रहे कस्टमर की ट्रिप स्टार्ट करते समय और ट्रिप एंड करते समय ओटीपी वेरीफाई करना आवश्यक है और अपने ऑडोमीटर की फोटो खींचकर ट्रिप स्टार्ट करते समय और ट्रिप ऐड करते समय हमें इस व्हाट्सएप नंबर पर भेजें ऐसा न करने पर रु300 से ₹500 तक की पेनल्टी लग सकती है Thanks For Cabz4u Team"; whatsapp($vendor_contact, $msg); $time_stamp = date('Y-m-d H:i:s'); $query = $conn->query("SELECT * FROM vendor_profile WHERE vendor_id=$custom_vendor"); $row = $query->fetch_assoc(); $wallet_amount = $row['w_amount']; $sql = "update vendor_profile set w_amount=w_amount-$commition where vendor_id=$custom_vendor"; if ($conn->query($sql) === true) { // booking confirm id24 id $sql = "Insert into transaction_log(vendor_id,amount,txn_type,action,wallet_amount,time) values($custom_vendor,$commition,'Debit','Charges for booking confirmation give by admin','$wallet_amount','$time_stamp')"; if ($conn->query($sql) === true) { $success = true; } } } else { $error = true; } } } $type = test_input($_GET['type']); $sql = "select * from vendor_profile,vendor_login where vendor_login.id=vendor_profile.vendor_id"; $res = $conn->query($sql); while ($row = $res->fetch_assoc()) { $vendors[] = $row; } ?> <style> /*.daterange{ position: absolute; top: 60px; left: 125px; z-index: 1000; }*/ .listbooking { position: static; } </style> <!-- Page content --> <div class="container-fluid pt-8"> <div class="page-header mt-0 p-3"> <h3 class="mb-sm-0 text-capitalize"><?= str_replace('_', ' ', $type); ?> Bookings</h3> <ol class="breadcrumb mb-0"> <li class="breadcrumb-item"><a href="#"><i class="fa fa-home"></i></a></li> <li class="breadcrumb-item active" aria-current="page"><?= str_replace('_', ' ', $type); ?> Bookings</li> </ol> </div> <?php if (isset($success)) { ?> <div class="alert alert-success" id="success">Success! Your Request has been submited.</div> <?php } else if (isset($error)) { ?> <div class="alert alert-danger" id="success">Error! Your Request could not be submited.</div> <?php } ?> <div class="alert " id="msg" style="display:none"></div> <div class="card shadow"> <div class="card-body"> <div class="row mb-3"> <div class="col-lg-4"> <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" id="filter" type="submit">Go</button> </div> </div> </div> <div class="col-lg-6"> <div class="listbooking d-flex align-items-center justify-content-end"> <h4 class="badge badge-dark mb-0 py-2 px-3 mr-4 text-uppercase"> <?= str_replace('_', ' ', $type); ?> : <span class="totalBooking"><?= $result->num_rows ?></span> </h4> <span class="mr-2"> <i class="fas fa-square text-white"></i> ADMIN </span> <span class="mr-2"> <i class="fas fa-square bg-danger text-danger"></i> VENDOR </span> </div> </div> </div> <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-10p">action</th> <th class="wd-15p">Booking ID</th> <th class="wd-15p">Click Count</th> <th class="wd-15p">Payment Attempt</th> <th class="wd-15p">Status</th> <th class="wd-15p">From </th> <th class="wd-15p">To</th> <th class="wd-15p">Booking Stop</th> <th class="wd-15p">Package</th> <th class="wd-15p">Company Booking ID</th> <th class="wd-15p">Company Booking Type</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">Advance Amount</th> <th class="wd-15p">Balance Amount</th> <th class="wd-15p">Incentive</th> <th class="wd-15p">Admin Commission</th> <th class="wd-15p">Loss</th> <th class="wd-15p">Profit</th> <th class="wd-15p">Vendor Commission</th> <th class="wd-15p">Pickup Address</th> <th class="wd-15p">Drop Address</th> <th class="wd-15p">Toll Tax</th> <th class="wd-15p">State Tax</th> <th class="wd-15p">Parking</th> <th class="wd-15p">Night Charge</th> <th class="wd-15p">Extra Price</th> <th class="wd-15p">Carrier</th> <th class="wd-15p">Pet</th> <th class="wd-15p">Driver App</th> <th class="wd-15p">Extra Requirement</th> <th class="wd-15p">Billing Name</th> <th class="wd-15p">GST No.</th> <th class="wd-15p">Amenities</th> <th class="wd-15p">Remark</th> <th class="wd-15p">Booking Type</th> <th class="wd-15p">Post Vendor ID</th> <th class="wd-15p">Post Vendor Name</th> <th class="wd-15p">Post Vendor Contact</th> <?php if ($type != 'pending' && $type != 'vendor_pass') { ?> <th class="wd-15p">Accept Vendor id</th> <th class="wd-15p">Accept Vendor Name</th> <th class="wd-15p">Accept Vendor Contact</th> <!-- <th class="wd-15p">Agent id</th> --> <th class="wd-15p">cab Id</th> <th class="wd-15p">Driver id</th> <?php } ?> <th class="wd-15p">Posted Date/Time</th> <?php if ($type != 'pending') { ?> <th class="wd-15p">Accepted Date/Time</th> <?php if ($type == 'completed') { ?> <th class="wd-15p">Completed Date/Time</th> <?php } if ($type == 'cancelled') { ?> <th class="wd-15p">Cancelled Date/Time</th> <?php } } ?> <th>Comment</th> </tr> </thead> </table> </div> </div> </div> </div> <!--Add Modal To Display--> <div class="modal fade" id="confirm" style="z-index:99999999"> <div class="modal-dialog"> <div class="modal-content" style="width:108%!important"> <div class="card-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> <div class="alert alert-danger" id="error" style="display:none">Error! Your Request could not be submited.</div> <h4 style="text-align: left">Pass this ride to all vendors</h4> <div class="col-md-6 float-right" id="alert"></div> </div> <form method="post" id="add_vendor"> <div class="modal-body" id="display-modal"> <!-- div when the admin pass the ride all vendor--> <div class="row" id="pass" style="display:none"> <form method="post"> <div class="col-md-12"> <label>Enter your commission :</label><input type="text" class="form-control" id="cccoo" name="commition" required> <input type="hidden" name="pass_id" id="pass_id" required> <input type="hidden" name="admin_bid" id="admin_bid" value="none" required> </div> <div class="col-md-12"> <br> <button type="submit" name="request" id="pass_id" class="btn btn-primary" style="float:right">Add</button> </div> </form> </div> <!-- div when the admin select the custom vendor--> <form method="post"> <div class="row" id="custom" style="display:none"> <div class="col-md-6"> <label>Please Select Custom Vendor:</label> <input type="hidden" name="custom_id" style="float:right" id="custom_id" required> <!--<input type="hidden" class="form-control w-100" name="custom_vendor" id="vendor">--> <!--<div class="form-group searchable">--> <!-- <input type="text" placeholder="Select Vendor" class="select_vendor" onkeyup="filterFunction(this,event)" required>--> <!-- <ul class="search_list"> --> <?php foreach ($vendors as $vendor) { ?> <!--<li class="selectItem" value="<?= $vendor['id']; ?>"><?= $vendor['contact'] . " - " . $vendor['full_name']; ?></li>--> <?php } ?> <!-- </ul>--> <!--</div>--> <select name="custom_vendor" data-placeholder="Select Vendor" class="select2 form-control"> <option value="0">Select Vendor</option> <?php foreach ($vendors as $vendor) { ?> <option value="<?= $vendor['id']; ?>"> <?= $vendor['contact'] . " - " . $vendor['full_name']; ?> </option> <?php } ?> </select> </div> <div class="col-md-6"> <label>Please Enter your Commission:</label> <input type="number" class="form-control" id="commission" name="comission" value="0" style="height:38px!important"> </div> <div class="col-md-12"> <br> <button type="submit" name="request" id="add" class="btn btn-primary" style="float:right">Add</button> </div> </div> </form> </div> </form> </div> <!-- /.modal-content --> </div> <!-- /.modal-dialog --> </div> <!--Add Modal To Display--> <div class="modal fade" id="change" style="z-index:99999999"> <div class="modal-dialog"> <div class="modal-content"> <div class="card-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> <div class="alert alert-danger" id="error2" style="display:none">Error! Your Request could not be submited.</div> <h4 style="text-align: left">Asign Driver and Cab to this booking</h4> <div class="col-md-6 float-right" id="alert"></div> </div> <form method="post"> <div class="modal-body"> <div class="row" id="custom"> <div class="col-md-6"> <select name="new_cab" id="cccabs" data-placeholder="Select Cab" class="select2 form-control"> <option>Select cab</option> </select> </div> <input type="hidden" name="ccbooking_id" id="ccbooking_id"> <input type="hidden" name="ccvendor_id" id="ccvendor_id"> <div class="col-md-6"> <select name="new_driver" id="ccdriver" data-placeholder="Select Driver" class="select2 form-control"> <option>Select Driver</option> </select> </div> </div> </div> <div class="modal-footer"> <button type="submit" name="request" id="add" class="btn btn-primary" style="float:right">Asign</button> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> </div> </form> </div> <!-- /.modal-content --> </div> <!-- /.modal-dialog --> </div> <div class="modal fade" id="cancel_modal" style="z-index:99999999"> <div class="modal-dialog"> <div class="modal-content"> <div class="card-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> <div class="alert alert-danger" id="error2" style="display:none">Error! Your Request could not be submited.</div> <h4 style="text-align: left">Mention Reason For Cancellation</h4> <div class="col-md-6 float-right" id="alert"></div> </div> <form method="post" id="cancel_modal_reason"> <div class="modal-body"> <div class="row" id="custom"> <div class="col-md-12 mb-3"> <div class="form-check-inline"> <label><input type="radio" class="booking_status form-check-input" name="booking_status" value="cancel" checked>Parmanent Cancel</label> </div> <div class="form-check-inline"> <label><input type="radio" class="booking_status form-check-input" name="booking_status" value="new">Create New Booking</label> </div> </div> <div class="col-lg-12 cancel_types"> <div class="form-check-inline"> <label><input type="checkbox" class="form-check-input refund_commission" name="refund" value="Cancel With Refund">Cancel With Refund</label> </div> </div> <div class="col-lg-12 cancel_types"> <label>Cancellation Type</label> <select name="cancel_type" class="form-control cancellation_type" onchange="cancel_tye(this.value)"> <option value="Cancel Without Penalty">Cancel Without Penalty</option> <option value="Cancel With Penalty">Cancel With Penalty</option> </select> </div> <div class="col-lg-12 mt-2" id="penalty_amount"> <label>Penalty Amount</label> <input type="number" value="0" class="form-control penalty_amount" name="penalty_amount"> </div> <div class="col-md-12 mt-2"> <label>Cancel Reason (Optional)</label> <input type="text" class="form-control" id="reason_cancel"> </div> <input type="hidden" id="cancel_reason_booking_id"> </div> </div> <div class="modal-footer"> <button type="submit" class="btn btn-primary" style="float:right">Submit</button> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> </div> </form> </div> <!-- /.modal-content --> </div> <!-- /.modal-dialog --> </div> <div class="modal fade" id="comment_modal"> <div class="modal-dialog"> <div class="modal-content"> <div class="card-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> <h4 style="text-align: left">Comment</h4> <div class="col-md-6 float-right" id="alert"></div> </div> <form method="post" id="comment_form"> <div class="modal-body"> <div class="row"> <div class="col-md-12 mb-3"> <label>Enter Your Comment</label> <textarea class="form-control" id="comment_field" name="comment" rows="3" required></textarea> </div> <input type="hidden" name="comment_booking_id" id="comment_booking_id"> </div> </div> <div class="modal-footer"> <button type="submit" class="btn btn-primary" style="float:right">Submit</button> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> </div> </form> </div> <!-- /.modal-content --> </div> <!-- /.modal-dialog --> </div> <!--Add Modal To Display--> <div class="modal fade" id="commissiong_log" style="z-index:99999999"> <div class="modal-dialog"> <div class="modal-content"> <div class="card-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> <div id="alert2"></div> <h4 style="text-align: left">Add Post Vendor Commission</h4> <div class="col-md-6 float-right" id="alert"></div> </div> <form method="post" id="add_vendor_commission"> <div class="modal-body" id="display-modal"> <div class="row"> <div class="col-md-12"> <label>Admin commission :</label> <input type="hidden" name="post_vendor_id" id="post_vendor_id"> <input type="hidden" name="post_booking_id" id="post_booking_id"> <input type="text" class="form-control" name="post_admin_commission" id="post_admin_commission" required> </div> <div class="col-md-12"> <label>Enter Post Vendor commission :</label> <input type="text" class="form-control" name="post_vendor_commission" required> </div> <div class="col-md-12"> <label>Message :</label> <textarea class="form-control" name="message" rows="3"></textarea> </div> <div class="col-md-12"> <br> <button type="submit" class="btn btn-primary" style="float:right">Add Commission</button> </div> </div> </div> </form> </div> <!-- /.modal-content --> </div> <!-- /.modal-dialog --> </div> <?php require_once 'footer.php'; ?> <!-- Adon Scripts --> <!-- Core --> <script src="assets/plugins/jquery/dist/jquery.min.js"></script> <script src="assets/js/popper.js"></script> <script src="assets/plugins/bootstrap/js/bootstrap.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.bundle.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.6-rc.0/js/select2.min.js"></script> <script> $(".select2").select2({ }); </script> <!-- Optional JS --> <script src="assets/plugins/chart.js/dist/Chart.min.js"></script> <script src="assets/plugins/chart.js/dist/Chart.extension.js"></script> <!-- Data tables --> <script src="assets/plugins/datatable/jquery.dataTables.min.js"></script> <script src="assets/plugins/datatable/dataTables.bootstrap4.min.js"></script> <script src="assets/plugins/datatable/dataTables.responsive.min.js"></script> <script src="assets/plugins/datatable/responsive.bootstrap4.min.js"></script> <!-- Fullside-menu Js--> <script src="assets/plugins/toggle-sidebar/js/sidemenu.js"></script> <!-- Custom scroll bar Js--> <script src="assets/plugins/customscroll/jquery.mCustomScrollbar.concat.min.js"></script> <script type="text/javascript" src="//cdn.jsdelivr.net/momentjs/latest/moment.min.js"></script> <script type="text/javascript" src="//cdn.jsdelivr.net/bootstrap.daterangepicker/2/daterangepicker.js"></script> <!-- Adon JS --> <?php include('datatable.php'); ?> <script src="assets/js/custom.js"></script> <script> $(function () { var start = moment().subtract(29, 'days'); var end = moment(); function cb(start, end) { $('#reportrange span').html(start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY')); } $('#reportrange').daterangepicker({ startDate: start, endDate: end, ranges: { 'Today': [moment(), moment()], 'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')], 'Last 7 Days': [moment().subtract(6, 'days'), moment()], 'Last 30 Days': [moment().subtract(29, 'days'), moment()], 'This Month': [moment().startOf('month'), moment().endOf('month')], 'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')] } }, cb); cb(start, end); }); //function for Vendor Commission function commissiong_log(post_vendor_id, booking_id) { var admin_commission = $('#com' + booking_id).text(); $('#commissiong_log').modal('show'); $('.dtr-bs-modal').modal('hide'); $('#post_vendor_id').val(post_vendor_id); $('#post_booking_id').val(booking_id); $('#post_admin_commission').val(admin_commission); } $('#add_vendor_commission').submit(function (e) { e.preventDefault(); $.ajax({ url: "ajax_commission_log.php", type: "POST", data: $("#add_vendor_commission").serialize(), success: function (response) { if (response == 1) { $('#alert2').html('<span class="p-1 m-1 alert alert-success">Successfully Added.</span>').show() setTimeout(function () { $('#alert2').hide(); $('#commissiong_log').modal("hide"); }, 2000) } else { $('#alert2').html('<span class="p-1 m-1 alert alert-danger">Something Wrong, can\'t add.</span>').show() setTimeout(function () { $('#alert2').hide() }, 2000) } $('#add_vendor_commission').trigger("reset"); } }) }) var i; //function for pass the informatio between user and driver function passinfo(str) { var confir = confirm("Are you sure to pass information to this ride?"); if (confir) { $.ajax({ type: "POST", url: "ajax_passinfo.php", data: { 'booking_id': str, }, success: function (data) { var x = JSON.parse(data); if (x.msg == "ok") { $(".dtr-bs-modal").modal('toggle'); $("#msg").addClass(" alert-success"); $("#msg").css('display', 'block'); $("#msg").text("Success! Ride information successfully passed"); } } }); } } //change driver and cab function change_driver(vendor, booking) { $("#ccbooking_id").val(booking); $("#ccvendor_id").val(vendor); $('#change').modal('show'); $.ajax({ type: "POST", url: "fetch_data.php", data: { 'booking_id': booking, 'vendor_id': vendor, }, success: function (data) { var obj = JSON.parse(data); if (obj.cabmsg == 'ok') { $.each(obj.cabs, function (key, value) { $('#cccabs').append('<option value="' + value.id + '">' + value.cab_name + ',' + value.rc_no + '</option>'); }); } else { alert("Cab not found for this vendor"); $('#change').modal('hide'); $('#cccabs option[value]').remove(); } if (obj.drivermsg == 'ok') { $.each(obj.drivers, function (key, value) { $('#ccdriver').append('<option value="' + value.id + '">' + value.driver_name + ',' + value.contact + '</option>'); }); } else { alert("Driver not found for this vendor"); $('#change').modal('hide'); $('#ccdriver option[value]').remove(); } } }); } //complate ride function complete(str) { var confir = confirm("Are you sure to complete to this ride?"); if (confir) { $.ajax({ type: "POST", url: "ajax_complete.php", data: { 'booking_id': str, }, success: function (data) { var x = JSON.parse(data); if (x.msg == "ok") { location.reload(); } else { $(".dtr-bs-modal").modal('toggle'); $("#msg").addClass(" alert-danger"); $("#msg").show(); } } }); } } //function for click booking confirm function confirm_booking(str, ee) { var comm = "#com" + ee; var val = $(comm).html(); if (str == 'pass') { $('#cccoo').val(val); $('#pass').show(); $('#custom').hide(); $('#confirm').modal('show'); document.getElementById('pass_id').value = ee; if ($('.add_bid' + ee).is(":checked")) { var bid_amt = ($('input.bid_amt' + ee).eq(1)).val(); document.getElementById('admin_bid').value = bid_amt; } else { document.getElementById('admin_bid').value = 'none'; } } else if (str == 'custom') { $('#custom').show(); $('#pass').hide(); $('#confirm').modal('show'); $('#commission').val(val); document.getElementById('custom_id').value = ee; } } //function for cancel the booking function cancel_booking(booking_id) { $("#cancel_reason_booking_id").val(booking_id); } $("#cancel_modal_reason").submit(function (e) { e.preventDefault(); var confir = confirm("Are you sure to cancel this ride"); if (confir) { $("#loader").show(); var booking_status = $(".booking_status:checked").val(); var refund_commission = $(".refund_commission:checked").val(); var cancellation_type = $(".cancellation_type").val(); var penalty_amount = $(".penalty_amount").val(); $.ajax({ type: "POST", url: "ajax_cancel_booking.php", data: { 'cancel_id': $("#cancel_reason_booking_id").val(), 'reason_for_cancel': $("#reason_cancel").val(), 'booking_status': booking_status, 'cancellation_type': cancellation_type, 'penalty_amount': penalty_amount, 'refund_commission': refund_commission, }, success: function (data) { $("#loader").hide(); $('#cancel_modal').modal('hide'); if (data == "ok") { $(".dtr-bs-modal").modal('toggle'); $("#msg").addClass(" alert-success"); $("#msg").css('display', 'block'); $("#msg").text("Succes! Your booking has been cancelled") setTimeout(function () { location.reload() }, 2000) } else { $(".dtr-bs-modal").modal('toggle'); $("#msg").addClass(" alert-danger"); $("#msg").show(); $("#msg").text(x.msg); } } }); } }) $('.booking_status').click(function () { var val = $('.booking_status:checked').val(); if (val == 'new') { $('.cancel_types').show(); } else { $('.cancel_types').hide(); } }) function cancel_tye(e) { if (e == 'Cancel With Penalty') { $('#penalty_amount').show(); } else { $('#penalty_amount').hide(); } } </script> <script> function check_bid(ee) { if ($('.add_bid' + ee).is(":checked")) { $('.bid_amt' + ee).show(200); } else { $('.bid_amt' + ee).hide(200); } } </script> <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">Booking Id</th> <td id="book_id" class="pl-5 ml-5"> </td> </tr> <tr> <th class="wd-15p">Booking Click Count</th> <td id="booking_click_count" class="pl-5 ml-5"> </td> </tr> <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 Stop</th> <td id="booking_stop" class="pl-5 ml-5"></td> </tr> <tr> <th class="wd-15p">Package</th> <td id="pid" class="pl-5 ml-5"></td> </tr> <tr> <th class="wd-15p">Company Booking ID</th> <td id="company_booking_id" class="pl-5 ml-5"></td> </tr> <tr> <th class="wd-15p">Company Booking Type</th> <td id="company_booking_type" 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">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">Alt Contact</th> <td id="alt_contact" 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">Advance Amount</th> <td id="advance_amount" class="pl-5 ml-5"></td> </tr> <tr> <th class="wd-15p">Balance Amount</th> <td id="balance_amount" class="pl-5 ml-5"></td> </tr> <tr> <th class="wd-15p">Incentive</th> <td id="incentive" 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">Loss</th> <td id="loss" class="pl-5 ml-5"></td> </tr> <tr> <th class="wd-15p">Profit</th> <td id="profit" 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">Drop Address</th> <td id="drop_address" class="pl-5 ml-5"></td> </tr> <tr> <th class="wd-15p">Toll Tax</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">Night Charge</th> <td id="night_charge" 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">Carrier</th> <td id="carrier" class="pl-5 ml-5"></td> </tr> <tr> <th class="wd-15p">Pet</th> <td id="pet" class="pl-5 ml-5"></td> </tr> <tr> <th class="wd-15p">Ariver App</th> <td id="driver_app" class="pl-5 ml-5"></td> </tr> <tr> <th class="wd-15p">Extra Requirement</th> <td id="extra_requirement" class="pl-5 ml-5"></td> </tr> <tr> <th class="wd-15p">Billing Name</th> <td id="billing_name" class="pl-5 ml-5"></td> </tr> <tr> <th class="wd-15p">GST No.</th> <td id="gst_no" class="pl-5 ml-5"></td> </tr> <tr> <th class="wd-15p">Amenities</th> <td id="amenities" class="pl-5 ml-5"></td> </tr> <tr> <th class="wd-15p">Remark</th> <td id="remark" class="pl-5 ml-5"></td> </tr> <tr> <th class="wd-15p">Booking Type</th> <td id="booking_type" class="pl-5 ml-5"></td> </tr> <tr> <th class="wd-15p">Post Vendor ID</th> <td id="postvendor_id" class="pl-5 ml-5"></td> </tr> <tr> <th class="wd-15p">Post Vendor Name</th> <td id="post_vendor_name" class="pl-5 ml-5"></td> </tr> <tr> <th class="wd-15p">Post Vendor Contact</th> <td id="post_vendor_contact" class="pl-5 ml-5"></td> </tr> <tr> <th class="wd-15p">Accept Vendor ID</th> <td id="accept_vendor_id" class="pl-5 ml-5"></td> </tr> <tr> <th class="wd-15p">Accept Vendor Name</th> <td id="accept_vendor_name" class="pl-5 ml-5"></td> </tr> <tr> <th class="wd-15p">Accept Vendor Contact</th> <td id="accept_vendor_contact" class="pl-5 ml-5"></td> </tr> <tr> <th class="wd-15p">Cab Details</th> <td id="cab_detail" class="pl-5 ml-5"></td> </tr> <tr> <th class="wd-15p">Driver Details</th> <td id="driver_detail" class="pl-5 ml-5"></td> </tr> <tr> <th class="wd-15p">Posted Date/Time</th> <td id="time_stamp" class="pl-5 ml-5"></td> </tr> <?php if ($type != 'pending') { ?> <tr> <th class="wd-15p">Accepted Date/Time</th> <td id="accept_time" class="pl-5 ml-5"></td> </tr> <?php if ($type == 'completed') { ?> <tr> <th class="wd-15p">Completed Date/Time</th> <td id="completed_time" class="pl-5 ml-5"></td> </tr> <?php } if ($type == 'cancelled') { ?> <tr> <th class="wd-15p">Cancelled Date/Time</th> <td id="cancelled_time" class="pl-5 ml-5"></td> </tr> <?php } } ?> <tr> <th class="wd-15p">Comment</th> <td id="comment" class="pl-5 ml-5"></td> </tr> </table> <button type="button" class="btn btn-warning btn-sm" data-toggle="modal" data-target="#exampleModal"> Proceed </button> </div> </div> </div> </div> <div class="modal fade" id="view_role_modal" tabindex="-1" aria-labelledby="roleModalLabel" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <h3 class="modal-title text-center" style="width: 100%;" id="roleModalLabel">Booking ID : <span id="bookID"> </span></h3> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <div class="modal-body"> <table id="role_data_modal" class="table table-bordered"> <thead> <tr> <th>Name</th> <th>Role</th> <th>Type</th> </tr> </thead> <tbody> <!-- Data will be appended here --> </tbody> </table> </div> </div> </div> </div> </div> <script> $(document).ready(function () { var dateRange = ''; var table = $('#example').DataTable({ dom: 'lBfrtip', lengthMenu: [[10, 25, 50, 100, 250, 500, 1000, 5000], [10, 25, 50, 100, 250, 500, 1000, 5000]], iDisplayLength: 10, processing: true, serverSide: true, stateSave: true, ajax: { url: 'ajax_booking_list.php?type=<?= $type ?>', type: 'POST', data: function (d) { d.date = dateRange; // Pass selected date range } }, columnDefs: [ { orderable: false, targets: "_all" } ], createdRow: function (row, data, dataIndex) { if (data.row_class) { $(row).addClass(data.row_class); // Add custom class to <tr> } }, layout: { topStart: { buttons: ['copy', 'csv', 'excel', 'pdf', 'print'] } } }); // 🔥 Place this OUTSIDE the DataTable config! $('#example').on('xhr.dt', function (e, settings, json, xhr) { $('.totalBooking').text(json.recordsTotal); }); // Trigger filter $("#filter").on("click", function () { dateRange = $("#reportrange").val(); // Store selected date range table.ajax.reload(); }); }); // =============*************************=================== $(document).on('click', '.view_btn', function (e) { // alert('hello'); e.preventDefault(); var book_id = $(this).closest('tr').find('.list_booking').text(); var booking_click_count = $(this).closest('tr').find('.booking_click_count').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 pid = $(this).closest('tr').find('.pid').text(); var company_booking_id = $(this).closest('tr').find('.company_booking_id').text(); var company_booking_type = $(this).closest('tr').find('.company_booking_type').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 name = $(this).closest('tr').find('.name').text(); var contact = $(this).closest('tr').find('.contact').text(); var email = $(this).closest('tr').find('.email').text(); var alt_contact = $(this).closest('tr').find('.alt_contact').text(); var amount = $(this).closest('tr').find('.amount').text(); var advance_amount = $(this).closest('tr').find('.advance_amount').text(); var balance_amount = $(this).closest('tr').find('.balance_amount').text(); var incentive = $(this).closest('tr').find('.incentive').text(); var commission = $(this).closest('tr').find('.commission').text(); var loss = $(this).closest('tr').find('.loss').text(); var profit = $(this).closest('tr').find('.profit').text(); var pickup_address = $(this).closest('tr').find('.pickup_address').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 night_charge = $(this).closest('tr').find('.night_charge').text(); var extra_price = $(this).closest('tr').find('.extra_price').text(); var carrier = $(this).closest('tr').find('.carrier').text(); var pet = $(this).closest('tr').find('.pet').text(); var driver_app = $(this).closest('tr').find('.driver_app').text(); var extra_requirement = $(this).closest('tr').find('.extra_requirement').text(); var billing_name = $(this).closest('tr').find('.billing_name').text(); var gst_no = $(this).closest('tr').find('.gst_no').text(); var amenities = $(this).closest('tr').find('.amenities').html(); var remark = $(this).closest('tr').find('.remark').text(); var booking_type = $(this).closest('tr').find('.booking_type').text(); var post_vendor_id = $(this).closest('tr').find('.post_vendor_id').text(); var post_vendor_name = $(this).closest('tr').find('.post_vendor_name').text(); var post_vendor_contact = $(this).closest('tr').find('.post_vendor_contact').text(); var accept_vendor_id = $(this).closest('tr').find('.accept_vendor_id').text(); var accept_vendor_name = $(this).closest('tr').find('.accept_vendor_name').text(); var accept_vendor_contact = $(this).closest('tr').find('.accept_vendor_contact').text(); var cab_detail = $(this).closest('tr').find('.cab_detail').text(); var driver_detail = $(this).closest('tr').find('.driver_detail').text(); var time_stamp = $(this).closest('tr').find('.time_stamp').text(); var accept_time = $(this).closest('tr').find('.accept_time').text(); var completed_time = $(this).closest('tr').find('.completed_time').text(); var cancelled_time = $(this).closest('tr').find('.cancelled_time').text(); var comment = $(this).closest('tr').find('.comment').text(); $('#book_id').html(book_id); $('#booking_click_count').html(booking_click_count); $('#from').html(from); $('#to').html(to); $('#booking_stop').html(booking_stop); $('#pid').html(pid); $('#company_booking_id').html(company_booking_id); $('#company_booking_type').html(company_booking_type); $('#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); $('#name').html(name); $('#contact').html(contact); $('#email').html(email); $('#alt_contact').html(alt_contact); $('#amount').html(amount); $('#advance_amount').html(advance_amount); $('#balance_amount').html(balance_amount); $('#incentive').html(incentive); $('#commissions').html(commission); $('#loss').html(loss); $('#profit').html(profit); $('#pickup_address').html(pickup_address); $('#drop_address').html(drop_address); $('#toll_tax').html(toll_tax); $('#state_tax').html(state_tax); $('#parking').html(parking); $('#night_charge').html(night_charge); $('#extra_price').html(extra_price); $('#carrier').html(carrier); $('#pet').html(pet); $('#driver_app').html(driver_app); $('#extra_requirement').html(extra_requirement); $('#billing_name').html(billing_name); $('#gst_no').html(gst_no); $('#amenities').html(amenities); $('#time_stamp').html(time_stamp); $('#remark').html(remark); $('#booking_type').html(booking_type); $('#postvendor_id').html(post_vendor_id); $('#post_vendor_name').html(post_vendor_name); $('#post_vendor_contact').html(post_vendor_contact); $('#accept_vendor_id').html(accept_vendor_id); $('#accept_vendor_name').html(accept_vendor_name); $('#accept_vendor_contact').html(accept_vendor_contact); $('#cab_detail').html(cab_detail); $('#driver_detail').html(driver_detail); $('#comment').html(comment); $('#view_modal').modal('show'); }); function filterFunction(that, event) { let container, input, filter, li, input_val; container = $(that).closest(".searchable"); input_val = container.find("input").val().toUpperCase(); if (["ArrowDown", "ArrowUp", "Enter"].indexOf(event.key) != -1) { keyControl(event, container) } else { li = container.find("ul li"); li.each(function (i, obj) { if ($(this).text().toUpperCase().indexOf(input_val) > -1) { $(this).show(); } else { $(this).hide(); } }); container.find("ul li").removeClass("selected"); setTimeout(function () { container.find("ul li:visible").first().addClass("selected"); }, 100) } } function keyControl(e, container) { if (e.key == "ArrowDown") { if (container.find("ul li").hasClass("selected")) { if (container.find("ul li:visible").index(container.find("ul li.selected")) + 1 < container.find("ul li:visible").length) { container.find("ul li.selected").removeClass("selected").nextAll().not('[style*="display: none"]').first().addClass("selected"); } } else { container.find("ul li:first-child").addClass("selected"); } } else if (e.key == "ArrowUp") { if (container.find("ul li:visible").index(container.find("ul li.selected")) > 0) { container.find("ul li.selected").removeClass("selected").prevAll().not('[style*="display: none"]').first().addClass("selected"); } } else if (e.key == "Enter") { container.find("input").val(container.find("ul li.selected").text()).blur(); onSelect(container.find("ul li.selected").text()) } container.find("ul li.selected")[0].scrollIntoView({ behavior: "smooth", }); } function onSelect(val) { (val) } $(".searchable input").focus(function () { $(this).closest(".searchable").find("ul").show(); $(this).closest(".searchable").find("ul li").show(); }); $(".searchable input").blur(function () { let that = this; setTimeout(function () { $(that).closest(".searchable").find("ul").hide(); }, 300); }); $(document).on('click', '.searchable ul li', function () { $(this).closest(".searchable").find("input").val($(this).text()).blur(); onSelect($(this).text()) }); $(".searchable ul li").hover(function () { $(this).closest(".searchable").find("ul li.selected").removeClass("selected"); $(this).addClass("selected"); }); $(document).ready(function () { $(".selectItem").click(function () { var itemValu = $(this).val(); $("#vendor").val(itemValu); }); }); // new booking with notification sound function removebooking(id) { $.ajax({ type: 'POST', url: "check_new_booking.php", data: { 'booking_id': id }, success: function (response) { console.log(response); location.reload(); } }); } function get_role_data(booking_id) { $('#bookID').text('C4U' + booking_id); $.ajax({ url: "get_role_data.php", type: "POST", data: { booking_id: booking_id, }, success: function (response) { var data = JSON.parse(response); var table = $('#role_data_modal tbody'); table.empty(); for (var i = 0; i < data.length; i++) { var role_name = data[i].role_name ? data[i].role_name : 'Master Admin'; var row = '<tr>'; row += '<td>' + data[i].user_name + '</td>'; row += '<td>' + role_name + '</td>'; row += '<td>' + data[i].type + '</td>'; row += '</tr>'; table.append(row); } $('#view_role_modal').modal('show'); } }) } $(document).ready(function () { $('[data-toggle="tooltip"]').tooltip(); }); function comment_box(booking_id, comment) { $('#comment_booking_id').val(booking_id); $('#comment_field').val(comment); } $("#comment_form").submit(function (e) { e.preventDefault(); $("#loader").show(); $.ajax({ type: "POST", url: "ajax_booking_comment.php", data: new FormData(this), contentType: false, cache: false, processData: false, success: function (data) { $("#loader").hide(); $('#comment_modal').modal('hide'); if (data == "ok") { $("#msg").addClass(" alert-success"); $("#msg").css('display', 'block'); $("#msg").text("Succes! Comment added successfully.") setTimeout(function () { location.reload() }, 2000) } else { $("#msg").addClass(" alert-danger"); $("#msg").show(); $("#msg").text("Something wrong!..."); } } }); }) function customer_detail_hide_show(booking_id, status) { $("#loader").show(); if (status == 0) { status = 1; } else { status = 0; } $.ajax({ type: "POST", url: "ajax_booking_comment.php", data: { bk_id: booking_id, status: status, }, success: function (data) { $("#loader").hide(); $('#comment_modal').modal('hide'); if (data.trim() === "ok") { $("#msg").removeClass("alert-danger").addClass("alert-success"); $("#msg").css('display', 'block').text("Success! Comment added successfully."); setTimeout(function () { location.reload(); }, 2000); } else { $("#msg").removeClass("alert-success").addClass("alert-danger"); $("#msg").show().text("Something went wrong! Please try again."); } } }); } </script>