-
Notifications
You must be signed in to change notification settings - Fork 0
/
ajax_delete.php
32 lines (26 loc) · 1.05 KB
/
ajax_delete.php
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
<?php
session_start();
include_once "management/includes/pro_api_db.php";
$commonFunObj = new CommonFunctions();
if(isset($_POST['action']) && $_POST['action']=="categoryDel"){
$category_id = isset($_POST['category_id'])?add_slashes($_POST['category_id']):'';
$commonFunObj->deleteRecord("category","id",$category_id);
echo"succ";
exit();
}
if(isset($_POST['action']) && $_POST['action']=="subcategoryDel"){
$subcategory_id = isset($_POST['subcategory_id'])?add_slashes($_POST['subcategory_id']):'';
$commonFunObj->deleteRecord("subcategory","id",$subcategory_id);
echo"succ";
exit();
}
if(isset($_POST['action']) && $_POST['action']=="productDel"){
$productId = isset($_POST['productId'])?add_slashes($_POST['productId']):'';
$commonFunObj->deleteRecord("product","id",$productId);
$commonFunObj->deleteRecord("product_description","product_id",$productId);
$commonFunObj->deleteRecord("upload_pdf","product_id",$productId);
$commonFunObj->deleteRecord("product_cat_subcat","product_id",$productId);
echo"succ";
exit();
}
?>