-
Notifications
You must be signed in to change notification settings - Fork 1
/
pembayaran.php
314 lines (310 loc) · 15.7 KB
/
pembayaran.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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
<?php
session_start();
$user = $_SESSION['user'];
?>
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap css-->
<link rel="stylesheet" href="css/bootstrap.min.css" rel="sylesheet" media="screen">
<link rel="stylesheet" type="text/css" href="fontawesome/css/all.min.css">
<link rel="stylesheet" type="text/css" href="rs.css">
<!-- Bootstrap javascript -->
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/bootstrap.js"></script>
<title>ADMINISTRATOR</title>
</head>
<body>
<!-- Navbar -->
<section>
<nav class="navbar navbar-expand-lg navbar-light bg-dark fixed-top">
<a class="navbar-brand" href="#" style="color: white"><img src="img/logo2.png"></a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse justify-content-end" id="navbarSupportedContent">
<div class="navbar-nav" >
<a class="nav-item nav-link active" href="#"><h5><i class="fas fa-bell " style="color: white"></i></h5></a>
<a class="nav-item nav-link" href="#"><h5><i class="fas fa-comment " style="color: white"></i></h5></a>
<a class="nav-item nav-link" data-toggle="dropdown" id="dropdownMenuButton" href=""><h5><i class="fas fa-user-circle " style="color: white"></i></h5></a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item" href="#" ><?php echo $user;?></a>
<a class="dropdown-item" href="login.php">Log Out </a>
</div>
</div>
</div>
</nav>
</section>
<!-- Akhir Navbar -->
<!-- Sidebar -->
<div class="row no-gutters mt-5 side" >
<div class="col-md-2 mt-5 pr-4 pt-1 sidebar" >
<ul class="nav flex-column ml-3 mb-5">
<li class="nav-item">
<a class="nav-link text" href="dashboard.php"><i class="fas fa-tachometer-alt mr-2"></i>Dashboard</a><hr class="bg-secondary">
</li>
<li class="nav-item">
<a class="nav-link text" href="dokter.php"><i class="fas fa-user-md mr-2"></i>Daftar Dokter</a><hr class="bg-secondary">
</li>
<li class="nav-item">
<a class="nav-link text" href="pasien.php"><i class="fas fa-users mr-2"></i>Daftar Pasien</a><hr class="bg-secondary">
</li>
<li class="nav-item">
<a class="nav-link text" href="obat.php" ><i class="fas fa-capsules mr-2"></i>Daftar Obat</a><hr class="bg-secondary">
</li>
<li class="nav-item">
<a class="nav-link text" href="fasilitas.php" ><i class="fas fa-procedures mr-2"></i>Daftar Fasilitas</a><hr class="bg-secondary">
</li>
<li class="nav-item">
<a class="nav-link text" href="pendaftaran.php" ><i class="fas fa-book-medical mr-2"></i>Data Pendaftaran</a><hr class="bg-secondary">
</li>
<li class="nav-item">
<a class="nav-link text" href="pemeriksaan.php" ><i class="fas fa-clipboard-list mr-2"></i>Data Pemeriksaan</a><hr class="bg-secondary">
</li>
<li class="nav-item">
<a class="nav-link textactive" href="pembayaran.php" ><i class="fas fa-credit-card mr-2"></i>Data Pembayaran</a><hr class="bg-secondary">
</li>
</ul>
</div>
<!-- Akhir SideBar -->
<!-- Data -->
<div class="col-md-10 p-5 pt-2">
<h3><i class="fas fa-credit-card mr-2"></i>Data Pembayaran</h3><hr>
<form class="form-inline my-2 my-lg-0 ml-auto">
<a href="#" id="tambahbyr" class="btn btn-light mb-2 btndata"><i class="fas fa-plus-circle mr-2"></i>TAMBAH DATA PEMBAYARAN</a>
<input class="form-control mr-sm-2 search" type="search" placeholder="Search" aria-label="Search" name="cari" style="margin-left: 49em;">
<button class="btn btn-outline-light search2" type="submit"><i class="fas fa-search"></i></button>
</form>
<table class="table table-striped table-bordered textactive">
<thead>
<tr>
<th scope="col">NO</th>
<th scope="col">PembayaranID</th>
<th scope="col">PemeriksaanID</th>
<th scope="col">Jumlah</th>
<th scope="col">Cara Pembayaran</th>
<th scope="col">Tanggal</th>
<th colspan="3" scope="col">Aksi</th>
</tr>
</thead>
<tbody>
<?php
include 'koneksi.php';
if(isset($_GET['cari'])){
$cari = $_GET['cari'];
$sql = mysqli_query($koneksi, "select * from pembayaran where PembayaranID like '%".$cari."%' or PemeriksaanID like '%".$cari."%' or Jumlah like '%".$cari."%' or CaraPembayaran like '%".$cari."%' or Tanggal like '%".$cari."%'");
echo "<b>Hasil pencarian : ".$cari."</b>";
}else{
$sql = mysqli_query($koneksi, "select*from pembayaran");
}
$no = 1;
while($data = mysqli_fetch_array($sql)){
?>
<tr>
<td><?php echo $no++; ?></td>
<td><?php echo $data['PembayaranID'];?></td>
<td><?php echo $data['PemeriksaanID'];?></td>
<td><?php echo $data['Jumlah'];?></td>
<td><?php echo $data['CaraPembayaran'];?></td>
<td><?php echo $data['Tanggal'];?></td>
<td><i class="fas fa-edit bg-success p-2 text-white rounded"></i>
<a href="#" data-role="pop" data-id="<?php echo $data['PembayaranID'];?>">Edit</a>
<i class="fas fa-trash-alt bg-danger p-2 text-white rounded"></i>
<a href="#" data-role="pop2" data-id ="<?php echo $data['PembayaranID']?>">Delete</a>
<!-- Modal Edit -->
<div class="modal fade" id="ModalEdit" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLongTitle">Ubah Data Obat</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="update_pembayaran.php" method="post">
<div class="form-row">
<div class="form-group col-md-6">
<label >Pembayaran ID</label>
<input type="text" name="PembayaranID" class="form-control" id="PembayaranID" readonly>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-6">
<label >PEMERIKSAAN ID</label>
<input type="text" name="PemeriksaanID" class="form-control" id="PemeriksaanID" readonly>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-6">
<label >JUMLAH</label>
<input type="text" name="Jumlah" class="form-control" id="Jumlah">
</div>
</div>
<div class="form-row">
<div class="form-group col-md-6">
<label >CARA PEMBAYARAN</label>
<input type="text" name="CaraPembayaran" class="form-control" id="CaraPembayaran">
</div>
</div>
<div class="form-row">
<div class="form-group col-md-6">
<label >Tanggal</label>
<input type="text" name="Tanggal" class="form-control" id="Tanggal">
</div>
</div>
<div class="modal-footer">
<!-- <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button> -->
<button type="submit" class="btn btn-light">SIMPAN</button>
</form>
</div>
</div>
</div>
</div>
<!-- /Modal Edit -->
<?php
}
?>
</tbody>
</table>
<!-- Modal Delete -->
<div class="modal fade" id="ModalDelete" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLongTitle">Hapus Data Pembayaran</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="delete_pembayaran.php" method="post">
Apakah anda yakin ingin menghapus data <b id="datadel"></b>?
<div class="modal-footer">
<!-- <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button> -->
<input type="hidden" name="datadel" id="datadel2">
<button type="submit" class="btn btn-light">DELETE</button>
</form>
</div>
</div>
</div>
</div>
<!-- /ModalDelete -->
</tbody>
</table>
</div>
</div>
<!-- Akhir Data -->
<!-- Modal Tambah -->
<div class="modal fade" id="ModalTambah" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLongTitle">Input New Data</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="simpan_pembayaran.php" method="post">
<div class="form-row">
<div class="form-group col-md-6">
<label >PEMBAYARANID</label>
<input type="text" name="PembayaranID" class="form-control" id="PembayaranID">
</div>
</div>
<div class="form-row">
<div class="form-group col-md-6">
<label >PEMERIKSAANID</label>
<input type="text" name="PemeriksaanID" class="form-control" id="PemeriksaanID">
</div>
</div>
<div class="form-row">
<div class="form-group col-md-6">
<label >JUMLAH</label>
<input type="text" name="Jumlah" class="form-control" id="Jumlah">
</div>
</div>
<div class="form-row">
<div class="form-group col-md-6">
<label >CARA PEMBAYARAN</label>
<input type="text" name="CaraPembayaran" class="form-control" id="CaraPembayaran">
</div>
</div>
<div class="form-row">
<div class="form-group col-md-6">
<label >TANGGAL</label>
<input type="text" name="Tanggal" class="form-control" id="Tanggal">
</div>
</div>
<div class="modal-footer">
<!-- <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button> -->
<button type="submit" class="btn btn-light">SIMPAN</button>
</form>
</div>
</div>
</div>
</div>
<!-- /Modah Tambah -->
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="js/jquery.js" type="text/javascript"></script>
<script src="js/bootstrap.js" type="text/javascript"></script>
<script src="js/bootstrap.min.js" type="text/javascript"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
<script>
// Tambah
$("#tambahbyr").click(function(){
$("#ModalTambah").modal();
});
// Edit
$("a[data-role=pop]").click(function(){
var id=$(this).data("id");
console.log(id);
// $("#Modalea").modal();
$.ajax({
type:'POST',
url: 'getpembayaran.php',
data:{id:id},
success:function(data){
console.log(data);
$('#ModalEdit').modal();
var row = JSON.parse(data);
console.log(row['PembayaranID']);
$("#PembayaranID").val(row['PembayaranID']);
$("#PemeriksaanID").val(row['PemeriksaanID']);
$("#Jumlah").val(row['Jumlah']);
$("#CaraPembayaran").val(row['CaraPembayaran']);
$("#Tanggal").val(row['Tanggal']);
}
});
});
// Hapus
$("a[data-role=pop2]").click(function(){
var id=$(this).data("id");
console.log(id);
$.ajax({
type:'post',
url: 'getpembayaran.php',
data:{id:id},
success:function(data){
console.log(data);
$("#ModalDelete").modal();
var row = JSON.parse(data);
console.log(row['PembayaranID']);
$("#datadel2").val(row['PembayaranID']);
$("#datadel").text(row['PembayaranID']);
}
});
});
</script>
</body>
</html>