-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathdiskon.php
executable file
·64 lines (49 loc) · 1.29 KB
/
diskon.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
<?php
include 'config.php';
session_start();
$view = $dbconnect->query('SELECT * FROM diskon');
?>
<!DOCTYPE html>
<html>
<head>
<title>List Diskon</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
</head>
<body>
<div class="container">
<?php if (isset($_SESSION['success']) && $_SESSION['success'] != '') {?>
<div class="alert alert-success" role="alert">
<?=$_SESSION['success']?>
</div>
<?php
}
$_SESSION['success'] = '';
?>
<h1>List Diskon</h1>
<a href="/diskon_add.php" class="btn btn-primary">Tambah data</a>
<table class="table table-bordered">
<tr>
<th>ID</th>
<th>Nama</th>
<th>Batas</th>
<th>Potongan</th>
<th>Aksi</th>
</tr>
<?php
while ($row = $view->fetch_array()) { ?>
<tr>
<td> <?= $row['id'] ?> </td>
<td><?= $row['nama'] ?></td>
<td><?= $row['batas'] ?></td>
<td><?= $row['potongan'] ?></td>
<td>
<a href="/diskon_edit.php?id=<?= $row['id'] ?>">Edit</a> |
<a href="/diskon_hapus.php?id=<?= $row['id'] ?>" onclick="return confirm('apakah anda yakin?')">Hapus</a>
</td>
</tr>
<?php }
?>
</table>
</div>
</body>
</html>