-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdaftarkereta_page.php
More file actions
62 lines (61 loc) · 2.12 KB
/
daftarkereta_page.php
File metadata and controls
62 lines (61 loc) · 2.12 KB
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
<?php
include('config.php');
$kereta_query = pg_query("SELECT * FROM kereta order by id;");
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Workshop Basdat</title>
</head>
<body>
<header>
<h1>Daftar Kereta</h1>
</header>
<body>
<table border="2">
<thead>
<tr>
<th>ID Kereta</th>
<th>Nama</th>
<th>Status Operasi</th>
<th>Kapasitas</th>
<th>Opsi</th>
</tr>
</thead>
<tbody>
<?php
while($kereta=pg_fetch_array($kereta_query)) {
?>
<tr>
<td><?= $kereta['id']?></td>
<td><?= $kereta['nama']?></td>
<td><?php
if ($kereta['beroperasi'] == 't') {
echo "Beroperasional";
} else {
echo "Tidak Beroperasional";
}
?></td>
<td><?= $kereta['kapasitas']?></td>
<td>
<form action="editkereta_page.php" method="post">
<input type="hidden" value="<?= $kereta['id']?>" name="id" />
<input type="submit" value="Edit" name="editkereta" />
</form>
<form action="deletekereta.php" method="post">
<input type="hidden" value="<?= $kereta['id']?>" name="id" />
<input type="submit" value="Delete" name="deletekereta" />
</form>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
</body>
</body>
</html>