-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathscore_test.php
348 lines (304 loc) · 14.7 KB
/
score_test.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
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
<?php
session_start();
$loginPath = "../login.php";
if (!isset($_SESSION['user'])) {
header("location: " . $loginPath);
die;
}
switch ($_SESSION['user']->{'role_id'}) {
case 1:
echo "
<script>
alert('Akses ditolak!');
location.replace('../Admin/');
</script>
";
break;
case 3:
echo "
<script>
alert('Akses ditolak!');
location.replace('../Student/');
</script>
";
break;
default:
break;
}
require_once './api/get_api_data.php';
$data = json_decode(http_request("https://lessons.lumintulogic.com/api/modul/read_modul_rows.php"));
$courseData = array();
for ($i = 0; $i < count($data->{'data'}); $i++) {
if ($data->{'data'}[$i]->{'parent_id'} == null) {
array_push($courseData, $data->{'data'}[$i]);
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Assignment Page</title>
<!-- Font -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700&display=swap" rel="stylesheet">
<!-- Jqueey -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js" integrity="sha512-894YE6QWD5I59HgZOGReFYm4dnWc1Qt5NtvYSaNcOP+u1T9qYdvdihz0PPSiiqn/+/3e7Jo4EaG7TubfWGUrMQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<!-- Icons -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css">
<!-- CSS -->
<!-- <link rel="stylesheet" href="./CSS/UploafField.css"> -->
<!-- Tailwindcss -->
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/flowbite.min.css" />
<script>
tailwind.config = {
theme: {
extend: {
fontFamily: {
montserrat: ["Montserrat"],
},
colors: {
"dark-green": "#1E3F41",
"light-green": "#659093",
"cream": "#DDB07F",
"cgray": "#F5F5F5",
}
}
}
}
</script>
<style>
.in-active {
width: 80px !important;
padding: 20px 15px !important;
transition: .5s ease-in-out;
}
.in-active ul li p {
display: none !important;
}
.in-active ul li a {
padding: 15px !important;
}
.in-active h2,
.in-active h4,
.in-active .logo-incareer {
display: none !important;
}
.hidden {
display: none !important;
}
.sidebar {
transition: .5s ease-in-out;
}
</style>
</head>
<body>
<div class="flex items-center">
<!-- Left side (Sidebar) -->
<div class="bg-white w-[350px] h-screen px-8 py-6 flex flex-col justify-between sidebar in-active">
<!-- Top nav -->
<div class="flex flex-col gap-y-6">
<!-- Header -->
<div class="flex items-center space-x-4 px-2">
<img src="Img/icons/toggle_icons.svg" alt="toggle_dashboard" class="w-8 cursor-pointer" id="btnToggle">
<img class="w-[150px] logo-incareer" src="./Img/logo/logo_primary.svg" alt="Logo In Career">
</div>
<hr class="border-[1px] border-opacity-50 border-[#93BFC1]">
<!-- List Menus -->
<div>
<ul class="flex flex-col gap-y-1">
<li>
</li>
<li>
<a href="" class="flex items-center gap-x-4 h-[50px] rounded-xl px-4 hover:bg-cream text-dark-green hover:text-white">
<img class="w-5" src="./Img/icons/home_icon.svg" alt="Dashboard Icon">
<p class="font-semibold">Dashboard</p>
</a>
</li>
<li>
<a href="#" class="flex items-center gap-x-4 h-[50px] rounded-xl px-4 bg-cream">
<img class="w-5" src="./Img/icons/course_icon.svg" alt="Course Icon">
<p class="text-white font-semibold">Courses</p>
</a>
</li>
<li>
<a href="" class="flex items-center gap-x-4 h-[50px] rounded-xl px-4 hover:bg-cream text-dark-green hover:text-white">
<img class="w-5" src="./Img/icons/score_icon.svg" alt="Score Icon">
<p class="font-semibold">Score</p>
</a>
</li>
<li>
<a href="" class="flex items-center gap-x-4 h-[50px] rounded-xl px-4 hover:bg-cream text-dark-green hover:text-white">
<img class="w-5" src="./Img/icons/schedule_icon.svg" alt="Schedule Icon">
<p class="font-semibold">Schedule</p>
</a>
</li>
<li>
<a href="" class="flex items-center gap-x-4 h-[50px] rounded-xl px-4 hover:bg-cream text-dark-green hover:text-white">
<img class="w-5" src="./Img/icons/attendance_icon.svg" alt="Attendance Icon">
<p class="font-semibold">Attendance</p>
</a>
</li>
<li>
<a href="" class="flex items-center gap-x-4 h-[50px] rounded-xl px-4 hover:bg-cream text-dark-green hover:text-white">
<img class="w-5" src="./Img/icons/consult_icon.svg" alt="Consult Icon">
<p class="font-semibold">Consult</p>
</a>
</li>
</ul>
</div>
</div>
<!-- Bottom nav -->
<div>
<ul class="flex flex-col ">
<li>
<a href="#" class="flex items-center gap-x-4 h-[50px] rounded-xl px-4 hover:bg-cream text-dark-green hover:text-white">
<img class="w-5" src="./Img/icons/help_icon.svg" alt="Help Icon">
<p class="font-semibold">Help</p>
</a>
</li>
<li>
<a href="#" class="flex items-center gap-x-4 h-[50px] rounded-xl px-4 hover:bg-cream text-dark-green hover:text-white">
<img class="w-5" src="./Img/icons/logout_icon.svg" alt="Log out Icon">
<p class="font-semibold">Log out</p>
</a>
</li>
</ul>
</div>
</div>
<!-- Right side -->
<div class="bg-cgray w-full h-screen px-10 py-6 flex flex-col gap-y-6 overflow-y-scroll">
<!-- Header / Profile -->
<div class="flex items-center gap-x-4 justify-end">
<img class="w-10" src="./Img/icons/default_profile.svg" alt="Profile Image">
<p class="text-dark-green font-semibold">User Name</p>
</div>
<!-- Breadcrumb -->
<div>
<ul class="flex items-center gap-x-4">
<li>
<a class="text-light-green" href="#">Home</a>
</li>
<li>
<span class="text-light-green">/</span>
</li>
<li>
<a class="text-dark-green font-semibold" href="#">Score</a>
</li>
</ul>
</div>
<div class="container- bg-white p-4 rounded">
<div class="container" style="display: table;">
<div class="container p-4 rounded my-4">
<div class="container" style="display: table;">
<div class="section-period" style="display: table-row;">
<p class="font-bold" style="display: table-cell; width: 5%;">Period :</p>
<select id="countries" class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5">
<option selected></option>
<option value="US">Filter 1</option>
<option value="US">Filter 2</option>
<option value="US">Filter 3</option>
</select>
</div>
</div>
</div>
</div>
<div class="container-lg">
<div class="relative overflow-x-auto shadow-md sm:rounded-lg">
<table class="w-full text-sm text-left text-gray-500 dark:text-gray-400">
<colgroup>
<col span="1" style="width: 10%">
<col span="1" style="width: 10%">
<col span="1" style="width: 10%">
<col span="1" style="width: 10%">
<col span="1" style="width: 10%">
<col span="1" style="width: 10%">
</colgroup>
<thead class="text-xs text-gray-700 uppercase bg-cream">
<tr>
<th scope="col" class="px-6 py-3">
Course
</th>
<th scope="col" class="px-6 py-3">
Assignment Subject
</th>
<th scope="col" class="px-6 py-3">
Weight
</th>
<th scope="col" class="px-6 py-3">
Score
</th>
<th scope="col" class="px-6 py-3">
Total
</th>
<th scope="col" class="px-6 py-3">
Grade
</th>
</tr>
</thead>
<tbody>
<?php foreach ($courseData as $item) : ?>
<tr class="bg-white border-b">
<td class="px-6 py-4 font-medium text-gray-900">
<?= $item->modul_name ?>
</td>
<td class="px-6 py-4 font-medium text-gray-900">
<table>
<?php
$dataSub = json_decode(http_request("https://lessons.lumintulogic.com/api/modul/read_childs.php?id=$item->id"));
$dataSub = $dataSub->data;
?>
<?php foreach ($dataSub as $itemSub) { ?>
<tr>
<td>
<p class="py-2"><?= $itemSub->modul_name ?></p>
</td>
</tr>
<?php } ?>
</table>
</td>
<td class="px-6 py-4 font-medium text-gray-900">
<table>
<?php
$dataWeg = json_decode(http_request("https://lessons.lumintulogic.com/api/modul/read_childs.php?id=$item->id"));
$dataWeg = $dataWeg->data; ?>
<?php foreach ($dataWeg as $itemWeg) { ?>
<tr>
<td>
<p class="py-2"><?= $itemWeg->modul_weight * 100 ?>%</p>
</td>
</tr>
<?php } ?>
</table>
</td>
<td class="px-6 py-4 font-medium text-gray-900">
<table>
</table>
</td>
<td class="px-6 py-4 font-medium text-gray-900">
92
</td>
<td class="px-6 py-4 font-medium text-gray-900">
A
</td>
</tr>
<?php endforeach ?>
</tbody>
</table>
</div>
</div>
</div>
<script src="https://unpkg.com/[email protected]/dist/flowbite.js"></script>
<script>
let btnToggle = document.getElementById('btnToggle');
let sidebar = document.querySelector('.sidebar');
btnToggle.onclick = function() {
sidebar.classList.toggle('in-active');
}
</script>
</body>
</html>