-
Notifications
You must be signed in to change notification settings - Fork 0
/
kriteria.php
93 lines (75 loc) · 2 KB
/
kriteria.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
<head>
<link rel="stylesheet" type="text/css" href="semantic/dist/semantic.min.css">
</head>
<?php
include('config.php');
include('fungsi.php');
// menjalankan perintah edit
if(isset($_POST['edit'])) {
$id = $_POST['id'];
header('Location: edit.php?jenis=kriteria&id='.$id);
exit();
}
// menjalankan perintah delete
if(isset($_POST['delete'])) {
$id = $_POST['id'];
deleteKriteria($id);
}
// menjalankan perintah tambah
if(isset($_POST['tambah'])) {
$nama = $_POST['nama'];
tambahData('kriteria',$nama);
}
include('navbar.php');
?>
<section class="content container mt-5">
<h2 class="ui header">Kriteria</h2>
<table class="ui celled table">
<thead>
<tr>
<th class="collapsing">No</th>
<th colspan="2">Nama Kriteria</th>
</tr>
</thead>
<tbody>
<?php
// Menampilkan list kriteria
$query = "SELECT id,nama FROM kriteria ORDER BY id";
$result = mysqli_query($koneksi, $query);
$i = 0;
while ($row = mysqli_fetch_array($result)) {
$i++;
?>
<tr>
<td><?php echo $i ?></td>
<td><?php echo $row['nama'] ?></td>
<td class="right aligned collapsing">
<form method="post" action="kriteria.php">
<input type="hidden" name="id" value="<?php echo $row['id'] ?>">
<button type="submit" name="edit" class="ui mini teal left labeled icon button"><i class="right edit icon"></i>EDIT</button>
<button type="submit" name="delete" class="ui mini red left labeled icon button"><i class="right remove icon"></i>DELETE</button>
</form>
</td>
</tr>
<?php } ?>
</tbody>
<tfoot class="full-width">
<tr>
<th colspan="3">
<a href="tambah.php?jenis=kriteria">
<div class="ui right floated small primary labeled icon button">
<i class="plus icon"></i>Tambah
</div>
</a>
</th>
</tr>
</tfoot>
</table>
<br>
<form action="alternatif.php">
<button class="ui right labeled icon button" style="float: right;">
<i class="right arrow icon"></i>
Lanjut
</button>
</form>
</section>