-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtop-menu.php
More file actions
executable file
·72 lines (62 loc) · 2.2 KB
/
top-menu.php
File metadata and controls
executable file
·72 lines (62 loc) · 2.2 KB
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
<!-- Aplikasi Persediaan Barang dengan PHP7 dan MySQLi
*******************************************************
* Developer : Indra Styawantoro
* Company : Indra Studio
* Release Date : 13 Maret 2017
* Website : www.indrasatya.com
* E-mail : indra.setyawantoro@gmail.com
* Phone : +62-856-6991-9769
-->
<?php
/* panggil file database.php untuk koneksi ke database */
require_once "config/database.php";
// fungsi query untuk menampilkan data dari tabel user
$query = mysqli_query($mysqli, "SELECT id_user, nama_user, foto, hak_akses FROM is_users WHERE id_user='$_SESSION[id_user]'")
or die('Ada kesalahan pada query tampil Manajemen User: '.mysqli_error($mysqli));
// tampilkan data
$data = mysqli_fetch_assoc($query);
?>
<li class="dropdown user user-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<!-- User image -->
<?php
if ($data['foto']=="") { ?>
<img src="images/user/user-default.png" class="user-image" alt="User Image"/>
<?php
}
else { ?>
<img src="images/user/<?php echo $data['foto']; ?>" class="user-image" alt="User Image"/>
<?php
}
?>
<span class="hidden-xs"><?php echo $data['nama_user']; ?> <i style="margin-left:5px" class="fa fa-angle-down"></i></span>
</a>
<ul class="dropdown-menu">
<!-- User image -->
<li class="user-header">
<?php
if ($data['foto']=="") { ?>
<img src="images/user/user-default.png" class="img-circle" alt="User Image"/>
<?php
}
else { ?>
<img src="images/user/<?php echo $data['foto']; ?>" class="img-circle" alt="User Image"/>
<?php
}
?>
<p>
<?php echo $data['nama_user']; ?>
<small><?php echo $data['hak_akses']; ?></small>
</p>
</li>
<!-- Menu Footer-->
<li class="user-footer">
<div class="pull-left">
<a style="width:80px" href="?module=profil" class="btn btn-default btn-flat">Profil</a>
</div>
<div class="pull-right">
<a style="width:80px" data-toggle="modal" href="#logout" class="btn btn-default btn-flat">Logout</a>
</div>
</li>
</ul>
</li>