-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathtugas.php
101 lines (90 loc) · 5.52 KB
/
tugas.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
<?php
defined('APLIKASI') or exit('Anda tidak dizinkan mengakses langsung script ini!');
?>
<div class='row'>
<div class='col-md-12'>
<div class='box box-solid'>
<div class='box-header with-border'>
<h3 class='box-title'><i class="fas fa-edit "></i> Tugas Siswa</h3>
</div><!-- /.box-header -->
<div class='box-body'>
<?php
$siswa = mysqli_fetch_array(mysqli_query($koneksi, "SELECT * FROM siswa WHERE id_siswa='$_SESSION[id_siswa]'"));
$mapelQ = mysqli_query($koneksi, "SELECT * FROM tugas");
?>
<?php while ($mapel = mysqli_fetch_array($mapelQ)) : ?>
<?php
if ($mapel['tgl_selesai'] > date('Y-m-d H:i:s')) {
$datakelas = unserialize($mapel['kelas']);
$guru = fetch($koneksi, 'pengawas', ['id_pengawas' => $mapel['id_guru']]);
?>
<?php if (in_array($siswa['id_kelas'], $datakelas) or in_array('semua', $datakelas)) : ?>
<div class="col-md-4">
<!-- Widget: user widget style 1 -->
<div class="box box-widget widget-user-2">
<!-- Add the bg color to the header using any of the bg-* classes -->
<div class="widget-user-header bg-red" style="padding: 6px">
<div class="widget-user-image">
<img src="dist/img/soal.png" alt="">
</div>
<!-- /.widget-user-image -->
<span style="font-size: 20px"> <b>
<?php
if (strlen($mapel['mapel']) > 30) {
echo substr($mapel['mapel'], 0, 30) . "...";
} else {
echo $mapel['mapel'];
}
?>
</b></span>
<p>Guru : <?= $guru['nama'] ?></p>
</div>
<div class="box-footer no-padding">
<ul class="nav nav-stacked">
<li>
<center>
<a href="#">
<?php
if (strlen($mapel['judul']) > 25) {
echo substr($mapel['judul'], 0, 25) . "...";
} else {
echo $mapel['judul'];
}
?>
</a>
</center>
</li>
<li>
<a href="#">
<i class='fas fa-clock'></i> Ujian Dimulai
<span class="pull-right badge bg-green"><?= $mapel['tgl_mulai'] ?></span>
</a>
</li>
<li>
<a href="#">
<i class='fas fa-clock'></i> Ujian Ditutup
<span class="pull-right badge bg-red"><?= $mapel['tgl_selesai'] ?></span>
</a>
</li>
</ul>
<center style="padding: 8px">
<?php if ($mapel['tgl_mulai'] > date('Y-m-d H:i:s') and $mapel['tgl_selesai'] > date('Y-m-d H:i:s')) { ?>
TUGAS BELUM MULAI
<?php } elseif ($mapel['tgl_mulai'] < date('Y-m-d H:i:s') and $mapel['tgl_selesai'] > date('Y-m-d H:i:s')) { ?>
<a href="<?= $homeurl . '/lihattugas/' . enkripsi($mapel['id_tugas']) ?>" class="btn btn-primary">
<i class="fa fa-edit"></i> Lihat Tugas
</a>
<?php } ?>
<!-- Button trigger modal -->
</center>
</div>
</div>
<!-- /.widget-user -->
</div>
<?php endif; ?>
<?php } ?>
<?php endwhile; ?>
</div>
</div>
</div>
</div>