-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
50 lines (47 loc) · 1.22 KB
/
index.php
File metadata and controls
50 lines (47 loc) · 1.22 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
<?php
require "koneksi.php";
require "class.php";
$db = Database::connect();
$mahasiswa = new Mahasiswa($db);
$rows = $mahasiswa->select();
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CRUD With PDO</title>
<style>
a.button {
-webkit-appearance: button;
-moz-appearance: button;
appearance: button;
text-decoration: none;
color: initial;
}
</style>
</head>
<body>
<a class="button" href=input_insert.php>Tambah</a>
<table border="1">
<thead>
<th>NPM</th>
<th>Nama</th>
<th>Semester</th>
<th>Umur</th>
<th>Edit</th>
<th>Hapus</th>
</thead>
<tbody>
<?php
while($row = $rows->fetchObject()) {
echo '<tr>';
echo '<td>'.$row->npm.'</td> <td>'.$row->nama.'</td> <td>'.$row->semester.'</td> <td>'.$row->umur.'</td>';
echo '<td><a class="button" href=input_update.php?npm='.$row->npm.'>edit</a></td>';
echo '<td><a class="button" href=delete_PDO.php?npm='.$row->npm.'>delete</a></td>';
echo '</tr>';
}
?>
</tbody>
</table>
</body>
</html>