-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproductBlockProcess.php
More file actions
35 lines (22 loc) · 866 Bytes
/
productBlockProcess.php
File metadata and controls
35 lines (22 loc) · 866 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
27
28
29
30
31
32
33
34
35
<?php
include "connection.php";
if(isset($_GET["id"])){
$product_id = $_GET["id"];
$product_rs = Database::search("SELECT * FROM `product` WHERE `id` = '".$product_id."' ");
if($product_rs->num_rows == 1){
$product_data = $product_rs->fetch_assoc();
$status = $product_data["status_status_id"];
if($status == 1){
Database::iud("UPDATE `product` SET `status_status_id` = '2' WHERE `id` = '".$product_id."' ");
echo($product_data["title"]." has been DEACTIVATED");
}else if($status == 2){
Database::iud("UPDATE `product` SET `status_status_id` = '1' WHERE `id` = '".$product_id."' ");
echo($product_data["title"]." has been Activated");
}
}else{
echo("Invalid Product ID ");
}
}else{
echo("Something went wrong.Try again later");
}
?>