D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
thread-self
/
root
/
home
/
shubmkcj
/
designpitara.com
/
admin
/
client
/
Filename :
execute.php
back
Copy
<?php error_reporting(0); include("../include/config.php"); ########################################################################################## if(array_key_exists("add_slider_img",$_REQUEST)){ // echo "sli"; die; 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); $new_fileName = time().".".$fileExt1; $moveResult1 = move_uploaded_file($fileTmpLoc1, "upload/$new_fileName"); } $query = "INSERT INTO `clients_photo`(`slider_img`, `status`) VALUES ('$new_fileName', 'active');"; if (mysqli_query($conn, $query)) { header("location:". $admin_baseurl . 'client/'); exit; } else { echo "qu faild to update data"; } mysqli_close($conn); } ################################################################################### ########################################################################################## // status active data if(array_key_exists("status_active_slider",$_REQUEST)){ $net_id = $_GET['id']; $query="UPDATE `clients_photo` SET `status` = 'active' WHERE `clients_photo`.`id` = '$net_id'"; if (mysqli_query($conn, $query)) { header("location:". $admin_baseurl . 'client/'); exit; } else { include('include/error-modal.php'); } mysqli_close($conn); } ########################################################################################## // status deactive data if(array_key_exists("status_deactive_slider",$_REQUEST)){ $net_id = $_GET['id']; $query="UPDATE `clients_photo` SET `status` = 'deactive' WHERE `clients_photo`.`id` = '$net_id'"; if (mysqli_query($conn, $query)) { header("location:". $admin_baseurl . 'client/'); exit; } else { include('include/error-modal.php'); } mysqli_close($conn); } ################################################################################################## //For detete data if(array_key_exists("Delete_slider",$_REQUEST)){ $t_id = $_GET['id']; // echo $t_id; die; $sqlAssign1 = "SELECT * FROM `clients_photo` WHERE `clients_photo`.`id` = '$t_id';"; $resultAssign1 = mysqli_query($conn, $sqlAssign1); if (mysqli_num_rows($resultAssign1) > 0) { while($rows = mysqli_fetch_assoc($resultAssign1)) { $slider_img = $rows['slider_img']; } } $query="DELETE FROM `clients_photo` WHERE `clients_photo`.`id` = '$t_id'"; if (mysqli_query($conn, $query)) { unlink("upload/$slider_img"); header("location:". $admin_baseurl . 'client/'); exit; } else { include('include/error-modal.php'); } mysqli_close($conn); } ?>