-
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) · 879 Bytes
/
productBlockProcess.php
File metadata and controls
26 lines (22 loc) · 879 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 "connection.php";
if(isset($_GET["id"])){
$pid = $_GET["id"];
$product_rs = Database::search("SELECT * FROM `product` WHERE `id`='".$pid."'");
$product_num = $product_rs->num_rows;
if($product_num == 1){
$product_data = $product_rs->fetch_assoc();
if($product_data["status_status_id"] == 1){
Database::iud("UPDATE `product` SET `status_status_id`='2' WHERE `id`='".$pid."'");
echo ($product_data["title"]." has been deactivated.");
}else if($product_data["status_status_id"] == 2){
Database::iud("UPDATE `product` SET `status_status_id`='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.");
}
?>