-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathit_specialist_dashboard.php
307 lines (250 loc) · 11.8 KB
/
it_specialist_dashboard.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
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
<?php
session_start();
include_once 'DB.php';
$db = new DBhelper();
$loginId=$_SESSION['ActiveUser'];
$eml = $db->getData("credentials","Email","LoginID",$loginId);
$id = $db->getData("specialist","SpecialistID","Email",$eml);
$it = $db->getRows("specialist", [ 'where' => ['SpecialistId' => $id ] ]);
$Opp = $db->getRows("opportunity");
$OppId = $db->getData("applicants", "opportunityID", "SpecialistId", $id);
$Opp_2 = $db->getRows("opportunity", ['where' => ['opportunityId' => $OppId]]);
$specialistId = $db->getData("specialist", "SpecialistID", "Email", $eml);
$applicantId = $db->getData("applicants", "ApplicantID", "SpecialistID", $specialistId);
$msgs = $db->getRows("messages", ['where' => ['applicantId' => $applicantId]]);
if ( isset($_POST['delete']) ) {
$db->delete('applicants', [ 'where' => [ 'opportunityID' => $OppId ]]);
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>User Dashboard</title>
<link rel="stylesheet" href="assets/style.css">
<link rel="stylesheet" href="assets/style3.css">
<link href="bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet">
<style>
/* Additional CSS styles for project cards */
.project-card {
border: 1px solid #ccc;
border-radius: 8px;
padding: 16px;
margin-bottom: 16px;
}
.project-card h5 {
margin-top: 0;
}
.project-card p {
margin-bottom: 8px;
}
.project-card .actions {
margin-top: 8px;
}
.project-card .actions button {
margin-right: 8px;
}
</style>
<script>
document.addEventListener("DOMContentLoaded", function() {
const tabs = document.querySelectorAll(".tab");
const sections = document.querySelectorAll(".section");
function deactivateAll() {
tabs.forEach(tab => tab.classList.remove("active"));
sections.forEach(section => section.classList.remove("active"));
}
tabs.forEach((tab, index) => {
tab.addEventListener("click", () => {
deactivateAll();
tab.classList.add("active");
sections[index].classList.add("active");
});
});
// Set default active tab and section
tabs[0].classList.add("active");
sections[0].classList.add("active");
});
</script>
</head>
<body>
<div class="container">
<div class="text-center mb-4">
<h1>Zan-Tech Opportunities</h1>
<h2 class="text-success"><?php echo $it[0]['FullName'] ?> Dashboard</h2>
</div>
<div class="tabs">
<div class="tab">Profile</div>
<div class="tab">Available Opportunities</div>
<div class="tab">My Applications</div>
<div class="tab">Messages</div>
<div class="tab">Rate</div>
<a class="tab" href="#" data-toggle="modal" data-target="#logoutModal">
<i class="fas fa-sign-out-alt fa-sm fa-fw mr-2 text-gray-400"></i>
Logout
</a>
</div>
<div class="section">
<h2>Profile</h2>
<div class="profile-content">
<div class="personal-details">
<h5 class="text-success">Personal Details</h5>
<ul>
<li>Name: <?php echo $it[0]['FullName']; ?></li>
<li>Email: <?php echo $it[0]['Email']; ?></li>
<li>Phone: <?php echo $it[0]['phone_Number']; ?></li>
</ul>
</div>
<div class="github">
<h5 class="text-success">GitHub</h5>
<ul>
<li>GitHub: <a class="text-success" href="https://github.com/nahida" target="_blank">nahida</a></li>
</ul>
</div>
<div class="others">
<h5 class="text-success">Others</h5>
<ul>
<li>View CV: <a class="text-success" href="https://github.com/nahida" target="_blank">My CV</a></li>
</ul>
</div>
<div class="row mt-3">
<div class="col-12">
<a href="it_specialist_registration.php">update profile</a>
</div>
</div>
</div>
</div>
<div class="section">
<h2>Available Opportunities</h2>
<ul class="list">
<?php if (is_array($Opp)) { ?>
<?php
foreach ($Opp as $ops) {
?>
<li class="item">
<div class="details">
<div>
<div class="title"><?= $ops["Tittle"]; ?></div>
<div class="company"><?= $ops["Requirements"]; ?></div>
<p> <?= $ops["ApplicationDeadline"]; ?></p>
</div>
</div>
<div class="actions">
<button class="btn btn-apply btn-primary" data-toggle="modal" data-target="#applicationModal">Apply</button>
<!-- Application Modal -->
<div class="modal fade" id="applicationModal" tabindex="-1" role="dialog" aria-labelledby="applicationModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="applicationModalLabel">Apply for <?= $ops["Tittle"]; ?></h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<form action="application_handler.php" id="applicationForm" method="post" enctype="multipart/form-data">
<input name="opportunityID" type="hidden" value="<?=$ops['opportunityID'] ?>">
<input name="SpecialistID" type="hidden" value="<?=$id ?>">
<div class="form-group">
<label for="coverLetter">Upload Application Letter:</label>
<input type="file" class="form-control" id="fileToUpload" name="fileToUpload" accept="application/pdf" required>
</div>
<button type="submit" name="confirm" class="btn btn-primary">Confirm Application</button>
</form>
</div>
</div>
</div>
</div>
</div>
</li>
<?php } ?>
<?php } else { ?>
<p>Sorry Failed to upload files: Perhaps; No datas found.</p>
<?php } ?>
<!-- Additional opportunity items can be added here -->
</ul>
</div>
<div class="section">
<h2>My Applications</h2>
<ul class="list">
<?php if (is_array($Opp_2)) { ?>
<?php
foreach( $Opp_2 as $opp ) {
?>
<li class="item" data-id="<?php echo $opp['opportunityID'] ?>">
<div class="details">
<div>
<div class="title">Title: <?php echo $opp['Tittle'] ?></div>
<div class="company">Type: <?php echo $opp['Type'] ?></div>
<div class="company">Requirements: <?php echo $opp['Requirements'] ?></div>
<div class="company">Start Date: <?php echo $opp['StartDate'] ?></div>
<div class="company">End Date: <?php echo $opp['EndDate'] ?></div>
<div class="company">Description: <?php echo $opp['Description'] ?></div>
<div class="company">Deadline: <?php echo $opp['ApplicationDeadline'] ?></div>
</div>
</div>
<div class="actions">
<form action="it_specialist_dashboard.php" method="POST">
<button name="delete" class="btn btn-delete">Delete</button>
</form>
</div>
</li>
<?php
}
?>
<?php } else { ?>
<p>No datas found.</p>
<?php } ?>
</ul>
</div>
<div class="section">
<div class="row my-3">
<div class="col-lg-6">
<h2>Messages</h2>
</div>
</div>
<hr>
<ul class="list">
<?php if (is_array($msgs)) { ?>
<?php foreach ($msgs as $msg) { ?>
<li class="item">
<div class="details">
<div>
<div class="title">Title: <?php echo $msg['title'] ?></div>
<div class="company">Company: <?php echo $msg['name'] ?></div>
</div>
<p><?php echo $msg['message'] ?>.</p>
</div>
</li>
<?php } ?>
<?php } else { ?>
<p>No messages found.</p>
<?php } ?>
</ul>
</div>
</div>
<!-- Logout Modal-->
<div class="modal fade" id="logoutModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Ready to Leave?</h5>
<button class="close" type="button" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">Select "Logout" below if you are ready to end your current session.</div>
<div class="modal-footer">
<button class="btn btn-secondary" type="button" data-dismiss="modal">Cancel</button>
<a class="btn btn-primary" href="handler/logout.php">Logout</a>
</div>
</div>
</div>
</div>
</body>
<script src="./bootstrap/jquery/jquery.min.js"></script>
<script src="bootstrap/js/popper.js"></script>
<script src="bootstrap/js/bootstrap.bundle.min.js"></script>
<!-- Include Bootstrap JS and dependencies -->
</html>