D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
thread-self
/
root
/
home
/
shubmkcj
/
designpitara.com
/
admin
/
services
/
Filename :
execute-extra-services.php
back
Copy
<?php include("../include/config.php"); include("../include/sessionhandle.php"); ########################################################################################## if ( array_key_exists( "add-new-services", $_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'] ); $last_level_services_id = mysqli_real_escape_string( $conn, $_POST['last_level_services_id'] ); $services_name = mysqli_real_escape_string( $conn, $_POST['services_name'] ); $service_details = 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 ); } 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 = "extra-".time().".".$fileExt1; $moveResult1 = move_uploaded_file( $fileTmpLoc1, "upload/$newFileName" ); } if(empty($_FILES['image_a']['name'])) { $newFileName = ""; } $query = "INSERT INTO `services_last_level_extra`(`service_main_id`, `service_cat_id`, `last_level_service_id`, `name`, `detail`, `image`, `url`, `meta_title`, `keyword`, `description`, `page_lable`, `status`) VALUES ('$main_service_id', '$sub_services_id', '$last_level_services_id', '$services_name','$service_details', '$newFileName', '$url', '$meta_title', '$keyword', '$description', '3', 'active');"; // echo $query; if ( mysqli_query( $conn, $query ) ) { header( "location:". $admin_baseurl . 'services/last-level-extra-sub-services.php' ); } else { echo "qu faild to update data"; } mysqli_close( $conn ); } ################################################################################### //For update Data if(array_key_exists("update-extra-services",$_REQUEST)){ // echo "update_blogs_de 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']); $last_level_services_id = mysqli_real_escape_string($conn,$_POST['last_level_services_id']); $services_name = mysqli_real_escape_string($conn,$_POST['services_name']); $service_details = mysqli_real_escape_string($conn,$_POST['service_details']); $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']); $lastlevedExtralId = mysqli_real_escape_string($conn,$_POST['lastlevedExtralId']); $lastlevelExtraOldImage = mysqli_real_escape_string($conn,$_POST['lastlevelExtraOldImage']); 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 = "extra".time().".".$fileExt1; $moveResult1 = move_uploaded_file( $fileTmpLoc1, "upload/$newFileName" ); } if(empty($_FILES['image_a']['name'])) { $newFileName = $lastlevelExtraOldImage; }else{ unlink("upload/$lastlevelExtraOldImage"); } $query1 = "UPDATE `services_last_level_extra` SET `service_main_id` = '$main_service_id', `service_cat_id` = '$sub_services_id', `last_level_service_id` = '$last_level_services_id', `name` = '$services_name', `detail` = '$service_details', `image` = '$newFileName', `url` = '$url', `meta_title`='$meta_title',`keyword`='$keyword', `description`='$description' WHERE `services_last_level_extra`.`id` = $lastlevedExtralId"; // echo $query1; die; if (mysqli_query($conn, $query1)) { echo "<script>window.location.href='last-level-extra-sub-services.php';</script>"; exit; } else { include('include/error-modal.php'); } mysqli_close($conn); } ########################################################################################## ########################################################################################## // status active data if(array_key_exists("status_active_services_extra",$_REQUEST)){ $net_id = $_GET['id']; $query="UPDATE `services_last_level_extra` SET `status` = 'active' WHERE `services_last_level_extra`.`id` = '$net_id'"; if (mysqli_query($conn, $query)) { header("location:". $admin_baseurl . 'services/last-level-extra-sub-services.php'); } else { include('include/error-modal.php'); } mysqli_close($conn); } ########################################################################################## // status deactive data if(array_key_exists("status_deactive_services_extra",$_REQUEST)){ $net_id = $_GET['id']; $query="UPDATE `services_last_level_extra` SET `status` = 'deactive' WHERE `services_last_level_extra`.`id` = '$net_id'"; if (mysqli_query($conn, $query)) { header("location:". $admin_baseurl . 'services/last-level-extra-sub-services.php'); } else { include('include/error-modal.php'); } mysqli_close($conn); } ################################################################################################## //For detete data if(array_key_exists("delete_services_extra",$_REQUEST)){ $t_id = $_GET['id']; // echo $t_id; die; $sqlAssign1 = "SELECT * FROM `services_last_level_extra` WHERE `services_last_level_extra`.`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_extra` WHERE `services_last_level_extra`.`id` = '$t_id'"; if (mysqli_query($conn, $query)) { unlink("upload/$s_img"); header("location:". $admin_baseurl . 'services/last-level-extra-sub-services.php'); } else { include('include/error-modal.php'); } mysqli_close($conn); } ################################################################################### // gallery ########################################################################################## 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 = "extGl-".time().".".$fileExt1; $moveResult1 = move_uploaded_file( $fileTmpLoc1, "upload/$newFileName" ); } if(empty($_FILES['image_a']['name'])) { $newFileName = ""; } $query = "INSERT INTO `services_last_level_extra_gallery`(`lastLevel_id`, `uperlevelServeId`, `image`, `status`) VALUES ('$lastLevel_serviceId', '$uperlaverlSrviceId', '$newFileName', 'active');"; // echo $query; if ( mysqli_query( $conn, $query ) ) { header( "location:". $admin_baseurl . 'services/last-level-extra-sub-services.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 = "extGl-".time().".".$fileExt1; $moveResult1 = move_uploaded_file( $fileTmpLoc1, "upload/$newFileName" ); } if(empty($_FILES['image_a']['name'])) { $newFileName = ""; } $query = "INSERT INTO `services_last_level_extra_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-extra-sub-services.php?id='.$lastLevel_serviceId ); } else { echo "qu faild to update data"; } mysqli_close( $conn ); } ########################################################################################## //For detete data if(array_key_exists("delete_extra_gallery_img",$_REQUEST)){ $t_id = $_GET['id']; // echo $t_id; die; $sqlAssign1 = "SELECT * FROM `services_last_level_extra_gallery` WHERE `services_last_level_extra_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_extra_gallery` WHERE `services_last_level_extra_gallery`.`id` = '$t_id'"; if (mysqli_query($conn, $query)) { unlink("upload/$s_img"); header("location:". $admin_baseurl . 'services/view-gallery-last-level-extra-sub-services.php?id='.$lastLevel_id); } else { include('include/error-modal.php'); } mysqli_close($conn); } ?>