📁
SKYSHELL MANAGER-
🛒
PHP v7.4.33
Create Folder
Create File
Current Path:
home
/
oshofree
/
public_html
/
chbluxuries.com
/
chb_data
/
Name
Size
Permissions
Actions
📁
..
-
0755
🗑️
🔒
📄
config.php
7.06 KB
0444
🗑️
⬇️
✏️
🔒
📄
error_log
252.54 KB
0644
🗑️
⬇️
✏️
🔒
Editing: fetchamount.php
<?php include "connect_to_mysqli.php"; $giftcard=$_POST['giftcard']; $order=$_POST['orderno']; $date=date("Y-m-d H:i:s"); $giftcard_amount = 0; // Select order $sql = "SELECT * from orders where orderid='$order'"; $sql2 = mysqli_query($con, $sql); while ($row = mysqli_fetch_array($sql2)) { $order_amount = $row["total_amount"]; } //check giftcard $sql = "SELECT * FROM giftcard WHERE giftcardno = '$giftcard'"; $result = mysqli_query($conn, $sql); if (mysqli_num_rows($result) > 0) { while ($row = mysqli_fetch_array($result)) { $giftcard_amount=$row['amount_left']; }} // Check for any pending transaction $sqb = "SELECT * FROM giftcard_history WHERE giftcardno='$giftcard' AND status='processing'"; $results = mysqli_query($conn, $sqb); if (mysqli_num_rows($results) > 0) { while ($rows = mysqli_fetch_array($results)) { $giftcard_amount = $rows['amount_left']; } } $amount_left=0; $submit = mysqli_query($conn,"insert into giftcard_history(giftcardno,orderid,amount_deducted,amount_left,date,status,description) values ('$giftcard','$order','$giftcard_amount','$amount_left','$date','processing','Chb Nail Shop')") or die ('Could not connect: ' .mysqli_error($conn)); $theamount = $order_amount - $giftcard_amount; echo $theamount; ?>
💾 Save Changes