D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
thread-self
/
root
/
proc
/
self
/
root
/
home
/
shubmkcj
/
designpitara.com
/
admin
/
product
/
Filename :
execute.php
back
Copy
<?php error_reporting(0); include("../include/config.php"); ########################################################################################## //Blogs Category ########################################################################################## if(array_key_exists("add_product_Category",$_REQUEST)){ $g_categ = ucwords(mysqli_real_escape_string($conn,$_POST['g_categ'])); $string = strtoupper(substr("$g_categ",0,3)); $cat_code = strtoupper(create_slug($string)); $queryID = "SELECT MAX(id) FROM `product_category`"; $resultID = mysqli_query($conn, $queryID); $rowID = mysqli_fetch_row($resultID); $cusID = $rowID[0] + 1; $cat_code = $cat_code."".$cusID; // echo $g_categ; die; $query = "INSERT INTO `product_category`(`g_category_name`, `g_code`, `status`) VALUES ('$g_categ', '$cat_code', 'active');"; if (mysqli_query($conn, $query)) { header("location:". $admin_baseurl . 'product/category.php'); exit; } else { echo "qu faild to update data"; } mysqli_close($conn); } ########################################################################################## // status active data if(array_key_exists("status_active_gallery_categ",$_REQUEST)){ $net_id = $_GET['id']; $query="UPDATE `product_category` SET `status` = 'active' WHERE `product_category`.`id` = '$net_id'"; if (mysqli_query($conn, $query)) { header("location:". $admin_baseurl . 'product/category.php'); exit; } else { include('include/error-modal.php'); } mysqli_close($conn); } ########################################################################################## // status deactive data if(array_key_exists("status_deactive_gallery_categ",$_REQUEST)){ $net_id = $_GET['id']; $query="UPDATE `product_category` SET `status` = 'deactive' WHERE `product_category`.`id` = '$net_id'"; if (mysqli_query($conn, $query)) { header("location:". $admin_baseurl . 'product/category.php'); exit; } else { include('include/error-modal.php'); } mysqli_close($conn); } ################################################################################################## //For detete data if(array_key_exists("Delete_gallery_categ",$_REQUEST)){ $t_id = $_GET['id']; // echo $t_id; die; $query="DELETE FROM `product_category` WHERE `product_category`.`id` = '$t_id'"; if (mysqli_query($conn, $query)) { header("location:". $admin_baseurl . 'product/category.php'); exit; } else { include('include/error-modal.php'); } mysqli_close($conn); } // update if(array_key_exists("update_product_Category",$_REQUEST)){ $g_categ = ucwords(mysqli_real_escape_string($conn,$_POST['g_categ'])); $g_cat_id = mysqli_real_escape_string($conn,$_POST['g_cat_id']); $query = "UPDATE `product_category` SET `g_category_name` = '$g_categ' WHERE `product_category`.`id` = $g_cat_id"; echo $query; if (mysqli_query($conn, $query)) { header("location:". $admin_baseurl . 'product/category.php'); exit; } else { include('include/error-modal.php'); } mysqli_close($conn); } ?>