-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathempdashboard.php
278 lines (267 loc) · 8.39 KB
/
empdashboard.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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
<?php
ob_start();
session_start();
if (!isset($_SESSION['email'])) {
header('location:emplogin.php');
}
$c_email = $_SESSION['email'];
$mysqli = new mysqli("localhost", "root", "", "jobportal");
if ($mysqli->connect_error) {
die("Connection failed: " . $mysqli->connect_error);
}
$stmt = $mysqli->prepare("SELECT c_name, c_location, contact_no, industry, c_image FROM company WHERE c_email = ?");
$stmt->bind_param("s", $c_email);
$stmt->execute();
$result = $stmt->get_result();
if ($result->num_rows > 0) {
$row = $result->fetch_assoc();
$c_name = $row['c_name'];
$c_location = $row['c_location'];
$contact_no = $row['contact_no'];
$industry = $row['industry'];
$c_image = $row['c_image'];
} else {
echo "<script>alert('No company found with the given email.'); window.location.href='emplogin.php';</script>";
}
$stmt->close();
$mysqli->close();
ob_end_flush();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Emp dashboard</title>
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="jobseekerdashboard.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
h2 {
color: #338573;
margin-bottom: 20px;
}
.header1 nav {
overflow: hidden;
align-items: center;
display: flex;
position: relative;
justify-content: space-between;
height: 90px;
padding: 30px;
position: sticky;
top: 0;
z-index: 3;
background-color: #ffffff;
border-bottom: 1px solid #338573;
}
nav a {
display: block;
color: #338573;
padding: 10px 12px;
text-decoration: none;
font-weight: normal;
font-size: 16px;
position: relative;
padding-bottom: 5px;
}
nav a::after {
content: '';
position: absolute;
width: 100%;
height: 4px;
background-color: #cccccc;
left: 0;
bottom: -2px;
transform: scaleX(0);
transition: transform 0.3s ease;
transform-origin: bottom right;
}
nav a:hover::after{
transform: scaleX(1);
transform-origin: bottom left;
background-color: #cccccc;
}
nav a.active::after {
transform: scaleX(1);
transform-origin: bottom left;
background-color: #338573;
}
.nav-links {
flex: 1;
display: flex;
justify-content: flex-end;
}
.nav-links ul {
list-style-type: none;
margin: 0;
padding: 0;
display: flex;
margin-bottom:30px;
}
.nav-links li {
margin-right: 20px;
}
.nav-links a {
font-weight: bold;
font-size: 18px;
}
.nav-links a:last-child {
margin-right: 0;
}
.notification-icon {
cursor: pointer;
}
.profile {
cursor: pointer;
}
.logo {
margin-right: 20px;
padding:20px;
}
.dropdown {
position: absolute;
top: 73px;
right: 10px;
background-color: #fdfdfd;
width: 170px;
box-shadow: 0 2px 5px rgba(0,0,0,0.2);
padding: 15px;
border-radius: 10px;
z-index: 1000; /* Ensure this is higher than other elements */
display: none; /* Initial state is hidden */
}
.dropdown::before{
content: '';
position: absolute;
top: -18px;
right: 28px;
border: 10px solid;
border-color: transparent transparent #f4f2f2 transparent;
}
.dropdown .user-info{
display: flex;
align-items: center;
}
.dropdown .user-info img{
width: 30px;
height: 30px;
object-fit: cover;
border-radius: 50%;
cursor: pointer;
border: 1.5px solid #338573;
margin-right: 8px;
}
.dropdown .dropdownlist img{
width: 25px;
height: 25px;
background: #e5e5e5;
border-radius: 35%;
padding: 5px;
margin-right: 15px;
}
.dropdown hr{
border: 0;
width: 100%;
height: 1px;
margin: 10px 0 5px;
background: #ccc;
}
.dropdown .dropdownlist .sub-menu-links{
display: flex;
align-items: center;
color: #525252;
margin: 12px 0;
}
.dropdown .dropdownlist .sub-menu-links p{
width: 100%;
}
.dropdownlist :hover p{
font-weight: 600;
transition: transform 0.5s;
transform: translateY(-0.4px);
}
</style>
</head>
<body>
<?php
$activePage = isset($_GET['page']) ? $_GET['page'] : 'postedjob';
?>
<div class="header1">
<nav>
<div class="logo">
<h2>Job Portal</h2>
</div>
<div class="nav-links">
<ul>
<li><a href="?page=postedjob" <?php echo ($activePage === 'postedjob') ? 'class="active"' : ''; ?>>Jobs</a></li>
<li><a href="?page=applicant" <?php echo ($activePage === 'applicant') ? 'class="active"' : ''; ?>>Application</a></li>
<li><a href="?page=job_post" <?php echo ($activePage === 'job_post') ? 'class="active"' : ''; ?>>Open Position</a></li>
</ul>
</div>
<div class="notification-icon" onclick="window.location.href='notification.php'">
<i class="fas fa-bell"></i>
</div>
<div class="profile" onclick="toggleDropdown()">
<img src="<?php echo $c_image; ?>" alt="profile" width="25px">
</div>
</nav>
</div>
<div class="dropdown" id="dropdownMenu">
<div class="user-info">
<img src="<?php echo $c_image; ?>" alt="profile" width="25px">
<h4><?php echo $c_name; ?></h4>
</div>
<hr>
<div class="dropdownlist">
<a href="logout.php" class="sub-menu-links"><img src="Images/exit.png"><p>Logout</p></a>
<a href="Setting4employer.php" class="sub-menu-links"><img src="Images/settings.png"><p>Settings</p></a>
<a href="c_profile_edit.php" class="sub-menu-links"><img src="Images/edit-info.png"><p>Profile</p></a>
</div>
</div>
</nav>
</div>
<hr>
<div class="main-content">
<?php
switch ($activePage) {
case 'postedjob':
include 'postedjob.php';
break;
case 'applicant':
include 'applicant.php';
break;
case 'job_post':
include 'job_post.php';
break;
default:
include 'applicant.php';
break;
}
?>
</div>
<footer id="footer">
<div class="footer-bottom-content">
<p>Designed By Job Portal teams</p>
<div class="copyright">
<p>©Copyright <strong>Job portal</strong>.All Rights Reserved</p>
</div>
</div>
</footer>
<script>
document.addEventListener('DOMContentLoaded', function() {
const dropdownMenu = document.getElementById('dropdownMenu');
window.toggleDropdown = function() {
dropdownMenu.style.display = dropdownMenu.style.display === 'block' ? 'none' : 'block';
console.log("Toggle dropdown"); // Add this line to check if the function is called
}
document.addEventListener('click', function(event) {
const profileIcon = document.querySelector('.profile');
if (!profileIcon.contains(event.target) && !dropdownMenu.contains(event.target)) {
dropdownMenu.style.display = 'none';
}
});
});
</script>
</body>
</html>