-
Notifications
You must be signed in to change notification settings - Fork 0
/
getvacancies.php
71 lines (57 loc) · 1.67 KB
/
getvacancies.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<?php
session_start();
$name = $_GET['name'];
$servername="localhost";
$username="root";
$password="password";
$dbname="project";
$conn = new mysqli($servername,$username,$password,$dbname);
if (!$conn) {
die('Could not connect: ' . mysqli_error($conn));
}
$sql="SELECT * FROM vacancy WHERE company_name = '".$name."'";
$result = $conn->query($sql);
echo "<div class=\"table-responsive table-bordered\" >
<table class=\"table table-hover\">
<tr>
<th>Job Title</th>
<th>Salary</th>
<th>Location</th>
<th>Eligiblity</th>
</tr>
";
while($row = $result->fetch_assoc()){
echo "
<tr>
<td>".$row['job_title']."</td>
<td>".$row['salary']."</td>
<td>".$row['location']."</td>";
$sql1="SELECT * FROM applications WHERE s_mail = '".$_SESSION['email']."' AND job_id=".$row['job_id']."";
$result1 = $conn->query($sql1);
if($result1->num_rows != 0){
$row1 = $result1->fetch_assoc();
if($row1['status'] == 0){
echo "<td>Status: Pending</td>";
}elseif($row1['status'] == 1){
echo "<td>Status: Accepted!</td>";
}else {
echo "<td>Status: Rejected!</td>";
}
}else{
echo" <td>
<input type=\"button\" value=\"Check eligiblity\" onclick=\"msg('".$row['job_id']."','".$_SESSION['email']."',this)\">
</td>";
}
echo "</tr>";
}
echo "
</table>
</div>";
?>
</body>
</html>