D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
shubmkcj
/
designpitara.com
/
admin
/
blogs
/
Filename :
execute.php
back
Copy
<?php error_reporting(0); include("../include/config.php"); ########################################################################################## //Blogs Category ########################################################################################## if(array_key_exists("add_blog_Category",$_REQUEST)){ $b_categ = ucwords(mysqli_real_escape_string($conn,$_POST['b_categ'])); $keyword = mysqli_real_escape_string($conn,$_POST['keyword']); $meta_title = mysqli_real_escape_string($conn,$_POST['meta_title']); $description = mysqli_real_escape_string($conn,$_POST['description']); $blog_categ_tags = mysqli_real_escape_string($conn,$_POST['blog_categ_tags']); $custom_url = mysqli_real_escape_string($conn,$_POST['custom_url']); if($custom_url==""){ $url=create_slug($b_categ); }else{ $url=create_slug($custom_url); } // $url = create_slug($g_categ); // echo $g_categ; die; $query = "INSERT INTO `b_category`(`b_category_name`,`meta_title`,`meta_keyword`,`meta_description`,`meta_tags`,`url`,`status`) VALUES ('$b_categ','$meta_title','$keyword','$description','$blog_categ_tags','$url','active')"; if (mysqli_query($conn, $query)) { header("location:add-blogs-category.php"); } else { //echo "qu faild to update data"; echo("Error description: " . mysqli_error($conn)); } mysqli_close($conn); } ########################################################################################## // status active data if(array_key_exists("status_active_gallery_categ",$_REQUEST)){ $net_id = $_GET['id']; $query="UPDATE `b_category` SET `status` = 'active' WHERE `b_category`.`id` = '$net_id'"; if (mysqli_query($conn, $query)) { header("location:add-blogs-category.php"); } 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 `b_category` SET `status` = 'deactive' WHERE `b_category`.`id` = '$net_id'"; if (mysqli_query($conn, $query)) { header("location:add-blogs-category.php"); } 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 `b_category` WHERE `b_category`.`id` = '$t_id'"; if (mysqli_query($conn, $query)) { header("location:add-blogs-category.php"); } else { include('include/error-modal.php'); } mysqli_close($conn); } // update if(array_key_exists("update_Gallery_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']); $keyword = mysqli_real_escape_string($conn,$_POST['keyword']); $meta_title = mysqli_real_escape_string($conn,$_POST['meta_title']); $description = mysqli_real_escape_string($conn,$_POST['description']); $blog_categ_tags = mysqli_real_escape_string($conn,$_POST['blog_categ_tags']); $custom_url=mysqli_real_escape_string($conn,$_POST['custom_url']); if($custom_url==""){ $url=create_slug($g_categ); }else{ $url=create_slug($custom_url); } $query = "UPDATE `b_category` SET `b_category_name` = '$g_categ', `url`='$url' , `meta_title`='$meta_title', `meta_description`='$description',`meta_tags`='$blog_categ_tags' , `meta_keyword`='$keyword' WHERE `b_category`.`id` = $g_cat_id"; echo $query; if (mysqli_query($conn, $query)) { header("location:add-blogs-category.php"); } else { include('include/error-modal.php'); } mysqli_close($conn); } ?>