[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: Productfetch.php
<div class="row"> <?php include("../admin/db/db.php"); $shopname = $_SESSION['business_name_Xw211qAAsq4']; $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"; } $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" id="add_category_bttn"> <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" 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 // --> <!-- <figure class="card card-product" style="height: 200px;"> <div class="img-wrap"> <img src="asset1/images/brand.png"> </div> <figcaption class="info-wrap" style="height: 260px;"> <p class="title" style="font-size:15px;"><?php echo $row['product_name'].' -Qty'.$row['qty']?> </p> <div class="action-wrap"> <form method="POST" id="add_category_bttn"> <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'];?>"> <button class="btn btn-primary btn-sm float-right" id="submitButton"> <i class="fa fa-cart-plus"></i> Add </button> </form> <div class="price-wrap h5"> <span class="price-new" style="font-size:15px">ยข<?php echo number_format($row['price'],2);?></span> </div> </div> </figcaption> </figure> --> </div> <?php }?> <?php } else { echo "<h6 class='text-danger text-center mt-6'style='float:right'>No product found</h6>"; } ?> </div> <script type="text/javascript"> $(document).ready(function() { $('#add_category_bttn').submit(function(event) { event.preventDefault(); var submitButton = $('#submitButton'); submitButton.prop('disabled', true); // Disable the submit button $.ajax({ url: 'insertCart.php', type: 'post', headers: {'X-CSRF-Token': $('#csrf_token').val()}, data: $('#add_category_bttn').serialize(), dataType: 'json', success: function(response) { if (response.status == 'success') { swal("Success!", response.message, "success").then(() => { location.reload(); }); submitButton.prop('disabled', false); // Re-enable the submit button //window.location.href = response.redirect; $('#add_category_bttn')[0].reset(); } else { swal("Error!", response.message, "error").then(() => { location.reload(); }); submitButton.prop('disabled', false); // Re-enable the submit button } } }); }); }); </script>
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.06 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