-
Notifications
You must be signed in to change notification settings - Fork 17
/
materi.php
68 lines (61 loc) · 3.45 KB
/
materi.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
<?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> Materi 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 materi");
?>
<?php while ($mapel = mysqli_fetch_array($mapelQ)) : ?>
<?php
if ($mapel['tgl_mulai'] < 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)) :
$warna = array('bg-red', 'bg-blue', 'bg-green', 'bg-gray', 'bg-purple');
?>
<div class="col-md-4">
<a href="<?= $homeurl . '/lihatmateri/' . enkripsi($mapel['id_materi']) ?>">
<!-- 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 <?= $warna[rand(0, count($warna) - 1)] ?> " 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>
<?= $mapel['tgl_mulai'] ?>
</div>
<div class="box-footer">
<center>
<?= $mapel['judul'] ?>
</center>
</div>
</div>
<!-- /.widget-user -->
</a>
</div>
<?php endif; ?>
<?php } ?>
<?php endwhile; ?>
</div>
</div>
</div>
</div>