[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: pos.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 = 'Shop POS'; $message = ""; $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(isset($_POST['addqty'])){ $qty = mysqli_real_escape_string($new,$_POST['qty']); $id = mysqli_real_escape_string($new,$_POST['id']); $updateqty = "UPDATE cart SET qty = '{$qty}'WHERE id = '{$id}'"; $qty_con = mysqli_query($new,$updateqty); $message = '<script> $(document).ready(function(){ swal("Success!", "Item price updated from cart", "success");}); </script>'; } if(isset($_GET['cartid'])){ $Cid = $_GET['cartid']; $stmt = $con->prepare("DELETE FROM cart where id = ? "); $stmt->execute(array($Cid)); // $message = '<script> $(document).ready(function(){ // swal("Success!", "Item deletd from cart", "success");}); </script>'; } if(isset($_POST['addtocart'])){ $pro_id = mysqli_real_escape_string($new,$_POST['pro_id']); $qty = mysqli_real_escape_string($new,$_POST['qty']); $product_name = mysqli_real_escape_string($new,$_POST['product_name']); $product_price = mysqli_real_escape_string($new,$_POST['product_price']); if(!$message){ $cartInserr = "INSERT INTO cart (pro_id,pro_name,price,qty,user_id) VALUES ('".$pro_id."','".$product_name."','".$product_price."','".$qty."','".$shopname."')"; $cartCon = mysqli_query($new,$cartInserr); $message = '<script> $(document).ready(function(){ swal("Success!", "Item is added to cart", "success");}); </script>'; } } if(isset($_POST['add_new_service'])) { $buy_id = test_input($_POST['buy_id']); $amount_paid = test_input($_POST['amount_paid']); $payment_mode = test_input($_POST['payment_mode']); $discount = test_input($_POST['discount']); $date = date("Y-m-d"); $total = test_input($_POST['total']); if(empty($discount)){ $dis = 0; }else { $dis = $discount; } $pro_id = $_POST['ppro_id']; $qty = $_POST['qqty']; $amount = $_POST['amount']; if(!empty($pro_id )){ $stmt_appointment = mysqli_query($new,"insert into product_sales(buy_id,discount,total_amount,amount_paid,payment_mode,sold_date,business_name)values('$buy_id','$dis','$total','$amount_paid','$payment_mode','$date','$shopname')"); $sales_id = mysqli_insert_id($new); for ($i=0; $i < count($pro_id) ; $i++) { $pro_idd = $pro_id[$i]; $qtyy = $qty[$i]; $amountt = $amount[$i]; $xy = "INSERT INTO invoice_order_item (sales_id,pro_id,qty,amount) VALUES ('$sales_id','$pro_idd','$qtyy','$amountt')"; $x = mysqli_query($new,$xy); $stmtt = mysqli_query($new,"Select qty FROM products WHERE pro_id = '$pro_idd'"); $row = mysqli_fetch_array($stmtt); $dbqty = $row['qty']; $remain = $dbqty - $qtyy; $stmt = $con->prepare("update products set qty = ? where pro_id = ? "); $stmt->execute(array($remain,$pro_idd)); } $del = "DELETE FROM cart WHERE user_id = '$shopname'"; $l = mysqli_query($new,$del); //header("location:pos"); $message = '<script> $(document).ready(function(){ swal("Success!", "Payment made successfully", "success");}); </script>'; } else {} } ?> <!DOCTYPE HTML> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <title><?php echo $shopname;?> || <?php echo $pageTitle1 ;?></title> <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 type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.3.1/js/bootstrap-tooltip.js"></script> <script src='https://unpkg.com/sweetalert/dist/sweetalert.min.js'></script> <!-- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/chosen/1.5.1/chosen.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.4/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/chosen/1.5.1/chosen.jquery.min.js"></script> --> <!-- jQuery --> <!-- Bootstrap4 files--> <link href="asset1/css/bootstrap.css" rel="stylesheet" type="text/css"/> <link href="asset1/css/ui.css" rel="stylesheet" type="text/css"/> <link href="asset1/fonts/fontawesome/css/fontawesome-all.min.css" type="text/css" rel="stylesheet"> <link href="asset1/css/OverlayScrollbars.css" type="text/css" rel="stylesheet"/> <style> .avatar { vertical-align: middle; width: 35px; height: 35px; border-radius: 50%; } .bg-default, .btn-default{ background-color: #f2f3f8; } .btn-error{ color: #ef5f5f; } </style> <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: 90px; height: 90px; animation: spin 2s linear infinite; } @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } </style> <!-- custom style --> </head> <body> <div id="preloader"> <div id="loader"></div> </div> <section class="header-main"> <div class="container"> <div class="row align-items-center"> <div class="col-lg-3"> <div class="brand-wrap"> <a href="product-sales"><img class="logo" src="../assets/logo1.png"></a> <h2 class="logo-text">POS</h2> </div> <!-- brand-wrap.// --> </div> <div class="col-lg-6 col-sm-6"> <!-- <form action="#" class="search-wrap"> <div class="input-group"> <input type="text" class="form-control" placeholder="Search"> <div class="input-group-append"> <button class="btn btn-primary" type="submit"> <i class="fa fa-search"></i> </button> </div> </div> </form> --> </div> <!-- col.// --> <div class="col-lg-3 col-sm-6"> <div class="widgets-wrap d-flex justify-content-end"> <div class="widget-header"> <li class="list-inline-item"> <a href="#" class="btn btn-success" style="width:35px;height: 35px;" data-toggle="modal" data-target=".bd-example-modal-lgclose" data-toggle="tooltip" title="Today sales" data-placement="top"><i class="fa fa-heart" aria-hidden="true"></i> </a> </li> <li class="list-inline-item" data-toggle="tooltip" title="Alltime service sales"> <a href="#" class="btn btn-secondary" style="width:35px;height: 35px;" data-toggle="modal" data-target=".bd-example-modal-lgalltime" data-placement="top"><i class="fa fa-heart" aria-hidden="true"></i> </a> </li> <li class="list-inline-item" data-toggle="tooltip" title="Product sales"> <a href="pos" class="btn btn-primary" style="width:35px;height: 35px;" data-placement="top"> <i class="fa fa-user"></i> </a> </li> </div> <!-- widget .// --> <div class="widget-header dropdown"> <a href="#" class="ml-3 icontext" data-toggle="dropdown" data-offset="20,10"> <img src="assets/images/users/avatar-2.jpg" class="avatar" alt=""> </a> <div class="dropdown-menu dropdown-menu-right"> <a class="dropdown-item" href="logout"><i class="fa fa-sign-out-alt"></i> Logout</a> </div> <!-- dropdown-menu .// --> </div> <!-- widget dropdown.// --> </div> <!-- widgets-wrap.// --> </div> <!-- col.// --> </div> <!-- row.// --> </div> <!-- container.// --> </section> <!-- <section class="header-main"> <div class="container"> <div class="row align-items-center"> <div class="col-lg-3"> <div class="brand-wrap"> <a href="#" class="btn btn-primary m-btn m-btn--icon m-btn--icon-only"> <i class="fa fa-home"></i> </a> </div> </div> <div class="col-lg-3 col-sm-6"> <div class="widgets-wrap d-flex justify-content-end"> <div class="widget-header" style="float:right;"> <a href="#" class="icontext"> <li class="list-inline-item"> <a href="#" class="btn btn-success" style="width:35px;height: 35px;" data-toggle="modal" data-target=".bd-example-modal-lgclose" data-toggle="tooltip" title="Today sales" data-placement="top"><i class="fa fa-heart" aria-hidden="true"></i> </a> </li> <li class="list-inline-item" data-toggle="tooltip" title="Alltime service sales"> <a href="#" class="btn btn-secondary" style="width:35px;height: 35px;" data-toggle="modal" data-target=".bd-example-modal-lgalltime" data-placement="top"><i class="fa fa-heart" aria-hidden="true"></i> </a> </li> <li class="list-inline-item" data-toggle="tooltip" title="Product sales"> <a href="pos" class="btn btn-primary" style="width:35px;height: 35px;" data-placement="top"> <i class="fa fa-user"></i> </a> </li> </div> <div class="widget-header dropdown"> <div class="dropdown-menu dropdown-menu-right"> <a class="dropdown-item" href="#"><i class="fa fa-sign-out-alt"></i> Logout</a> </div> </div> </div> </div> </div> </div> </section> --> <section class="section-content padding-y-sm bg-default"> <div class="container-fluid"> <div class="row"> <div class="col-md-8 card padding-y-sm card "> <ul class="nav bg radius nav-pills nav-fill mb-3 bg" role="tablist"> <div class="input-group input-group-lg"> <input type="text" class="form-control" id="search_text" name="search_text" placeholder="Search..."> <div class="input-group-append"> <button class="btn btn-primary"> <i class="fa fa-search"></i> </button> </div> </div> </ul> <?php if($message != "") { echo ($message) ; } ?> <div class="row"> <?php $output = ''; if(isset($_POST["query"])) { $search = mysqli_real_escape_string($new, $_POST["query"]); $query = "SELECT product_name,price,qty,business_name FROM products WHERE product_name LIKE '$search%' OR price LIKE '$search%' OR qty LIKE 'search%' AND qty > 0 AND business_name = '$shopname'"; } else { $query = " SELECT * FROM products WHERE business_name = '$shopname' AND qty > 0 order by product_name"; } $result = mysqli_query($new, $query); if(mysqli_num_rows($result) > 0) { while($row = mysqli_fetch_array($result)) {?> <div class="col-md-3"> <figure class="card card-product" style="height:250px"> <span class="badge-new"> NEW </span> <div class="img-wrap"> <img src="assets/images/pimage.svg" style="width: 130px;height: 130px;"> </div> <form method="POST" > <figcaption class="info-wrap"> <a href="#" class="title"><?php echo $row['product_name'];?></a> <input type="hidden" name="pro_id" value="<?php echo $row['pro_id'];?>"> <input type="hidden" name="qty" value="1"> <input type="hidden" name="product_name" value="<?php echo $row['product_name'];?>"> <input type="hidden" name="product_price" value="<?php echo $row['price'];?>"> <div class="action-wrap"> <button class="btn btn-primary btn-sm float-right" name="addtocart" id="submitButton"> <i class="fa fa-cart-plus"></i> Add </button> <div class="price-wrap h6"> <span class="price-new"><?php echo number_format($row['price'],2);?></span> <del class="price-old"><?php echo 'QTY'.'-'.$row['qty']?></del> </div> <!-- price-wrap.// --> </div> <!-- action-wrap --> </figcaption> </form> </figure> <!-- card // --> </div> <?php }?> <?php } else { echo "<h6 class='text-danger text-center mt-6'style='float:right'>No product found</h6>"; } ?> </div> </div> <div class="col-md-4"> <div class="card"> <span id="cart"> <table class="table table-hover shopping-cart-wrap"> <thead class="text-muted"> <tr> <th scope="col">Item</th> <th scope="col" width="120">Qty</th> <th scope="col" width="250">Price</th> <th scope="col" width="250">Total</th> <th scope="col" class="text-right" width="100">Delete</th> </tr> </thead> <tbody> <?php $sel = mysqli_query($new,"SELECT * from cart WHERE user_id = '$shopname' order by id DESC"); while($cart_row = mysqli_fetch_array($sel)){ $total = $cart_row['qty'] * $cart_row['price'].''.$qurtyCurrency; ?> <tr> <td> <figure class="media"> <figcaption class="media-body"> <h6 class="title"><?php echo $cart_row['pro_name'];?></h6> </figcaption> </figure> </td> <td class="text-center"> <a href="javascript:;" class="addAttrr" data-toggle="modal" data-target="#qtyModal" data-id="<?php echo $cart_row['id']; ?>"><?php echo $cart_row['qty'];?></a> </td> <td> <?php echo $cart_row['price'].' '.$qurtyCurrency;?> <?php $ftotal+=$total; ?> </td> <!-- <td width="100"> <var><?php echo $cart_row['price'];?></var> </td> --> <td width="100"> <var><?php echo $cart_row['price'] * $cart_row['qty'].' '.$qurtyCurrency;?></var> </td> <td class="text-right"> <a href="pos?cartid=<?= $cart_row['id'];?>" class="btn btn-outline-danger"> <i class="fa fa-trash"></i></a> </td> <?php }?> </tr> </tbody> </table> </span> </div> <!-- card.// --> <div class="box"> <dl class="dlist-align"> <dt></dt> </dl> <dl class="dlist-align"> <dt>Sub Total:</dt> <dd class="text-right"><?php echo number_format($ftotal,2).' '.$qurtyCurrency;?></dd> </dl> <!-- <dl class="dlist-align"> <dt>Discount</dt> <dd class="text-right b"><a href="#">0.00</a></dd> </dl> --> <!-- <dl class="dlist-align"> <dt>Grand Total</dt> <dd class="text-right b">0.00</dd> </dl> --> <div class="row"> <div class="col-md-6"> <br /><br /> <a data-toggle="modal" href="#payment" class="btn btn-primary btn-lg btn-block">Payment</a> </div> </div> </div> <!-- box.// --> </div> </div> </div><!-- container // --> <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" enctype="multipart/form-data" class="validate-form" role="form" novalidate> <div class="modal-content modal-md"> <div class="modal-header"> <h4 class="modal-title" id="vcenter">Add Quantity</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="qty"> <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">Add</button> </div> </div> </form> <!-- /.modal-content --> </div> <!-- /.modal-dialog --> </div> <div class="modal fade in" id="payment" tabindex="-1" role="dialog" aria-labelledby="s" data-backdrop="static" aria-hidden="true"> <div class="modal-dialog modal-lg"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true"><i class="fa fa-2x">×</i></span><span class="sr-only">Close</span></button> <center><h4>Record Payment</h4></center> </div> <div class="modal-body" id="payment_content"> <form method="post" class="validate-form" role="form" novalidate> <div class="row"> <div class="col-md-12 col-sm-12"> <div class="clearfir"></div> <div id="payments"> <div class="well well-sm well_1"> <div class="payment"> <div class="row"> <div class="col-sm-6"> <div class="form-group"> <label for="amount_1">Select Customer</label> <select name="buy_id" class="pa form-control" required> <option value="">Select</option> <?php $select = mysqli_query($new,"SELECT * FROM clients WHERE business_name = '$shopname' ORDER BY first_name,last_name"); while ($c_row = mysqli_fetch_array($select)) { ?> <option value="<?php echo $c_row['client_id'];?>"> <?php echo $c_row['first_name'].' '.$c_row['last_name'];;?></option> <?php }?> </select> </div> </div> <div class="col-sm-6"> <div class="form-group"> <label for="payment_note">Amount Paid</label> <input type="number" name="amount_paid" class="pa form-control kb-pad1 amount" required> </div> </div> <div class="col-sm-6"> <div class="form-group"> <label for="amount_1">Payment Type</label> <select name="payment_mode" required class="pa form-control kb-pad1 amount"> <option value="">Select</option> <option value="Cash">Cash</option> <option value="Momo/Cash">Momo/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="col-sm-6"> <div class="form-group"> <div class="form-group"> <label for="payment_note">Discount(%)</label> <input type="number" name="discount" class="pa form-control kb-pad1 amount"> </div> </div> </div> </div> </div> </div> <div id="multi-payment"></div> <div style="clear:both; height:15px;"></div> <div class="card"> <table class="table shopping-cart-wrap"> <tbody> <tr> <?php $cartt = "SELECT * FROM cart WHERE user_id = '$shopname' ORDER BY id DESC"; $cart_con = mysqli_query($new,$cartt); while ($cart_roww = mysqli_fetch_array($cart_con)) { $total = $cart_roww['qty'] * $cart_roww['price'] ; ?> <td> <figure class="media"> <figcaption class="media-body"> <h6 class="title text-truncate"> <?php echo $cart_roww['pro_name'];?> </h6> </figcaption> </figure> </td> <td class="text-center"> <a href="javascript:;" class="addAttr" data-toggle="modal" data-target="#qtyModal" data-id="<?php echo $cart_roww['id']; ?>"><?= $cart_roww['qty'];?></a> </td> <td> <?php echo $cart_roww['price'];?> </td> <input type="hidden" name="ppro_id[]" value="<?php echo $cart_roww['pro_id'];?>"> <input type="hidden" name="qqty[]" value="<?php echo $cart_roww['qty'];?>"> <input type="hidden" name="amount[]" value="<?php echo $total;?>"> <td> <?= $total;?> <?php $tt+=$total; ?> <input type="hidden" name="total" value="<?php echo $tt;?>"> </td> <td class="text-right"> <a href="pos?cartid=<?= $cart_roww['id'];?>" class="btn btn-outline-danger"> <i class="fa fa-trash"></i></a> </td> </tr> <?php }?> </tbody> </table> <dt>Total: </dt> <dd class="text-right h4 b"> <?php echo number_format($tt,2).' '.$qurtyCurrency; ?></dd> </div> <!-- card.// --> </div> </div> </div> <br /><br/> <button type="submit" name="add_new_service" class="btn btn-primary">Submit</button> <button type="button" class="btn btn-success waves-effect waves-light" data-toggle="modal" data-target=".bd-example-modal-lg">Add New Client</button> </form> </div> </div> </div> <div class="modal fade bd-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true"> <div class="modal-dialog modal-lg"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title h4" id="myLargeModalLabel">Add New Customer</h5> <button type="button" class="close waves-effect waves-light" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <div class="modal-body" data-ng-form="newcustomer"> <div class="setting-steps"> <form id="add_category_bttnn"> <div class="row"> <div class="col-sm-4"> <div class="form-group"> <label for="exampleInputEmail1" class="form-label">Phone number</label> <input type="text" class="form-control" id="validationTooltip03" name="phone_number" required> </div> </div> <div class="col-sm-4"> <div class="form-group"> <label for="exampleInputEmail1" class="form-label">First Name<span class="req">*</span></label> <input type="text" class="form-control" id="customerName" name="first_name" required > </div> </div> <div class="col-sm-4"> <div class="form-group"> <label for="exampleInputEmail1" class="form-label">Last Name</label> <input type="text" class="form-control" id="lastName" name="last_name" required> </div> </div> </div> <div class="row"> <div class="col-sm-4"> <div class="form-group"> <label class="form-label">DOB</label> <div class="input-group date dobWrap cal-container"> <input type="text" class="form-control" name="DOB" data-provide="datepicker" data-date-format="d-M"> </div> </div> </div> <div class="col-sm-4"> <div class="form-group"> <label for="exampleInput" class="form-label">Email ID</label> <input type="email" class="form-control" id="email" name="email"> </div> </div> <div class="col-sm-4"> <div class="form-group"> <label class="form-label">Gender</label> <div class="inline-radio tbl"> <div class="radio"> <input type="radio" id="male" name="gender" value="male"> <label for="male">Male</label> </div> <div class="radio"> <input type="radio" id="female" name="gender" value="female"> <label for="female">Female</label> </div> </div> </div> </div> </div> <div class="row"> <div class="col-sm-4"> <div class="form-group"> <label class="form-label">Address</label> <input type="text" class="form-control" name="address"> </div> </div> <div class="col-sm-4"> <div class="form-group"> <label class="form-label">Anniversary</label> <div class="input-group date anniWrap cal-container"> <input type="text" class="form-control" name="anniversary" data-provide="datepicker" data-date-format="d-M"> </div> </div> </div> <div class="col-sm-4"> <div class="form-group"> <label for="exampleInputEmail1" class="form-label">Location</label> <input type="text" class="form-control" id="location" name="location"> </div> </div> </div> <button type="submit" class="btn btn-success">Submit</button> </form> </div> </div> </div> </div> </div> </section> <script src="asset1/js/jquery-2.0.0.min.js" type="text/javascript"></script> <script src="asset1/js/bootstrap.bundle.min.js" type="text/javascript"></script> <script src="asset1/js/OverlayScrollbars.js" type="text/javascript"></script> <div class="modal fade bd-example-modal-lgclose" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true"> <div class="modal-dialog modal-lg"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="exampleModalLabel">Today's Sales</h5> <button type="button" class="close waves-effect waves-light" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <div class="modal-body"> <div class="table-responsive-sm"> <table class="table table-striped"> <tbody> <tr> <td class="center">Cash Payment</td> <td class="left strong"></td> <td class="left"></td> <?php $tdate = date('Y-m-d'); $stmtServices = $con->prepare("SELECT * FROM product_sales WHERE payment_mode = 'Cash' and sold_date = '$tdate' and business_name = ?"); $stmtServices->execute(array($shopname)); $rowsServices = $stmtServices->fetchAll(); foreach($rowsServices as $rowsService) { $price = $rowsService['total_amount']; $disc = $rowsService['discount']; $tdis = ($disc / 100) * $price; $totalAmt = $price - $tdis; $CashK +=$totalAmt; } ?> <td class="right"></td> <td class="center"></td> <td class="right"><?php echo $cash = number_format($CashK,2).' '.$qurtyCurrency;?></td> </tr> <tr> <td class="center">Cash/Momo(MTN/VODA) Payment</td> <td class="left strong"></td> <td class="left"></td> <?php $tdate = date('Y-m-d'); $stmtServices = $con->prepare("SELECT * FROM product_sales WHERE payment_mode = 'Momo/Cash' and sold_date = '$tdate' and business_name = ?"); $stmtServices->execute(array($shopname)); $rowsServices = $stmtServices->fetchAll(); foreach($rowsServices as $rowsService) { $price = $rowsService['total_amount']; $disc = $rowsService['discount']; $tdis = ($disc / 100) * $price; $totalAmt = $price - $tdis; $Momo_Cash +=$totalAmt; } ?> <td class="right"></td> <td class="center"></td> <td class="right"><?php echo $momocash = number_format($Momo_Cash,2).' '.$qurtyCurrency;?></td> </tr> <tr> <td class="center">Momo(MTN) Payment</td> <td class="left strong"></td> <td class="left"></td> <?php $tdate = date('Y-m-d'); $stmtServices = $con->prepare("SELECT * FROM product_sales WHERE payment_mode = 'Momo(MTN)' and sold_date = '$tdate' and business_name = ?"); $stmtServices->execute(array($shopname)); $rowsServices = $stmtServices->fetchAll(); foreach($rowsServices as $rowsService) { $price = $rowsService['total_amount']; $disc = $rowsService['discount']; $tdis = ($disc / 100) * $price; $totalAmt = $price - $tdis; $momomtn +=$totalAmt; } ?> <td class="right"></td> <td class="center"></td> <td class="right"><?php echo $MTN = number_format($momomtn,2).' '.$qurtyCurrency;?></td> </tr> <tr> <td class="center">Momo(voda) Payment</td> <td class="left strong"></td> <td class="left"></td> <?php $tdate = date('Y-m-d'); $stmtServices = $con->prepare("SELECT * FROM product_sales WHERE payment_mode = 'Momo(Voda)' and sold_date = '$tdate' and business_name = ?"); $stmtServices->execute(array($shopname)); $rowsServices = $stmtServices->fetchAll(); foreach($rowsServices as $rowsService) { $price = $rowsService['total_amount']; $disc = $rowsService['discount']; $tdis = ($disc / 100) * $price; $totalAmt = $price - $tdis; $momovoda +=$totalAmt; } ?> <td class="right"></td> <td class="center"></td> <td class="right"><?php echo $voda = number_format($momovoda,2).' '.$qurtyCurrency;?></td> </tr> <tr> <td class="center">Bank Transfer</td> <td class="left strong"></td> <td class="left"></td> <?php $tdate = date('Y-m-d'); $stmtServices = $con->prepare("SELECT * FROM product_sales WHERE payment_mode = 'Bank Transfer' and sold_date = '$tdate' and business_name = ?"); $stmtServices->execute(array($shopname)); $rowsServices = $stmtServices->fetchAll(); foreach($rowsServices as $rowsService) { $price = $rowsService['total_amount']; $disc = $rowsService['discount']; $tdis = ($disc / 100) * $price; $totalAmt = $price - $tdis; $momotransfer +=$totalAmt; } ?> <td class="right"></td> <td class="center"></td> <td class="right"><?php echo $banks = number_format($momotransfer,2).' '.$qurtyCurrency;?></td> </tr> <tr> <td class="center strong"><b>Total Cash</b></td> <td class="left strong"></td> <td class="left"></td> <td class="right"></td> <td class="center"></td> <td class="right"><?php echo $cards = number_format($momotransfer+$momovoda+$momomtn+$Momo_Cash+$CashK,2).' '.$qurtyCurrency;?></td> </tr> </tbody> </table> </div> </div> </div> </div> </div> <div class="modal fade bd-example-modal-lgalltime" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true"> <div class="modal-dialog modal-lg"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="exampleModalLabel">All time Sales</h5> <button type="button" class="close waves-effect waves-light" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <div class="modal-body"> <div class="table-responsive-sm"> <table class="table table-striped"> <tbody> <tr> <td class="center">Cash Payment</td> <td class="left strong"></td> <td class="left"></td> <?php $tdate = date('Y-m-d'); $stmtServices = $con->prepare("SELECT * FROM product_sales WHERE payment_mode = 'Cash' and business_name = ?"); $stmtServices->execute(array($shopname)); $rowsServices = $stmtServices->fetchAll(); foreach($rowsServices as $rowsService) { $price = $rowsService['total_amount']; $disc = $rowsService['discount']; $tdis = ($disc / 100) * $price; $totalAmt = $price - $tdis; $CashK1 +=$totalAmt; } ?> <td class="right"></td> <td class="center"></td> <td class="right"><?php echo $cash = number_format($CashK1,2).' '.$qurtyCurrency;?></td> </tr> <tr> <td class="center">Cash/Momo(MTN/VODA) Payment</td> <td class="left strong"></td> <td class="left"></td> <?php $tdate = date('Y-m-d'); $stmtServices = $con->prepare("SELECT * FROM product_sales WHERE payment_mode = 'Momo/Cash' and business_name = ?"); $stmtServices->execute(array($shopname)); $rowsServices = $stmtServices->fetchAll(); foreach($rowsServices as $rowsService) { $price = $rowsService['total_amount']; $disc = $rowsService['discount']; $tdis = ($disc / 100) * $price; $totalAmt = $price - $tdis; $Momo_Cash1 +=$totalAmt; } ?> <td class="right"></td> <td class="center"></td> <td class="right"><?php echo $momocash = number_format($Momo_Cash1,2).' '.$qurtyCurrency;?></td> </tr> <tr> <td class="center">Momo(MTN) Payment</td> <td class="left strong"></td> <td class="left"></td> <?php $tdate = date('Y-m-d'); $stmtServices = $con->prepare("SELECT * FROM product_sales WHERE payment_mode = 'Momo(MTN)' and business_name = ?"); $stmtServices->execute(array($shopname)); $rowsServices = $stmtServices->fetchAll(); foreach($rowsServices as $rowsService) { $price = $rowsService['total_amount']; $disc = $rowsService['discount']; $tdis = ($disc / 100) * $price; $totalAmt = $price - $tdis; $momomtn1 +=$totalAmt; } ?> <td class="right"></td> <td class="center"></td> <td class="right"><?php echo $MTN = number_format($momomtn1,2).' '.$qurtyCurrency;?></td> </tr> <tr> <td class="center">Momo(voda) Payment</td> <td class="left strong"></td> <td class="left"></td> <?php $tdate = date('Y-m-d'); $stmtServices = $con->prepare("SELECT * FROM product_sales WHERE payment_mode = 'Momo(Voda)' and business_name = ?"); $stmtServices->execute(array($shopname)); $rowsServices = $stmtServices->fetchAll(); foreach($rowsServices as $rowsService) { $price = $rowsService['total_amount']; $disc = $rowsService['discount']; $tdis = ($disc / 100) * $price; $totalAmt = $price - $tdis; $momovoda1 +=$totalAmt; } ?> <td class="right"></td> <td class="center"></td> <td class="right"><?php echo $voda = number_format($momovoda1,2).' '.$qurtyCurrency;?></td> </tr> <tr> <td class="center">Bank Transfer</td> <td class="left strong"></td> <td class="left"></td> <?php $tdate = date('Y-m-d'); $stmtServices = $con->prepare("SELECT * FROM product_sales WHERE payment_mode = 'Bank Transfer' and sold_date = '$tdate' and business_name = ?"); $stmtServices->execute(array($shopname)); $rowsServices = $stmtServices->fetchAll(); foreach($rowsServices as $rowsService) { $price = $rowsService['total_amount']; $disc = $rowsService['discount']; $tdis = ($disc / 100) * $price; $totalAmt = $price - $tdis; $momotransfer1 +=$totalAmt; } ?> <td class="right"></td> <td class="center"></td> <td class="right"><?php echo $banks = number_format($momotransfer1,2).' '.$qurtyCurrency;?></td> </tr> <tr> <td class="center strong"><b>Total Cash</b></td> <td class="left strong"></td> <td class="left"></td> <td class="right"></td> <td class="center"></td> <td class="right"><?php echo $cards = number_format($momotransfer1+$momovoda1+$momomtn1+$Momo_Cash1+$CashK1,2).' '.$qurtyCurrency;?></td> </tr> </tbody> </table> </div> </div> </div> </div> </div> <style type="text/css"> table { border-collapse: collapse; } td, th { padding: 20px 20px; } </style> <script type="text/javascript"> $(document).ready(function() { $('#add_category_bttnn').submit(function(event) { event.preventDefault(); $.ajax({ url: 'addCustomer.php', type: 'post', headers: {'X-CSRF-Token': $('#csrf_token').val()}, data: $('#add_category_bttnn').serialize(), dataType: 'json', success: function(response) { if (response.status == 'success') { swal("Success!", response.message, "success").then(() => { location.reload(); }); //window.location.href = response.redirect; $('#add_category_bttnn')[0].reset(); } else { swal("Error!", response.message, "error").then(() => { location.reload(); }); } } }); }); }); </script> <script> $(function() { $("#items").height(552); $("#items").overlayScrollbars({overflowBehavior : { x : "hidden", y : "scroll" } }); $("#cart").height(445); $("#cart").overlayScrollbars({ }); }); </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> $(document).ready(function(){ load_data(); function load_data(query) { $.ajax({ url:"Productfetch.php", method:"POST", data:{query:query}, success:function(data) { $('#showProduct').html(data); } }); } $('#search_text').keyup(function(){ var search = $(this).val(); if(search != '') { load_data(search); } else { load_data(); } }); }); </script> --> <script> function loadXMLDoc() { var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { document.getElementById("link_wrapper").innerHTML = this.responseText; } }; xhttp.open("GET", "loadCart.php", true); xhttp.send(); } setInterval(function(){ loadXMLDoc(); // 1sec },100); //window.onload = loadXMLDoc; </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(){ $(").chosen(); }); </script> --> <?php }?> </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.07 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