-
Notifications
You must be signed in to change notification settings - Fork 2
/
pengguna.php
executable file
·132 lines (126 loc) · 7.14 KB
/
pengguna.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
<?php require(realpath('header.php')); ?>
<?php
$id_user = $_SESSION['id_user'];
?>
<section class="content">
<div class="container-fluid">
<div class="row clearfix">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<div class="card">
<div class="header">
<h2>
TAMBAH PENGGUNA
</h2>
</div>
<div class="body">
<form action="pages/tambah_pengguna_apk.php" method="POST" enctype="multipart/form-data">
<input type="hidden" name="id_user" value="<?php echo $id_user?>">
<div class="row clearfix">
<div class="form-group form-float">
<div class="col-md-4">
<div class="form-group">
<div class="form-line">
<label class="">USERNAME</label>
<input type="text" id="" name=" username" class="form-control" required>
</div>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<div class="form-line">
<label class="">PASSWORD</label>
<input type="text" id="" name="password" class="form-control" required>
</div>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<div class="form-line">
<label class="">NIP</label>
<input type="text" id="" name="nip" class="form-control" required>
</div>
</div>
</div>
<div class="col-md-4">
<div class="form-group ">
<div class="form-line">
<label class="text-uppercase">Nama pengguna</label>
<input type="text" id="" name="nama_user" class="form-control" required>
</div>
</div>
</div>
<div class="col-md-4 col-md-offset-4">
<div class="form-group">
<div class="form-line">
<label>LEVEL</label>
<select class="form-control show-tick" name="level" required>
<option>-- Please Select --</option>
<option value="admin">Admin</option>
<option value="pegawai">Pegawai</option>
</select>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<button type="submit" name="ubah" class="btn btn-success m-t-15 waves-effect" style="top: 30px">SAVE</button>
</div>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<div class="row clearfix">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<div class="card">
<div class="header">
<h2>
daftar akun pengguna
</h2>
</div>
<div class="body">
<div class="table-responsive">
<table class="table table-bordered table-striped table-hover js-basic-example dataTable">
<thead>
<tr>
<th>USERNAME</th>
<th>PASSWORD</th>
<th>LEVEL</th>
<th>AKSI</th>
</tr>
</thead>
<tbody>
<?php
$no = 0;
$query = "SELECT * FROM user";
$result = mysqli_query($conn, $query);
while ($row = mysqli_fetch_array($result)) {
?>
<tr>
<td><?php echo $row['username']?></td>
<td><?php echo $row['password']?></td>
<td><?php echo $row['level']?></td>
<td><div class="btn-toolbar" role="toolbar" aria-label="Toolbar with button groups">
<div class="btn-group" role="group" aria-label="First group">
<button type="button" class="btn btn-warning waves-effect" onclick="window.location.href='ubah_pengguna.php?id=<?php echo $row['id_user']; ?>'">Ubah</button>
<button type="button" class="btn btn-danger waves-effect" onclick="window.location.href='pages/hapus_pengguna.php?id=<?php echo $row['id_user']; ?>'">Hapus</button>
</div>
</div></td>
</tr>
<?php
$no++;
}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<?php require(realpath('footer.php')); ?>