Initial commit

This commit is contained in:
ldy
2025-06-06 17:14:52 +08:00
parent 0465a9baef
commit f0aabfb5ac
91 changed files with 4466 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
<?php
include "../../ConnectDB.php";
session_start();
$username = mysqli_real_escape_string($conn, $_SESSION['username']);
$usertype = mysqli_real_escape_string($conn, $_SESSION['user_type']);
if(isset($_GET["name"], $_GET["quantity"])) {
$name = $_GET["name"];
$quantity = $_GET["quantity"];
if(($usertype == "seller" && $quantity >= 0 && $quantity <= 100) || ($usertype == "buyer" && $quantity >= 0)){
$add = "UPDATE $usertype SET $name = $quantity WHERE name='$username'";
$res = mysqli_query($conn, $add);
}
else{
echo "<script type='text/javascript'>
alert('Please input a valid amount of fruit!');
</script>";
}
}
header('Location: ../cart_index.php');
?>