[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: today-sales-old.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{ $pageTitle = 'Today Service Sales'; $shopname = $_SESSION['business_name_Xw211qAAsq4']; $currency = mysqli_query($new,"SELECT currency from barber_admin WHERE business_name = '$shopname'"); $fechC = mysqli_fetch_array($currency); $qurtyCurrency = $fechC['currency']; if($qurtyCurrency === "GHC"){ $mycureency = "₵"; } else { $mycureency = $qurtyCurrency ; } $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'])){ $empID = filter_input(INPUT_POST, 'empID', FILTER_SANITIZE_STRING); $empID = htmlspecialchars($empID, ENT_QUOTES, 'UTF-8'); $employee_id = filter_input(INPUT_POST, 'employee_id', FILTER_SANITIZE_STRING); $employee_id = htmlspecialchars($employee_id, ENT_QUOTES, 'UTF-8'); $stmt = $con->prepare("update appointments set employee_id = ? WHERE appointment_id = ? "); $stmt->execute(array($employee_id,$empID)); } if(isset($_POST['del'])){ $appDI = filter_input(INPUT_POST, 'appDI', FILTER_SANITIZE_STRING); $appDI = htmlspecialchars($appDI, ENT_QUOTES, 'UTF-8'); $stmt = $con->prepare("DELETE FROM appointments where appointment_id = ? "); $stmt->execute(array($appDI)); $stmtt = $con->prepare("DELETE FROM true_price where appointment_id = ? "); $stmtt->execute(array($appDI)); } } if(isset($_POST['addqty'])){ $price = mysqli_real_escape_string($new,$_POST['price']); $id = mysqli_real_escape_string($new,$_POST['id']); $updateqty = "UPDATE true_price SET price = '{$price}' WHERE service_id = '{$id}'"; $qty_con = mysqli_query($new,$updateqty); header('location: today-sales'); } ?> <!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" /> <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://code.jquery.com/jquery-3.6.4.min.js" integrity="sha256-oP6HI9z1XaZNBrJURtCoUT5SUnxFr8s3BzRl+cbzUq8=" crossorigin="anonymous"></script> <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; } @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } </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">Todays sales </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"> <a href="addSales?post=<?php echo sha1(rand(100,10000));?>" class="btn btn-primary waves-effect waves-light">Add Sales</a> <br /><br /> <div class="table-responsive"> <!-- <table id="basic-datatable" class="table table-hover table-striped table-bordered"> --> <table 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%">Discount</th> <th style="width:13%">Commission</th> <th>Net</th> <th style="width:15%">Information</th> <th>Manage</th> </thead> <tr> <?php $date = date("Y-m-d"); $stmt = $con->prepare("SELECT * FROM appointments a , clients c WHERE a.client_id = c.client_id AND a.canceled = 0 and a.status = 'offline' AND a.created = '$date' 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 s.service_name as service_name,sb.price as price,sb.service_id as sid 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 '<li class="list-inline-item" data-toggle="tooltip" title="Change Price"> <a href="javascript:;" class="addAttrr" data-toggle="modal" data-target="#qtyModal" data-id="'.$rowsService['sid'].'"> ch</a></li>'."<small>-".$rowsService['service_name'].'-'.$rowsService['price'].' '.$mycureency."</small>"; if (next($rowsServices)==true) echo " <br> "; } ?></td> <td><?php $stmtServices = $con->prepare("SELECT service_name,sum(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> "; $tt =$rowsService['price']; echo $Ttt = $tt.' '.$mycureency; } ?></td> <td class="py-0 px-1"> <small>Discount: <?php if(empty($service['discount'])){ 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).' '.$mycureency; ?> </small><br > <small>After Disc: <?php echo number_format($afterDis,2).' '.$mycureency; ?> </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, services_booked 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).' '.$mycureency; ?> </small> </td> <td> <?php echo $prof = number_format($afterDis-$commission,2).' '.$mycureency;?> </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="Receipt"> <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="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="Print receipt"> <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="Details"> <a href="#" data-toggle="modal" data-target="#<?php echo $print; ?>" data-placement="top"><i class="fa fa-users" style="color:brown"></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">Make Receipt</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" action="change-payment-status-offline.php"> <label for="category_name">Work Status</label> <br /> <input type="hidden" name="cat_name" value="<?php echo $printReceipt; ?>"> <select class="select2" name="active12" style="width: 330px;" required> <option value="">Select option</option> <option value="Yes">Done</option> <option value="Progress">Progress</option> <option value="Cancelled">Cancelled</option> </select> <br /><br /> <label for="client_id"> Paid by</label> <br /> <select class="select2" name="payment" style="width: 330px;" required> <option value="">Select option</option> <option value="Cash">Cash</option> <option value="Momo(MTN)">Momo(MTN)</option> <option value="Momo(Voda)">Momo(Voda)</option> <option value="Bank Transfer">Bank Transfer</option> <option value="Card payment">Card payment</option> </select> <br /><br /> <label for="client_id"> Discount(%)</label> <input type="number" name="discount_value" class="form-control" style="width: 330px;" value="<?php echo $service["discount"]; ?>"> </div> <label>Commission rate (%)</label> <select class="form-control" name="comm_id" style="width: 330px;"> <?php $active = 1; $stmt = $con->prepare("SELECT * FROM comm_rate WHERE business_name = ? and active = ? order by rate_id DESC"); $stmt->execute(array($shopname,$active)); $rows_categories = $stmt->fetchAll(); foreach($rows_categories as $category12) { if($category12['rate'] == $category12['rate']) { echo "<option value = '".$category12['rate']."' selected>"; echo $category12['rate']; echo "</option>"; } else { echo "<option value = '".$category12['rate']."'>"; echo $category12['rate']; echo "</option>"; } } ?> </select> <!-- <select class="form-control" name="comm_id" style="width: 330px;" value="<?php echo $service["comRate"]; ?>"> <option value="">Select option</option> <?php $active = 1; $stmt = $con->prepare("SELECT * FROM comm_rate WHERE business_name = ? and active = ? order by rate_id DESC"); $stmt->execute(array($shopname,$active)); $rows_categories = $stmt->fetchAll(); ?> <?php foreach($rows_categories as $service){ ?> <option value="<?php echo $service['rate'];?>"><?php echo $service['rate'];?> %</option> <?php }?> </select> --> </div> <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> </li> <div class="modal fade" id="<?php echo $print; ?>" tabindex="-1" role="dialog" aria-labelledby="<?php echo $print; ?>" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="row justify-content-center"> <div class="col-lg-12 col-xl-12"> <div class="card"> <div class="card-body p-12"> <h4>Service breakdown</h4> <h5><?php echo $shopname;?></h5> <table class="table border-bottom border-gray-200 mt-3"> <thead> <tr> <th scope="col" class="fs-sm text-dark text-uppercase-bold-sm px-0">Services</th> <th scope="col" class="fs-sm text-dark text-uppercase-bold-sm text-end px-0">Amount</th> </tr> </thead> <tbody> <tr> <?php $cnt = 1; foreach($rowsServiceser as $rowsService) {?> <td class="px-0"><?php echo "-".$rowsService['service_name']; if (next($rowsServiceser)==true); $ttT+=$rowsService['service_price']; ?></td> <td class="text-end px-0"><?php echo number_format($rowsService['service_price'],2) ;?></td> </tr> <?php }?> </tbody> </table> <div class="mt-5"> <div class="d-flex justify-content-end"> <p class="text-muted me-3"> Subtotal:</p> <span> <?php echo number_format($tt,2);?></span> </div> <div class="d-flex justify-content-end"> <p class="text-muted me-3"> Discoun: </p> <span> <?php echo $dds = number_format($service['discount'],1).'%'; $Disc = ($dds / 100) * $tt; $afterDis = $tt-$Disc; ?> </span> </div> <div class="d-flex justify-content-end"> <p class="text-muted me-3"> Disc Amt: </p> <span> <?php echo $Disc = number_format(($dds / 100) * $tt,2); ;?></span> </div> <div class="d-flex justify-content-end"> <p class="text-muted me-3"> After Disc: </p> <span> <?php // echo $Disc = number_format(($dds / 100) * $tt,2); echo $afterDis = number_format($tt-$Disc,2); ;?></span> </div> <div class="d-flex justify-content-end"> <p class="text-muted me-3"> ComRate: </p> <span> <?php echo $com = number_format($service['comRate'],1).'%'; ;?></span> </div> <div class="d-flex justify-content-end"> <p class="text-muted me-3"> ComRate Amt: </p> <span> <?php $percentage = $service['comRate']; echo $comm = ($percentage / 100) * $afterDis; ;?></span> </div> <div class="d-flex justify-content-end mt-3"> <h5 class="me-3">Grand Profit: </h5> <h5><b><?php echo number_format($afterDis - $comm,2);?></b></h5> </div> </div> </div> </div> </div> </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 = ?"); $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;"> <option value="">Select Employee</option> <?php foreach($rows_categories as $empid) {?> <option value ="<?php echo $empid['employee_id'];?>"> <?php echo $empid['first_name'].' '.$empid['last_name'];?> </option> <?php }?> </select> </div> <input type="hidden" name="empID" 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 --> <div id="qtyModal" class="modal fade" role="dialog" aria-labelledby="vcenter" aria-hidden="true"> <div class="modal-dialog modal-dialog-zoom modal-md"> <form method="post"> <div class="modal-content modal-md"> <div class="modal-header"> <h4 class="modal-title" id="vcenter">Change Price</h4> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> </div> <div class="modal-body"> <div class="form-group"> <input type="number" class="form-control" required name="price"> <input type="hidden" id="id" name="id" value="id"> </div> </div> <div class="modal-footer"> <button type="submit" name="addqty" class="btn btn-info waves-effect pull-right">Change</button> </div> </div> </form> </div> </div> <!-- 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> $('.addAttr').click(function() { var id = $(this).data('id'); $('#id').val(id); } ); </script> <script> $('.addAttrr').click(function() { var id = $(this).data('id'); $('#id').val(id); } ); </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.73 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