D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
shubmkcj
/
designpitara.com
/
admin
/
services
/
Filename :
execute.php
back
Copy
<?php include("../include/config.php"); include("../include/sessionhandle.php"); ########################################################################################## if ( array_key_exists( "add-new-services", $_REQUEST ) ) { // echo "sli"; // die; $services_name = mysqli_real_escape_string( $conn, $_POST['services_name'] ); $service_detail = mysqli_real_escape_string( $conn, $_POST['service_detail'] ); $custo_url = mysqli_real_escape_string( $conn, $_POST['custom_url'] ); $meta_title = mysqli_real_escape_string( $conn, $_POST['meta_title'] ); $keyword = mysqli_real_escape_string( $conn, $_POST['keyword'] ); $description = mysqli_real_escape_string( $conn, $_POST['description'] ); if ( !empty( $custo_url ) ) { $url = create_slug( $custo_url ); } else { $url = create_slug( $services_name ); } if ( isset( $_FILES['image_a']['name'] ) ) { $fileName1 = $_FILES["image_a"]["name"]; $fileTmpLoc1 = $_FILES["image_a"]["tmp_name"]; $fileType1 = $_FILES["image_a"]["type"]; $fileSize1 = $_FILES["image_a"]["size"]; $fileErrorMsg1 = $_FILES["image_a"]["error"]; $kaboom1 = explode( ".", $fileName1 ); $fileExt1 = end( $kaboom1 ); $newFileName = time().".".$fileExt1; $moveResult1 = move_uploaded_file( $fileTmpLoc1, "upload/$newFileName" ); } if(empty($_FILES['image_a']['name'])) { $newFileName = ""; } $query = "INSERT INTO `services`(`name`, `detail`, `image`, `url`, `meta_title`, `keyword`, `description`, `status`) VALUES ('$services_name', '$service_detail', '$newFileName', '$url','$meta_title', '$keyword', '$description', 'active');"; echo $query; if ( mysqli_query( $conn, $query ) ) { header( "location:". $admin_baseurl . 'services/add-services.php' ); } else { echo "qu faild to update data"; } mysqli_close( $conn ); } ################################################################################### //For update Data if(array_key_exists("update-services",$_REQUEST)){ // echo "update_blogs_de tails"; die; $service_id = mysqli_real_escape_string($conn,$_POST['service_id']); $service_images = mysqli_real_escape_string($conn,$_POST['service_images']); $services_name = mysqli_real_escape_string($conn,$_POST['services_name']); $service_details = mysqli_real_escape_string($conn,$_POST['service_detail']); $meta_title = mysqli_real_escape_string($conn,$_POST['meta_title']); $keyword = mysqli_real_escape_string($conn,$_POST['keyword']); $description = mysqli_real_escape_string($conn,$_POST['description']); $customs_url = mysqli_real_escape_string($conn,$_POST['custom_url']); if ( !empty( $customs_url ) ) { $url = create_slug( $customs_url ); } else { $url = create_slug( $services_name ); } if ( isset( $_FILES['image_a']['name'] ) ) { $fileName1 = $_FILES["image_a"]["name"]; $fileTmpLoc1 = $_FILES["image_a"]["tmp_name"]; $fileType1 = $_FILES["image_a"]["type"]; $fileSize1 = $_FILES["image_a"]["size"]; $fileErrorMsg1 = $_FILES["image_a"]["error"]; $kaboom1 = explode( ".", $fileName1 ); $fileExt1 = end( $kaboom1 ); $newFileName = time().".".$fileExt1; $moveResult1 = move_uploaded_file( $fileTmpLoc1, "upload/$newFileName" ); } if(empty($_FILES['image_a']['name'])) { $newFileName = $service_images; }else{ unlink("upload/$service_images"); } $query1 = "UPDATE `services` SET `name` = '$services_name', `detail` = '$service_details', `image` = '$newFileName', `url` = '$url', `meta_title` = '$meta_title', `keyword` = '$keyword', `description` = '$description' WHERE `services`.`id` = $service_id"; // echo $query1; die; if (mysqli_query($conn, $query1)) { echo "<script>window.location.href='view-services.php';</script>"; exit; } else { include('include/error-modal.php'); } mysqli_close($conn); } ########################################################################################## ########################################################################################## // status active data if(array_key_exists("status_active_services",$_REQUEST)){ $net_id = $_GET['id']; $query="UPDATE `services` SET `status` = 'active' WHERE `services`.`id` = '$net_id'"; if (mysqli_query($conn, $query)) { header("location:". $admin_baseurl . 'services/view-services.php'); } else { include('include/error-modal.php'); } mysqli_close($conn); } ########################################################################################## // status deactive data if(array_key_exists("status_deactive_services",$_REQUEST)){ $net_id = $_GET['id']; $query="UPDATE `services` SET `status` = 'deactive' WHERE `services`.`id` = '$net_id'"; if (mysqli_query($conn, $query)) { header("location:". $admin_baseurl . 'services/view-services.php'); } else { include('include/error-modal.php'); } mysqli_close($conn); } ################################################################################################## //For detete data if(array_key_exists("delete_services",$_REQUEST)){ $t_id = $_GET['id']; // echo $t_id; die; $sqlAssign1 = "SELECT * FROM `services` WHERE `services`.`id` = '$t_id';"; $resultAssign1 = mysqli_query($conn, $sqlAssign1); if (mysqli_num_rows($resultAssign1) > 0) { while($rows = mysqli_fetch_assoc($resultAssign1)) { $s_img = $rows['image']; } } $query="DELETE FROM `services` WHERE `services`.`id` = '$t_id'"; if (mysqli_query($conn, $query)) { unlink("upload/$s_img"); header("location:". $admin_baseurl . 'services/view-services.php'); } else { include('include/error-modal.php'); } mysqli_close($conn); } // delete galley if(array_key_exists("delete_lastl_gallery_img",$_REQUEST)){ $t_id = $_GET['id']; // echo $t_id; die; $sqlAssign1 = "SELECT * FROM `services_last_level_gallery` WHERE `services_last_level_gallery`.`id` = '$t_id';"; $resultAssign1 = mysqli_query($conn, $sqlAssign1); if (mysqli_num_rows($resultAssign1) > 0) { while($rows = mysqli_fetch_assoc($resultAssign1)) { $s_img = $rows['image']; $lastLevel_id = $rows['lastLevel_id']; } } $query="DELETE FROM `services_last_level_gallery` WHERE `services_last_level_gallery`.`id` = '$t_id'"; if (mysqli_query($conn, $query)) { unlink("upload/$s_img"); header("location:". $admin_baseurl . 'services/view-gallery-last-level-services.php?id='. $lastLevel_id); } else { include('include/error-modal.php'); } mysqli_close($conn); } //delete main gallery if(array_key_exists("delete_sub_categ_gallery_img",$_REQUEST)){ $t_id = $_GET['id']; // echo $t_id; die; $sqlAssign1 = "SELECT * FROM `services_category_gallery` WHERE `services_category_gallery`.`id` = '$t_id';"; $resultAssign1 = mysqli_query($conn, $sqlAssign1); if (mysqli_num_rows($resultAssign1) > 0) { while($rows = mysqli_fetch_assoc($resultAssign1)) { $s_img = $rows['image']; $lastLevel_id = $rows['lastLevel_id']; } } $query="DELETE FROM `services_category_gallery` WHERE `services_category_gallery`.`id` = '$t_id'"; if (mysqli_query($conn, $query)) { unlink("upload/$s_img"); header("location:". $admin_baseurl . 'services/view-gallery-service-category.php?id='. $lastLevel_id); } else { include('include/error-modal.php'); } mysqli_close($conn); } ################################################################################################## // services category ################################################################################################## if ( array_key_exists( "add-new-services-category", $_REQUEST ) ) { // echo "sli"; // die; $main_service_id = mysqli_real_escape_string( $conn, $_POST['main_service_id'] ); $services_name = ucwords(strtolower(mysqli_real_escape_string( $conn, $_POST['services_name'] ))); $service_detail = mysqli_real_escape_string( $conn, $_POST['service_detail'] ); $custo_url = mysqli_real_escape_string( $conn, $_POST['custom_url'] ); $meta_title = mysqli_real_escape_string( $conn, $_POST['meta_title'] ); $keyword = mysqli_real_escape_string( $conn, $_POST['keyword'] ); $description = mysqli_real_escape_string( $conn, $_POST['description'] ); if ( !empty( $custo_url ) ) { $url = create_slug( $custo_url ); } else { $url = create_slug( $services_name ); } if ( isset( $_FILES['image_a']['name'] ) ) { $fileName1 = $_FILES["image_a"]["name"]; $fileTmpLoc1 = $_FILES["image_a"]["tmp_name"]; $fileType1 = $_FILES["image_a"]["type"]; $fileSize1 = $_FILES["image_a"]["size"]; $fileErrorMsg1 = $_FILES["image_a"]["error"]; $kaboom1 = explode( ".", $fileName1 ); $fileExt1 = end( $kaboom1 ); $newFileName = time().".".$fileExt1; $moveResult1 = move_uploaded_file( $fileTmpLoc1, "upload/$newFileName" ); } if(empty($_FILES['image_a']['name'])) { $newFileName = ""; } $query = "INSERT INTO `services_category`(`service_id`, `name`, `detail`, `image`, `url`, `meta_title`, `keyword`, `description`, `page_lable`, `status`) VALUES ('$main_service_id','$services_name', '$service_detail', '$newFileName', '$url','$meta_title', '$keyword', '$description', '1','active');"; echo $query; if ( mysqli_query( $conn, $query ) ) { header( "location:". $admin_baseurl . 'services/add-service-category.php' ); } else { echo "qu faild to update data"; } mysqli_close( $conn ); } ################################################################################### // status active data if(array_key_exists("status_active_services_category",$_REQUEST)){ $net_id = $_GET['id']; $query="UPDATE `services_category` SET `status` = 'active' WHERE `services_category`.`id` = '$net_id'"; if (mysqli_query($conn, $query)) { header("location:". $admin_baseurl . 'services/view-service-category.php'); } else { include('include/error-modal.php'); } mysqli_close($conn); } ########################################################################################## // status deactive data if(array_key_exists("status_deactive_services_category",$_REQUEST)){ $net_id = $_GET['id']; $query="UPDATE `services_category` SET `status` = 'deactive' WHERE `services_category`.`id` = '$net_id'"; if (mysqli_query($conn, $query)) { header("location:". $admin_baseurl . 'services/view-service-category.php'); } else { include('include/error-modal.php'); } mysqli_close($conn); } ################################################################################################## //For detete data if(array_key_exists("delete_services_category",$_REQUEST)){ $t_id = $_GET['id']; // echo $t_id; die; $sqlAssign1 = "SELECT * FROM `services_category` WHERE `services_category`.`id` = '$t_id';"; $resultAssign1 = mysqli_query($conn, $sqlAssign1); if (mysqli_num_rows($resultAssign1) > 0) { while($rows = mysqli_fetch_assoc($resultAssign1)) { $s_img = $rows['image']; } } $query="DELETE FROM `services_category` WHERE `services_category`.`id` = '$t_id'"; if (mysqli_query($conn, $query)) { unlink("upload/$s_img"); header("location:". $admin_baseurl . 'services/view-service-category.php'); } else { include('include/error-modal.php'); } mysqli_close($conn); } ################################################################################### //For update Data if(array_key_exists("update-services-category",$_REQUEST)){ // echo "update_blogs_de tails"; die; $service_id = mysqli_real_escape_string($conn,$_POST['service_id']); $mainservice_id = mysqli_real_escape_string($conn,$_POST['main_service_id']); $service_images = mysqli_real_escape_string($conn,$_POST['service_images']); $services_name = mysqli_real_escape_string($conn,$_POST['services_name']); $service_details = mysqli_real_escape_string($conn,$_POST['service_detail']); $meta_title = mysqli_real_escape_string($conn,$_POST['meta_title']); $keyword = mysqli_real_escape_string($conn,$_POST['keyword']); $description = mysqli_real_escape_string($conn,$_POST['description']); $customs_url = mysqli_real_escape_string($conn,$_POST['custom_url']); if ( !empty( $customs_url ) ) { $url = create_slug( $customs_url ); } else { $url = create_slug( $services_name ); } if ( isset( $_FILES['image_a']['name'] ) ) { $fileName1 = $_FILES["image_a"]["name"]; $fileTmpLoc1 = $_FILES["image_a"]["tmp_name"]; $fileType1 = $_FILES["image_a"]["type"]; $fileSize1 = $_FILES["image_a"]["size"]; $fileErrorMsg1 = $_FILES["image_a"]["error"]; $kaboom1 = explode( ".", $fileName1 ); $fileExt1 = end( $kaboom1 ); $newFileName = time().".".$fileExt1; $moveResult1 = move_uploaded_file( $fileTmpLoc1, "upload/$newFileName" ); } if(empty($_FILES['image_a']['name'])) { $newFileName = $service_images; }else{ unlink("upload/$service_images"); } $query1 = "UPDATE `services_category` SET `service_id`='$mainservice_id',`name` = '$services_name', `detail` = '$service_details', `image` = '$newFileName', `url` = '$url', `meta_title` = '$meta_title', `keyword` = '$keyword', `description` = '$description' WHERE `services_category`.`id` = $service_id"; // echo $query1; die; if (mysqli_query($conn, $query1)) { echo "<script>window.location.href='view-service-category.php';</script>"; exit; } else { include('include/error-modal.php'); } mysqli_close($conn); } ########################################################################################## // service-last-level ########################################################################################## if ( array_key_exists( "add-new-services-last-level", $_REQUEST ) ) { // echo "sli"; // die; $main_service_id = mysqli_real_escape_string( $conn, $_POST['main_service_id'] ); $sub_services_id = mysqli_real_escape_string( $conn, $_POST['sub_services_id'] ); $services_name = ucwords(strtolower(mysqli_real_escape_string( $conn, $_POST['services_name'] ))); $service_detail = mysqli_real_escape_string( $conn, $_POST['service_details'] ); $custo_url = mysqli_real_escape_string( $conn, $_POST['custom_url'] ); $meta_title = mysqli_real_escape_string( $conn, $_POST['meta_title'] ); $keyword = mysqli_real_escape_string( $conn, $_POST['keyword'] ); $description = mysqli_real_escape_string( $conn, $_POST['description'] ); if ( !empty( $custo_url ) ) { $url = create_slug( $custo_url ); } else { $url = create_slug( $services_name ); } $aa_faqq = str_replace("'","\'",$_POST['faqQuest']); $faqQuest = implode('--',$aa_faqq); $aa_faqa = str_replace("'","\'",$_POST['faqAns']); $faqAns = implode('--',$aa_faqa); if ( isset( $_FILES['image_a']['name'] ) ) { $fileName1 = $_FILES["image_a"]["name"]; $fileTmpLoc1 = $_FILES["image_a"]["tmp_name"]; $fileType1 = $_FILES["image_a"]["type"]; $fileSize1 = $_FILES["image_a"]["size"]; $fileErrorMsg1 = $_FILES["image_a"]["error"]; $kaboom1 = explode( ".", $fileName1 ); $fileExt1 = end( $kaboom1 ); $newFileName = time().".".$fileExt1; $moveResult1 = move_uploaded_file( $fileTmpLoc1, "upload/$newFileName" ); } if(empty($_FILES['image_a']['name'])) { $newFileName = ""; } $query = "INSERT INTO `services_last_level`(`service_main_id`, `service_cat_id`, `name`, `detail`, `image`, `url`, `meta_title`, `keyword`, `description`, `page_lable`, `service_last_lavel_name`, `service_last_lavel_name_details`, `status`) VALUES ('$main_service_id','$sub_services_id', '$services_name', '$service_detail', '$newFileName','$url','$meta_title', '$keyword', '$description', '2', '$faqQuest', '$faqAns','active');"; // echo $query; die; if ( mysqli_query( $conn, $query ) ) { header( "location:". $admin_baseurl . 'services/add-service-last-level.php' ); } else { echo "qu faild to update data"; } mysqli_close( $conn ); } ################################################################################### // status active data if(array_key_exists("status_active_services_last_level",$_REQUEST)){ $net_id = $_GET['id']; $query="UPDATE `services_last_level` SET `status` = 'active' WHERE `services_last_level`.`id` = '$net_id'"; if (mysqli_query($conn, $query)) { header("location:". $admin_baseurl . 'services/view-service-last-level.php'); } else { include('include/error-modal.php'); } mysqli_close($conn); } ########################################################################################## // status deactive data if(array_key_exists("status_deactive_services_last_level",$_REQUEST)){ $net_id = $_GET['id']; $query="UPDATE `services_last_level` SET `status` = 'deactive' WHERE `services_last_level`.`id` = '$net_id'"; if (mysqli_query($conn, $query)) { header("location:". $admin_baseurl . 'services/view-service-last-level.php'); } else { include('include/error-modal.php'); } mysqli_close($conn); } ################################################################################################## //For detete data if(array_key_exists("delete_services_last_level",$_REQUEST)){ $t_id = $_GET['id']; // echo $t_id; die; $sqlAssign1 = "SELECT * FROM `services_last_level` WHERE `services_last_level`.`id` = '$t_id';"; $resultAssign1 = mysqli_query($conn, $sqlAssign1); if (mysqli_num_rows($resultAssign1) > 0) { while($rows = mysqli_fetch_assoc($resultAssign1)) { $s_img = $rows['image']; } } $query="DELETE FROM `services_last_level` WHERE `services_last_level`.`id` = '$t_id'"; if (mysqli_query($conn, $query)) { unlink("upload/$s_img"); header("location:". $admin_baseurl . 'services/view-service-last-level.php'); } else { include('include/error-modal.php'); } mysqli_close($conn); } ################################################################################### //For update Data if(array_key_exists("update-services-last-level",$_REQUEST)){ // echo "update-services-last-level tails"; die; $main_service_id = mysqli_real_escape_string( $conn, $_POST['main_service_id'] ); $sub_services_id = mysqli_real_escape_string( $conn, $_POST['sub_services_id'] ); $services_name = ucwords(strtolower(mysqli_real_escape_string( $conn, $_POST['services_name'] ))); $service_detail = mysqli_real_escape_string( $conn, $_POST['service_details'] ); $custo_url = mysqli_real_escape_string( $conn, $_POST['custom_url'] ); $meta_title = mysqli_real_escape_string( $conn, $_POST['meta_title'] ); $keyword = mysqli_real_escape_string( $conn, $_POST['keyword'] ); $description = mysqli_real_escape_string( $conn, $_POST['description'] ); $lastledfdvelId = $_POST['lastlevedfdlId']; $lastlevelOldImage = $_POST['lastlevelOldImage']; if ( !empty( $custo_url ) ) { $url = create_slug( $custo_url ); } else { $url = create_slug( $services_name ); } $aa_faqq = str_replace("'","\'",$_POST['faqQuest']); $faqQuest = implode('--',$aa_faqq); $aa_faqa = str_replace("'","\'",$_POST['faqAns']); $faqAns = implode('--',$aa_faqa); if ( isset( $_FILES['image_a']['name'] ) ) { $fileName1 = $_FILES["image_a"]["name"]; $fileTmpLoc1 = $_FILES["image_a"]["tmp_name"]; $fileType1 = $_FILES["image_a"]["type"]; $fileSize1 = $_FILES["image_a"]["size"]; $fileErrorMsg1 = $_FILES["image_a"]["error"]; $kaboom1 = explode( ".", $fileName1 ); $fileExt1 = end( $kaboom1 ); $newFileName = time().".".$fileExt1; $moveResult1 = move_uploaded_file( $fileTmpLoc1, "upload/$newFileName" ); } if(empty($_FILES['image_a']['name'])) { $newFileName = $lastlevelOldImage; }else{ unlink("upload/$lastlevelOldImage"); } $query1 = "UPDATE `services_last_level` SET `service_main_id`='$main_service_id',`service_cat_id` = '$sub_services_id', `name`='$services_name',`detail` = '$service_detail', `image` = '$newFileName', `url` = '$url', `meta_title` = '$meta_title', `keyword` = '$keyword', `description` = '$description', `service_last_lavel_name`='$faqQuest', `service_last_lavel_name_details`='$faqAns' WHERE `services_last_level`.`id` = '$lastledfdvelId'"; // echo $query1; die; if (mysqli_query($conn, $query1)) { echo "<script>window.location.href='view-service-last-level.php';</script>"; exit; } else { include('include/error-modal.php'); } mysqli_close($conn); } ########################################################################################## ########################################################################################## // service-last-level gallery Images ########################################################################################## if ( array_key_exists( "AddNewImagesOfLastLevel", $_REQUEST ) ) { // echo "sli"; // die; $uperlaverlSrviceId = mysqli_real_escape_string( $conn, $_POST['uperlaverlSrviceId'] ); $lastLevel_serviceId = mysqli_real_escape_string( $conn, $_POST['lastLevel_serviceId'] ); if ( isset( $_FILES['image_a']['name'] ) ) { $fileName1 = $_FILES["image_a"]["name"]; $fileTmpLoc1 = $_FILES["image_a"]["tmp_name"]; $fileType1 = $_FILES["image_a"]["type"]; $fileSize1 = $_FILES["image_a"]["size"]; $fileErrorMsg1 = $_FILES["image_a"]["error"]; $kaboom1 = explode( ".", $fileName1 ); $fileExt1 = end( $kaboom1 ); $newFileName = time().".".$fileExt1; $moveResult1 = move_uploaded_file( $fileTmpLoc1, "upload/$newFileName" ); } $query = "INSERT INTO `services_last_level_gallery`(`lastLevel_id`, `uperlevelServeId`, `image`, `status`) VALUES ('$lastLevel_serviceId', '$uperlaverlSrviceId','$newFileName','active');"; // echo $query; if ( mysqli_query( $conn, $query ) ) { header( "location:". $admin_baseurl . 'services/view-service-last-level.php' ); } else { echo "qu faild to update data"; } mysqli_close( $conn ); } if ( array_key_exists( "AddNewImagesOfLastLevel1", $_REQUEST ) ) { // echo "sli"; // die; $uperlaverlSrviceId = mysqli_real_escape_string( $conn, $_POST['uperlaverlSrviceId'] ); $lastLevel_serviceId = mysqli_real_escape_string( $conn, $_POST['lastLevel_serviceId'] ); if ( isset( $_FILES['image_a']['name'] ) ) { $fileName1 = $_FILES["image_a"]["name"]; $fileTmpLoc1 = $_FILES["image_a"]["tmp_name"]; $fileType1 = $_FILES["image_a"]["type"]; $fileSize1 = $_FILES["image_a"]["size"]; $fileErrorMsg1 = $_FILES["image_a"]["error"]; $kaboom1 = explode( ".", $fileName1 ); $fileExt1 = end( $kaboom1 ); $newFileName = time().".".$fileExt1; $moveResult1 = move_uploaded_file( $fileTmpLoc1, "upload/$newFileName" ); } $query = "INSERT INTO `services_last_level_gallery`(`lastLevel_id`, `uperlevelServeId`, `image`, `status`) VALUES ('$lastLevel_serviceId', '$uperlaverlSrviceId','$newFileName','active');"; // echo $query; if ( mysqli_query( $conn, $query ) ) { header( "location:". $admin_baseurl . 'services/view-gallery-last-level-services.php?id='.$lastLevel_serviceId ); } else { echo "qu faild to update data"; } mysqli_close( $conn ); } ################################################################################### if ( array_key_exists( "AddNewImagesOfServiceCategory", $_REQUEST ) ) { // echo "sli"; // die; $lastLevel_serviceId = mysqli_real_escape_string( $conn, $_POST['lastLevel_serviceId'] ); $uperlaverlSrviceId = mysqli_real_escape_string( $conn, $_POST['uperlaverlSrviceId'] ); if ( isset( $_FILES['image_a']['name'] ) ) { $fileName1 = $_FILES["image_a"]["name"]; $fileTmpLoc1 = $_FILES["image_a"]["tmp_name"]; $fileType1 = $_FILES["image_a"]["type"]; $fileSize1 = $_FILES["image_a"]["size"]; $fileErrorMsg1 = $_FILES["image_a"]["error"]; $kaboom1 = explode( ".", $fileName1 ); $fileExt1 = end( $kaboom1 ); $newFileName = time().".".$fileExt1; $moveResult1 = move_uploaded_file( $fileTmpLoc1, "upload/$newFileName" ); } $query = "INSERT INTO `services_category_gallery`(`lastLevel_id`, `uperlaverlSrviceId`,`image`, `status`) VALUES ('$lastLevel_serviceId', '$uperlaverlSrviceId','$newFileName','active');"; // echo $query; if ( mysqli_query( $conn, $query ) ) { header( "location:". $admin_baseurl . 'services/view-service-category.php' ); } else { echo "qu faild to update data"; } mysqli_close( $conn ); } ################################################################################### ?>