/
home
/
techb158
/
immovalet.ca
/
Client
/
Inc
/
/home/techb158/immovalet.ca/Client/Inc
mkdir
upload
Name
Size
Mode
Actions
Publish_Post.php
5483
0666
edit
dl
rm
Update_Profile.php
10497
0666
edit
dl
rm
Update_Publish_Post.php
5923
0666
edit
dl
rm
upload.php
2206
0666
edit
dl
rm
Edit:
/home/techb158/immovalet.ca/Client/Inc/Update_Publish_Post.php
(5923B)
<?php include_once '../includes/db_connect.php'; include_once '../includes/psl-config.php'; sec_session_start(); $error_msg = ""; mysqli_real_escape_string($mysqli, "utf8"); if(isset($_POST["submit"])) { if (isset ($_POST['Job_Post_ID'],$_POST['Post_Title'], $_POST['Mission_of_your_company'], $_POST['Your_3_essential_values'], $_POST['Post_Regions'], $_POST['List_of_industries'], $_POST['Who_are_we'], $_POST['Mission_of_this_post'], $_POST['Future_achievements'], $_POST['Are_you_the_wanted_person'], $_POST['Select_what_you_offer'])) { $Register_Time = date("Y/m/d") . ' ' . date('H:i:s'); $Register_ID = $_SESSION['user_id']; $Job_Post_ID = $_POST['Job_Post_ID']; $Post_Title = $_POST['Post_Title']; $Post_Regions = $_POST['Post_Regions']; $List_of_industries = $_POST['List_of_industries']; $Mission_of_your_company = mysqli_real_escape_string($mysqli,htmlentities($_POST['Mission_of_your_company'])); $Your_3_essential_values = $_POST['Your_3_essential_values']; $Who_are_we = mysqli_real_escape_string($mysqli,htmlentities($_POST['Who_are_we'])); $Mission_of_this_post = mysqli_real_escape_string($mysqli,htmlentities($_POST['Mission_of_this_post'])); $Future_achievements = mysqli_real_escape_string($mysqli,htmlentities($_POST['Future_achievements'])); $Are_you_the_wanted_person = mysqli_real_escape_string($mysqli,htmlentities($_POST['Are_you_the_wanted_person'])); $Select_what_you_offer = $_POST['Select_what_you_offer']; $query = "SELECT * FROM Job_Category Where Job_Category_ID ='".$List_of_industries."'"; $result = $mysqli->query($query); $Manager = $result->fetch_assoc(); $Job_Category_Name = $Manager['Job_Category_Name']; $queryd = "SELECT * FROM Regions_of_Jobs Where Regions_ID ='".$Post_Regions."'"; $resultd = $mysqli->query($queryd); $Managerd = $resultd->fetch_assoc(); $Regions_Name = $Managerd['Regions_Name']; //header('Location: update_offer_employee.php?error='.$Regions_Name.''.$Job_Category_Name.''); // exit(); if (!$mysqli->query("UPDATE Job_Post SET Post_Title='$Post_Title', Mission_of_your_company='$Mission_of_your_company', Your_3_essential_values ='$Your_3_essential_values', Post_Job_Category_ID ='$List_of_industries',Post_Job_Category_Name ='$Job_Category_Name',Post_Regions_ID ='$Post_Regions',Post_Regions_Name ='$Regions_Name',Who_are_we ='$Who_are_we', Mission_of_this_post='$Mission_of_this_post', Future_achievements ='$Future_achievements', Are_you_the_wanted_person ='$Are_you_the_wanted_person', Update_Date ='$Register_Time' WHERE Job_Post_ID ='$Job_Post_ID' AND Master_ID ='$Register_ID'")) { // echo $mysqli->error; //header('Location: update_offer_employee.php?error='.$Job_Post_ID.','.$Register_ID.','.$mysqli->error); header('Location: update_offer_employee.php?var='.$Job_Post_ID.','.$Register_ID.',Votre mise à jour a échoué!'); exit(); }else{ // header('Location: update_offer_employee.php?error=4,1,Votre mise à jour est un succès!'); //exit(); } $stmt = $mysqli->prepare("DELETE FROM Post_Select_Category_Offering WHERE Job_Post_ID = ? and Master_ID = ?"); $stmt->bind_param('ii', $Job_Post_ID, $Register_ID); $stmt->execute(); $stmt->close(); //$Job_Post_ID = mysqli_insert_id($mysqli); $nSelection = count($Select_what_you_offer); for($i=0; $i < $nSelection; $i++) { $numberVal = $Select_what_you_offer[$i]; $query = "SELECT * FROM category_offering Where category_offering_ID ='".$numberVal."'"; $result = $mysqli->query($query); $Managers = $result->fetch_assoc(); $category_offering_Name = $Managers['category_offering_Name']; if ($insert_stmt = $mysqli->prepare("INSERT INTO Post_Select_Category_Offering (Job_Post_ID, Master_ID, Category_offering_ID, Category_offering_Name, Update_Date) VALUES (?, ?, ?, ?, ?)")) { $insert_stmt->bind_param('sssss',$Job_Post_ID,$Register_ID,$numberVal,$category_offering_Name,$Register_Time); // Execute the prepared query. if (! $insert_stmt->execute()) { $textq="d'inscription"; header('Location: update_offer_employee.php?var='.$Job_Post_ID.','.$Register_ID.',Échec '.$textq.' pour ajouter des informations pour existe post!'); exit(); }else { //header('Location: submit_offer_employee.php?error=register success!'); //exit(); } } } $stmt = $mysqli->prepare("DELETE FROM Post_Select_Essential_Values WHERE Job_Post_ID = ? and Master_ID = ?"); $stmt->bind_param('ii', $Job_Post_ID, $Register_ID); $stmt->execute(); $stmt->close(); $nSelections = count($Your_3_essential_values); for($r=0; $r < $nSelections; $r++) { $numberVals = $Your_3_essential_values[$r]; $query = "SELECT * FROM essential_values Where essential_values_ID ='".$numberVals."'"; $result = $mysqli->query($query); $Managers = $result->fetch_assoc(); $essential_values_Name = $Managers['essential_values_Name']; if ($insert_stmt = $mysqli->prepare("INSERT INTO Post_Select_Essential_Values (Job_Post_ID, Master_ID, Essential_values_ID, Essential_values_Name, Update_Date) VALUES (?, ?, ?, ?, ?)")) { $insert_stmt->bind_param('sssss',$Job_Post_ID,$Register_ID,$numberVals,$essential_values_Name,$Register_Time); // Execute the prepared query. if (! $insert_stmt->execute()) { $textq="d'inscription"; header('Location: submit_offer_employee.php?var='.$Job_Post_ID.','.$Register_ID.',Échec '.$textq.' pour ajouter des informations pour existe post!'); //header('Location: addassist.php?error='.$Managers_ID.''); exit(); }else { //header('Location: submit_offer_employee.php?error=register success!'); //exit(); } } } header('Location: update_offer_employee.php?var='.$Job_Post_ID.','.$Register_ID.',Succès post-inscription!'); exit(); } }
Save
cmd:
run