forked from Justmalhar/weshare
-
Notifications
You must be signed in to change notification settings - Fork 0
/
update-applicant.php
26 lines (26 loc) · 1012 Bytes
/
update-applicant.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
session_start();
$userid = $_SESSION['user_id'];
$jobid = $_POST['jobid'];
$_SESSION['jobidtopayment']=$jobid;
echo $jobid;
$applicantid=$_POST['applicantid']; //get this from previous page which has list of applicants
echo $applicantid;
$status="ACCEPTED";
include("ConnectToAWS.php");
$sql = "UPDATE job SET status='$status' WHERE id = '$jobid' "; //mark the job as accepted in job table so that it is not shown anywhere else anymore
$result = mysqli_query($db,$sql);
if (!$result) {
printf("Error: %s\n", mysqli_error($db));
echo "ERROR";
exit();
}
$sql2 = "UPDATE job_applicant SET status='$status' WHERE job_id = '$jobid' AND user_id='$applicantid' "; //mark job as accepted only for the jobapplicant which is selected as applicantid here
$result2 = mysqli_query($db,$sql2);
if (!$result2) {
printf("Error: %s\n", mysqli_error($db));
echo "ERROR";
exit();
}
header('location: account-home.php');
?>