芝麻web文件管理V1.00
编辑当前文件:/home/krishnamexports/public_html/panel/pages/product/category.php
0) { echo '
Danger!
Category name already exists.
'; } else { $sqlSubject=mysqli_query ($cn, "insert into `tbl_category` set `name`='$name', `image`='$image', `sort_order`='$sort_order', `slug_url`='$slug_url', `status`=1, `menu_type`='".$menu_type."'"); if ($sqlSubject) { echo '
Success!
Category Added Successfully.
'; } else { echo '
Danger!
Category Not Added. Try Again.
'; } } } else { echo '
Danger!
'.$error.'
'; } } if(isset($_POST['edit'])) { $id = $_POST['id']; $name = $_POST['name']; $image = $_FILES['image']['name']; $sort_order = $_POST['sort_order']; $status = $_POST['status']; $menu_type = $_POST['menu_type']; $slug_url = mysqli_real_escape_string($cn,$_POST['slug_url']); $sql = mysqli_query($cn, "select * from tbl_category where id='$id'"); $sqlData = mysqli_fetch_array($sql); $validation = 1; if(!empty($image)) { $imgExe = explode(".",$image); if($imgExe[1]=='jpg' or $imgExe[1]=='jpeg' or $imgExe[1]=='png') { move_uploaded_file ($_FILES['image']['tmp_name'],'../categorys/'.$image); } else { $error = "Only .jpg, .jpeg, .png Allow."; $validation = 0; } } else { $image = $sqlData['image']; } if($validation==1) { $sqlSubject = mysqli_query ($cn,"update tbl_category SET name='$name',image='$image',sort_order='$sort_order',status='$status',slug_url='$slug_url', `menu_type`='".$menu_type."' where `id`='$id'"); if($sqlSubject) { echo '
Success!
Category Update Successfully.
'; } else { echo '
Warrning!
Category Not Updated. Try again.
'; } } else { echo '
Danger!
'.$error.'
'; } } if(isset($_GET['edit_id'])) { $id = $_GET['edit_id']; $sql = mysqli_query($cn, "select * from tbl_category where id='$id'"); $sqlData = mysqli_fetch_array ($sql); } if(isset($_GET['status'])) { $id = $_GET['status']; $val = $_GET['val']; $sql = mysqli_query($cn, "update tbl_category SET `status`='$val' where id='$id'"); } ?>
Category
Category Name
*
Category Image
*
required >
Size must 235X54
Sort Order
*
Status
*
> Yes
> No
Slug Url
*
Menu Type
*
Select Type
>Direct Menu
>Shop Inner Menu
">Submit
Success!
Category Deleted Successfully.
'; } else { echo "error: " . $sql . "
" . mysqli_error($conn); } } ?>
Category List
Sr.No.
Image
Category Name
Sort Order
Status
Action
YES
NO
Edit
|
Delete