/
home
/
techb158
/
immovalet.ca
/
Master
/
Inc
/
/home/techb158/immovalet.ca/Master/Inc
mkdir
upload
Name
Size
Mode
Actions
Publish_Post.php
5994
0666
edit
dl
rm
Update_Profile.php
3556
0666
edit
dl
rm
Update_Publish_Post.php
6318
0666
edit
dl
rm
upload.php
2458
0666
edit
dl
rm
Edit:
/home/techb158/immovalet.ca/Master/Inc/Publish_Post.php
(5994B)
<?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['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']; $Post_Title = mysqli_real_escape_string($mysqli,htmlentities($_POST['Post_Title'])); $Number_Of_Word_Hours = mysqli_real_escape_string($mysqli,htmlentities($_POST['Number_Of_Word_Hours'])); //$Date_Of_Entry = mysqli_real_escape_string($mysqli,htmlentities($_POST['Date_Of_Entry'])); $Date_Of_Entry=date("Y-m-d", strtotime($_POST['Date_Of_Entry'])); $Mission_of_your_company = mysqli_real_escape_string($mysqli,htmlentities($_POST['Mission_of_your_company'])); $Type_of_employment = mysqli_real_escape_string($mysqli,htmlentities($_POST['Type_of_employment'])); $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'])); $Post_Regions = $_POST['Post_Regions']; $List_of_industries = $_POST['List_of_industries']; $query = "SELECT * FROM Job_Category Where Job_Category_ID ='".$List_of_industries."'"; $result = $mysqli->query($query); $Manager = $result->fetch_assoc(); $Job_Category_Name = mysqli_real_escape_string($mysqli,htmlentities($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 = mysqli_real_escape_string($mysqli,htmlentities($Managerd['Regions_Name'])); if ($insert_stmt = $mysqli->prepare("INSERT INTO Job_Post (Master_ID, Post_Title,Date_Of_Entry,Number_Of_Word_Hours, Type_of_employment,Mission_of_your_company,Post_Job_Category_ID,Post_Job_Category_Name,Post_Regions_ID,Post_Regions_Name, Who_are_we, Mission_of_this_post, Future_achievements, Are_you_the_wanted_person,Post_Creation_Date, Update_Date) VALUES (?,?,?, ?, ?, ?, ?,?, ?, ?, ?, ?, ?, ?, ?, ?)")) { $insert_stmt->bind_param('ssssssssssssssss',$Register_ID,$Post_Title,$Date_Of_Entry,$Number_Of_Word_Hours,$Type_of_employment,$Mission_of_your_company,$List_of_industries,$Job_Category_Name,$Post_Regions,$Regions_Name,$Who_are_we,$Mission_of_this_post,$Future_achievements,$Are_you_the_wanted_person,$Register_Time,$Register_Time); // Execute the prepared query. if (! $insert_stmt->execute()) { $textq="d'inscription"; header('Location: submit_offer_employee.php?error=É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(); //.$mysqli->error } } $Select_what_you_offer = $_POST['Select_what_you_offer']; $Your_3_essential_values = $_POST['Your_3_essential_values']; $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: submit_offer_employee.php?error=É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(); } } } $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?error=É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: submit_offer_employee.php?error=Succès post-inscription!'); exit(); } }
Save
cmd:
run