-
Notifications
You must be signed in to change notification settings - Fork 138
/
internreview.php
253 lines (215 loc) · 7.67 KB
/
internreview.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
<?php
require_once 'classControllers/init.php';
// include('backend/internreview.php');
if(!isset($_SESSION["role"])) {
header('Location:login.php');
}
$admin = new InternExperience();
if(isset($_GET['action']) && isset($_GET['id'])){
$act = $_GET['action'];
switch ($act){
case 'approve':
$admin->approveExperience($_GET['id']);
break;
case 'delete':
$admin->deleteExperience($_GET['id']);
break;
case 'hide':
$admin->hidex($_GET['id']);
break;
}
$_SESSION['msg'] = "<div class='alert alert-success'>Action performed successfully</div>";
header("location:internreview.php");
exit();
}
$display = $admin->load_experiences();
/*
if(isset($_GET["editExperiences"])) {
$id = $_GET["editExperiences"];
$editExperiencesRes = $InternExperience->editExperiences($id);
if($editExperiencesRes == true) {
header("Location:internreview");
}
}
if(isset($_GET["ApproveExperiences"])) {
$id = $_GET["ApproveExperiences"];
$ApproveExperiencesRes = $InternExperience->ApproveExperiences($id);
if($ApproveExperiencesRes == true) {
header("Location:internreview");
}
}
if (isset($_GET['delete_Experiences'])) {
$admin_id = $_GET['ApproveExperiences'];
$message = $InternExperience->ApproveExperiences($admin_id);
}
if(isset($_GET["editExperiences"])) {
$id = $_GET["editExperiences"];
$editExperiencesRes = $InternExperience->editExperiences($id);
if($editExperiencesRes == true) {
header("Location:internreview");
}
}
if(isset($_GET["ApproveExperiences"])) {
$id = $_GET["ApproveExperiences"];
$ApproveExperiences= $InternExperience->ApproveExperiences($id);
if($ApproveExperiencesRes == true) {
header("Location:internreview");
}
}
*/
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Intern Reviews</title>
<link rel="icon" type="img/png" href="images/hng-favicon.png">
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/all.min.css">
<link href="css/dashboard.css?v=<?php echo time(); ?>" rel="stylesheet" type="text/css" />
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css">
<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<!-- Latest compiled JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"></script>
<style type="text/css">
.card {
height: 150px;
background: #ccc;
margin: 15px;
padding: 10px;
border-radius: 15px;
}
.col-md-2 {
height: 40px;
}
.col-md-8 {
height: 1px;
padding: 0;
margin: 0;
}
@media (max-width: 400px) {
.heading {
margin-top: 50px !important;
font-size: 18px !important;
}
}
</style>
</head>
<body>
<main class="reg">
<?php
if ($_SESSION["role"] != 1) {
echo '<h2><br><br><br>Sorry, You do not have the priviledge to view this page</p>';
echo '<h3><a href="dashboard">Dashboard</a></h3>';
exit();
}
?>
<section id="overview-section">
<h1 class="heading">INTERN REVIEWS</h1>
<div class="register-container">
<div class="row">
<?php
if(isset($_SESSION['msg'])){
echo $_SESSION['msg'];
unset($_SESSION['msg']);
}
if (count($display) == "0") {
echo "<h2>There are no Intern Reviews</h2>";
} else {
?>
<div class="col-md-8"></div>
</div>
<br /><br />
<div class="row" id="table-row">
<div class="table-responsive" id="printablediv">
<table class="table table-hover mt-3 mb-1 table-condensed">
<thead class="table-primary">
<tr>
<th>S/N</th>
<th>Names</th>
<th>Track</th>
<th>Experience</th>
<th>Status</th>
<th colspan="2">Action</th>
</tr>
</thead>
<tbody>
<?php
//echo $display;
//var_dump($display);
$n = 0;
foreach ($display as $item){
?>
<tr>
<td><?php echo ++$n;?></td>
<td><?php echo $item['names']; ?></td>
<td><?php echo $item['stack']; ?></td>
<td> <?php echo $item['experience']; ?> </td>
<td>
<?php
if($item['status'] == 0){
?>
<a href="?action=approve&id=<?=$item['id'];?>" class="btn btn-primary btn-sm" style="margin-right: 5px;">Show</a>
<?php
} else {
?>
<a href="?action=hide&id=<?=$item['id'];?>" class="btn btn-success btn-sm" style="margin-right: 5px;">Hide</a>
<?php
}
?>
</td>
<td>
<a href="edit_experience?id=<?php echo $item['id']; ?>" class="btn btn-sm btn-info">Edit</a>
</td>
<td>
<a href="?action=delete&id=<?php echo $item['id']; ?>" class="btn btn-sm btn-danger" onclick="return confirm('Are you sure you want to delete the record?')">Delete</a>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
<?php
}
?>
</div>
</div>
<br /><br />
<!-- <button id="export">Export to Spreadsheet</button> -->
</section>
<!-- <section id="details-section">
<div id="details-back">
<div>
<a href="overview.html" id="newitem-go-back" title="Go back">
<div></div>
</a>
</div>
</div>
<h2>Intern application details</h2>
<em id="no-intern">No intern selected</em>
<br />
<p>Name: <span id="details-name"></span></p>
<p>Email: <span id="details-email"></span></p>
<p>Age: <span id="details-age"></span></p>
<p>Phone Number: <span id="details-number"></span></p>
<p>Track of interest: <span id="details-track"></span></p>
<p>CV link: <span id="details-CV-link"></span></p>
<p>State of residence: <span id="details-state-of-residence"></span></p>
<div href="" id="details-return">Back to Overview</div>
</section> -->
</main>
<input type="checkbox" id="mobile-bars-check" />
<label for="mobile-bars-check" id="mobile-bars">
<div class="stix" id="stik1"></div>
<div class="stix" id="stik2"></div>
<div class="stix" id="stik3"></div>
</label>
<?php include('fragments/sidebar.php'); ?>
</body>
</html>
<script type="text/javascript" src="js/sidebar.js"></script>