-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathApplication.php
115 lines (108 loc) · 3.16 KB
/
Application.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<?php
if (session_status() === PHP_SESSION_NONE) {
session_start();
}
if(!isset($_SESSION['username'])){
header('location:adminlogin.php');
exit(); // Ensure script stops after redirection
}
$c_email = $_SESSION['username'];
$mysqli = new mysqli("localhost", "root", "", "jobportal");
if ($mysqli->connect_error) {
die("Connection failed: " . $mysqli->connect_error);
}
$result = $mysqli->query("
SELECT
a.application_id,
js.jobseeker_name,
js.jobseeker_email,
j.jobTitle
FROM
application a
JOIN
jobseeker js ON a.jobseeker_email = js.jobseeker_email
JOIN
job j ON a.job_id = j.job_id;
");
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Applicant Dashboard</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
.Application_list {
display: flex;
justify-content: center;
align-items: center;
width: 650px;
border-radius: 5px;
margin: auto;
margin-top: 20px;
}
table {
position: relative;
height: auto;
width: 700px;
border-collapse: collapse;
border-radius: 10px;
overflow: hidden;
box-shadow: 0 2px 12px rgba(90, 89, 89, 0.3);
background-color:#fff
}
table tr th {
border: none;
border-bottom: 1px solid grey;
}
th, td {
padding: 12px;
border: none;
border-bottom: 1px solid #d3d3d3;
text-align: center;
}
h3 {
color: #338573;
text-align: center;
font-size: 24px;
}
</style>
</head>
<body>
<h3>Applicants</h3>
<div class="Application_list">
<table>
<thead>
<tr>
<th>Job Title</th>
<th>Applicant Name</th>
<th>Applicant Email</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php if ($result->num_rows > 0): ?>
<?php while($row = $result->fetch_assoc()): ?>
<tr>
<td><?php echo htmlspecialchars($row['jobTitle']); ?></td>
<td><?php echo htmlspecialchars($row['jobseeker_name']); ?></td>
<td><?php echo htmlspecialchars($row['jobseeker_email']); ?></td>
<td>
<a href="deleteapplication.php?id=<?php echo htmlspecialchars($row['application_id']); ?>">Delete</a>
</td>
</tr>
<?php endwhile; ?>
<?php else: ?>
<tr>
<td colspan="4">No applicants found.</td> <!-- Corrected colspan to 4 -->
</tr>
<?php endif; ?>
</tbody>
</table>
</div>
</body>
</html>
<?php
$mysqli->close();
?>