-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpetugas.php
130 lines (116 loc) · 4.5 KB
/
petugas.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
<?php
$judul = "Login";
include "template/templates.php";
?>
<div class="container-fluid pt-3 pb-5 backGambar">
<div class="row">
<div class="col-xl-12">
<h3 class="text-center text-uppercase text-dark">Rekapitulasi Petugas Login</h3>
<hr class="hr">
</div>
</div>
<div class="row">
<div class="col-xl-10 table-responsive">
<button type="button" class="btn btn-primary btn-sm px-2 my-3" data-toggle="modal" data-target="#staticBackdrop" title="tambah data">
<i class="fas fa-plus"></i> Tambah
</button>
<table class="table table-bordered table-hover" id="login">
<thead>
<tr class="text-center">
<th width="5%">No.</th>
<th>Nama Petugas</th>
<th>Username</th>
<th>Telp</th>
<th>Jabatan</th>
<th>Aksi</th>
</tr>
</thead>
<tbody>
<?php
$no = 1;
$sql = "SELECT * FROM petugas";
$query = mysqli_query($koneksi, $sql);
while ($data = mysqli_fetch_array($query)) {?>
<tr>
<td align="center" width="3%"><?= $no++; ?>.</td>
<td><?= $data['nama_petugas']; ?></td>
<td><?= $data['username']; ?></td>
<td><?= $data['telp']; ?></td>
<td><?= strtoupper($data['level']); ?></td>
<td align="center" width="15%">
<a href="petugas-edit.php?id_petugas=<?= $data['id_petugas']; ?>" class="badge badge-primary p-2" title="Edit"><i class="fas fa-edit"></i></a>
<?php if($data['username']!="admin"){?>
| <a href="petugas-delete.php?id_petugas=<?= $data['id_petugas']; ?>" class="badge badge-danger p-2 delete-data" title='Delete'><i class="fas fa-trash"></i></a>
<?php
}?>
</td>
</tr>
<?php
} ?>
</tbody>
</table>
</div>
</div>
</div>
<script>
$(document).ready(function() {
$('#login').dataTable();
});
</script>
<!-- Modal Tambah-->
<div class="modal fade" id="staticBackdrop" data-backdrop="static" data-keyboard="false" tabindex="-1" aria-labelledby="staticBackdropLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="staticBackdropLabel">
Input Petugas Login
</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<form action="Petugas-simpan.php" method="post">
<!-- Nama Petugas -->
<div class="input-group input-group-sm mb-1">
<span class="input-group-text lebar">Nama Petugas</span>
<input type="text" name="nama_petugas" required autocomplete="off" class="form-control form-control-sm" placeholder="Input Nama">
</div>
<!-- Username -->
<div class="input-group input-group-sm mb-1">
<span class="input-group-text lebar">Username</span>
<input type="text" name="username" required autocomplete="off" class="form-control form-control-sm" placeholder="Input Username">
</div>
<!-- Password -->
<div class="input-group mb-1">
<span class="input-group-text lebar">Password</span>
<input type="password" name="password" required class="form-control form-control-sm" placeholder="Input Password">
</div>
<!-- Telp -->
<div class="input-group input-group-sm mb-1">
<span class="input-group-text lebar">Telp / WA</span>
<input type="text" name="telp" required autocomplete="off" class="form-control form-control-sm" placeholder="Input No. Telp / WA">
</div>
<!-- Level / Jabatan -->
<div class="input-group mb-1">
<span class="input-group-text lebar">Level / Jabatan</span>
<select name="level" class="form-control form-control-sm form-control-chosen" required>
<option value="" selected>~ Pilih Jabatan / Level ~</option>
<option value="admin">Administrator</option>
<option value="petugas">Petugas</option>
</select>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-primary btn-sm"> <i class="fas fa-save"></i> Simpan </button>
</div>
</form>
</div>
</div>
</div>
</div>
<br>
<br>
<?php
include "template/footer.php";
include "template/sticky-footer.php";
?>