-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproductBlockProcess.php
More file actions
26 lines (22 loc) · 863 Bytes
/
productBlockProcess.php
File metadata and controls
26 lines (22 loc) · 863 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
include "config.php";
if(isset($_GET["id"])){
$pid = $_GET["id"];
$product_rs = Database::search("SELECT * FROM `products` WHERE `id`='".$pid."'");
$product_num = $product_rs->num_rows;
if($product_num == 1){
$product_data = $product_rs->fetch_assoc();
if($product_data["status"] == 1){
Database::iud("UPDATE `products` SET `status`='2' WHERE `id`='".$pid."'");
echo ($product_data["title"]." has been deactivated.");
}else if($product_data["status"] == 2){
Database::iud("UPDATE `products` SET `status`='1' WHERE `id`='".$pid."'");
echo ($product_data["title"]." has been activated.");
}
}else{
echo ("Cannot find the product. Please try again later.");
}
}else{
echo ("Something went wrong.");
}
?>