芝麻web文件管理V1.00
编辑当前文件:/home/krishnamexports/public_html/panel/pages/product/subcategory.php
0) { echo '
Danger!
Slug Url Already Exist.
'; } else { $sql = mysqli_query($cn, "select * from `tbl_subcategory` where `name`='$name'"); if(mysqli_num_rows($sql)>0) { echo '
Danger!
Subcategory name already exists.
'; } else { $sqlSubject=mysqli_query ($cn, "insert into `tbl_subcategory` set `category_id`='$category_id', `name`='$name', `sort_order`='$sort_order', `status`='$status', `slug_url`='$slug_url'"); if ($sqlSubject) { echo '
Success!
Subcategory Added Successfully.
'; } else { echo '
Danger!
Subcategory Not Added. Try Again.
'; } } } } if(isset($_POST['edit'])) { $id = $_POST['id']; $category_id = $_POST['category_id']; $name = $_POST['name']; $sort_order = $_POST['sort_order']; $status = $_POST['status']; $slug_url = mysqli_real_escape_string($cn,$_POST['slug_url']); $sql = mysqli_query($cn, "select * from tbl_subcategory where id='$id'"); $sqlData = mysqli_fetch_array($sql); $sqlUrl = mysqli_query($cn, "select * from tbl_subcategory where slug_url='$slug_url' and id!='$id'"); if(mysqli_num_rows($sqlUrl)>0) { echo '
Danger!
Slug Url Already Exist.
'; } else { $sqlSubject = mysqli_query ($cn,"update `tbl_subcategory` SET `category_id`='$category_id', `name`='$name', `sort_order`='$sort_order', `status`='$status', `slug_url`='$slug_url' where `id`='$id'"); if($sqlSubject) { echo '
Success!
Sub Category Page Update Successfully.
'; mysqli_query($cn, "update `tbl_product` SET `subcategory_order`='$sort_order' where `subcategory_id`='$id'"); } else { echo '
Warrning!
Not Updated try again.
'; } } } if(isset($_GET['edit_id'])) { $id = $_GET['edit_id']; $sql = mysqli_query($cn, "select * from `tbl_subcategory` where id='$id'"); $sqlData = mysqli_fetch_array ($sql); } ?>
Subcategory
Category
Select Category
>
Subcategory Name
Sort Order
Status
> Yes
> No
Slug Url
">Submit
Success!
SubCategory Deleted Successfully.
'; } else { echo "error: " . $sql . "
" . mysqli_error($conn); } } if(isset($_GET['status'])) { $id = $_GET['status']; $val = $_GET['val']; $sql = mysqli_query($cn, "update `tbl_subcategory` SET `status`='$val' where id='$id'"); } ?>
Subcategory List
Sr. No.
Category
Sub Category Name
Sort Order
Status
Action
YES
NO
Edit
|
Delete