D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
shubmkcj
/
designpitara.com
/
admin
/
team
/
Filename :
execute-details.php
back
Copy
<?php error_reporting(0); include("../include/config.php"); ########################################################################################## //For Insert Data if(array_key_exists("add_team_details",$_REQUEST)){ // echo "add_blogs_details vvbgbh"; die; $name = mysqli_real_escape_string($conn,$_POST['name']); $designation = mysqli_real_escape_string($conn,$_POST['designation']); $custom_url = mysqli_real_escape_string($conn,$_POST['custom_url']); $team_details = mysqli_real_escape_string($conn,$_POST['team_details']); $meta_keyword = mysqli_real_escape_string($conn,$_POST['meta_keyword']); $meta_desc = mysqli_real_escape_string($conn,$_POST['meta_desc']); $meta_title = mysqli_real_escape_string($conn,$_POST['meta_title']); @$fb_link = $_POST['fb_link']; @$instagram_link = $_POST['instagram_link']; @$twitter_link = $_POST['twitter_link']; @$skype_id = $_POST['skype_id']; @$linkedin_link = $_POST['linkedin_link']; @$youtube_link = $_POST['youtube_link']; $current_date = date("d-M-Y"); $c_date = date("d"); $c_month = date("M"); if(empty($custom_url)){ $url = create_slug($name); }else{ $url = create_slug($custom_url); } 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 = "team".time().".".$fileExt1; $moveResult1 = move_uploaded_file($fileTmpLoc1, "upload/$new_fileName"); } $query="INSERT INTO `team`(`name`, `designation`, `url`, `team_details`, `image`, `meta_keyword`, `meta_title`, `meta_desc`, `fb_link`, `instagram_link`, `twitter_link`, `skype_id`, `linkedin_link`, `youtube_link`, `status`) VALUES ('$name', '$designation', '$url', '$team_details', '$new_fileName', '$meta_keyword', '$meta_title', '$meta_desc', '$fb_link', '$instagram_link', '$twitter_link', '$skype_id', '$linkedin_link', '$youtube_link', 'active')"; // echo $query; die; if (mysqli_query($conn, $query)) { header("location:". $admin_baseurl . 'team/'); exit; } else { include('include/error-modal.php'); echo "error"; } mysqli_close($conn); } ########################################################################################## //For update Data if(array_key_exists("update_team_details",$_REQUEST)){ $name = mysqli_real_escape_string($conn,$_POST['name']); $designation = mysqli_real_escape_string($conn,$_POST['designation']); $custom_url = mysqli_real_escape_string($conn,$_POST['custom_url']); $team_details = mysqli_real_escape_string($conn,$_POST['team_details']); $meta_keyword = mysqli_real_escape_string($conn,$_POST['meta_keyword']); $meta_desc = mysqli_real_escape_string($conn,$_POST['meta_desc']); $meta_title = mysqli_real_escape_string($conn,$_POST['meta_title']); $team_id = mysqli_real_escape_string($conn,$_POST['team_id']); $team_img = mysqli_real_escape_string($conn,$_POST['team_img']); @$fb_link = $_POST['fb_link']; @$instagram_link = $_POST['instagram_link']; @$twitter_link = $_POST['twitter_link']; @$skype_id = $_POST['skype_id']; @$linkedin_link = $_POST['linkedin_link']; @$youtube_link = $_POST['youtube_link']; $current_date = date("d-M-Y"); $c_date = date("d"); $c_month = date("M"); if(empty($custom_url)){ $url = create_slug($name); }else{ $url = create_slug($custom_url); } 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 = "team".time().".".$fileExt1; $moveResult1 = move_uploaded_file($fileTmpLoc1, "upload/$new_fileName"); } if(empty($_FILES['image_a']['name'])) { $new_fileName = $team_img; } $query1 = "UPDATE `team` SET `name` ='$name',`designation` = '$designation', `url` = '$url', `team_details` = '$team_details', `image` = '$new_fileName', `meta_keyword` = '$meta_keyword', `meta_title` = '$meta_title', `meta_desc` = '$meta_desc', `fb_link` = '$fb_link', `instagram_link` = '$instagram_link', `twitter_link`='$twitter_link', `skype_id`='$skype_id', `linkedin_link`='$linkedin_link', `youtube_link`='$youtube_link' WHERE `team`.`id` = $team_id"; // echo $query1; die; if (mysqli_query($conn, $query1)) { header("location:". $admin_baseurl . 'team/view-team.php'); exit; } else { include('include/error-modal.php'); } mysqli_close($conn); } ########################################################################################## // status active data if(array_key_exists("status_active_team",$_REQUEST)){ $net_id = $_GET['id']; $query="UPDATE `team` SET `status` = 'active' WHERE `team`.`id` = '$net_id'"; if (mysqli_query($conn, $query)) { header("location:". $admin_baseurl . 'team/view-team.php'); exit; } else { include('include/error-modal.php'); } mysqli_close($conn); } ########################################################################################## // status deactive data if(array_key_exists("status_deactive_team",$_REQUEST)){ $net_id = $_GET['id']; $query="UPDATE `team` SET `status` = 'deactive' WHERE `team`.`id` = '$net_id'"; if (mysqli_query($conn, $query)) { header("location:". $admin_baseurl . 'team/view-team.php'); exit; } else { include('include/error-modal.php'); } mysqli_close($conn); } ################################################################################################## //For detete data if(array_key_exists("delete_details",$_REQUEST)){ $t_id = $_GET['id']; // echo $t_id; die; $sqlAssign1 = "SELECT * FROM `team` WHERE `team`.`id` = '$t_id';"; $resultAssign1 = mysqli_query($conn, $sqlAssign1); if (mysqli_num_rows($resultAssign1) > 0) { while($rows = mysqli_fetch_assoc($resultAssign1)) { $blogs_img = $rows['image']; } } $query="DELETE FROM `team` WHERE `team`.`id` = '$t_id'"; if (mysqli_query($conn, $query)) { unlink("upload/$blogs_img"); header("location:". $admin_baseurl . 'team/view-team.php'); exit; } else { include('include/error-modal.php'); } mysqli_close($conn); } #################################################################################### ?>