-
Notifications
You must be signed in to change notification settings - Fork 21
/
under-review.php
31 lines (24 loc) · 906 Bytes
/
under-review.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
27
28
29
30
31
<?php
//To Handle Session Variables on This Page
session_start();
//If user Not logged in then redirect them back to homepage.
//This is required if user tries to manually enter view-job-post.php in URL.
if(empty($_SESSION['id_company'])) {
header("Location: dashboard_company.php");
exit();
}
//Including Database Connection From db.php file to avoid rewriting in all files
require_once("db.php");
$sql = "SELECT * FROM apply_job_post WHERE id_company='$_SESSION[id_company]' AND id_user='$_GET[id]' AND id_jobpost='$_GET[id_jobpost]'";
$result = $conn->query($sql);
if($result->num_rows == 0)
{
header("Location: dashboard_company.php");
exit();
}
$sql = "UPDATE apply_job_post SET status='2' WHERE id_company='$_SESSION[id_company]' AND id_user='$_GET[id]' AND id_jobpost='$_GET[id_jobpost]'";
if($conn->query($sql) === TRUE) {
header("Location: job-applications.php");
exit();
}
?>