D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
shubmkcj
/
designpitara.com
/
admin
/
gallery
/
Filename :
execute.php
back
Copy
<?php error_reporting(0); include("../include/config.php"); ########################################################################################## //For Insert Data if(array_key_exists("add_galleryCategory",$_REQUEST)){ $txtcategName = mysqli_real_escape_string($conn,$_POST['galley_categ']); $string = strtoupper(substr("$txtcategName",0,3)); $cat_code = strtoupper(create_slug($string)); $queryID = "SELECT MAX(id) FROM `gallery_category`"; $resultID = mysqli_query($conn, $queryID); $rowID = mysqli_fetch_row($resultID); $cusID = $rowID[0] + 1; $cat_code = $cat_code."".$cusID; $query="INSERT INTO `gallery_category`(`g_category_name`, `g_code`, `status`) VALUES ('$txtcategName', '$cat_code', 'active')"; // echo $query; die; if (mysqli_query($conn, $query)) { header("location:". $admin_baseurl . 'gallery/'); exit; } else { include('include/error-modal.php'); echo "error"; } mysqli_close($conn); } ########################################################################################## //For update Data if(array_key_exists("update_galleryCategory",$_REQUEST)){ // echo "update_blogs_de tails"; die; $galley_categ = mysqli_real_escape_string($conn,$_POST['galley_categ']); $categId = mysqli_real_escape_string($conn,$_POST['categId']); $query1 = "UPDATE `gallery_category` SET `g_category_name` = '$galley_categ' WHERE `gallery_category`.`id` = $categId"; // echo $query1; die; if (mysqli_query($conn, $query1)) { header("location:". $admin_baseurl . 'gallery/'); exit; } else { include('include/error-modal.php'); } mysqli_close($conn); } ########################################################################################## // status active data if(array_key_exists("status_active_gCateg",$_REQUEST)){ $net_id = $_GET['id']; $query="UPDATE `gallery_category` SET `status` = 'active' WHERE `gallery_category`.`id` = '$net_id'"; if (mysqli_query($conn, $query)) { header("location:". $admin_baseurl . 'gallery/'); exit; } else { include('include/error-modal.php'); } mysqli_close($conn); } ########################################################################################## // status deactive data if(array_key_exists("status_deactive_gCateg",$_REQUEST)){ $net_id = $_GET['id']; $query="UPDATE `gallery_category` SET `status` = 'deactive' WHERE `gallery_category`.`id` = '$net_id'"; if (mysqli_query($conn, $query)) { header("location:". $admin_baseurl . 'gallery/'); exit; } else { include('include/error-modal.php'); } mysqli_close($conn); } ################################################################################################## //For detete data if(array_key_exists("Delete_gCateg_details",$_REQUEST)){ $t_id = $_GET['id']; $query="DELETE FROM `gallery_category` WHERE `gallery_category`.`id` = '$t_id'"; if (mysqli_query($conn, $query)) { header("location:". $admin_baseurl . 'gallery/'); exit; } else { include('include/error-modal.php'); } mysqli_close($conn); } #################################################################################### ?>