-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
61 lines (60 loc) · 1.55 KB
/
index.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Jadwal Dokter</title>
</head>
<style>
table, td, th {
border: 1px solid #ddd;
}
table{
border-collapse:collapse;
width:80%;
}
th, td {
padding:10px;
}
</style>
<body>
<a href="tambah.php">Tambah</a>
<table>
<tr>
<th>No</th>
<th>Nama Dokter</th>
<th>Hari</th>
<th>Jam Awal</th>
<th>Jam Akhir</th>
<th>Aksi</th>
</tr>
<?php
require_once('Jadwal_dokter.php');
$i = 1;
$jadwal = new Jadwal_dokter();
$show = $jadwal->showJadwalDokter();
while ($row = $show->fetch(PDO::FETCH_OBJ)) {
?>
<tr>
<td><?= $i++; ?>.</td>
<td><?= $row->nama_dokter; ?></td>
<td><?= $row->hari; ?></td>
<td><?= $row->jam_awal; ?></td>
<td><?= $row->jam_akhir; ?></td>
<td>
<a href="edit.php?id_jadwal=<?= $row->id_jadwal ?>">Ubah</a>
<a href="index.php?delete=<?= $row->id_jadwal ?>" onclick="return confirm('Yakin mau di Hapus?')">
Hapus</a>
</td>
</tr>
<?php } ?>
</table>
</body>
</html>
<?php
//$del = $_GET['delete'];
if(isset($_GET['delete'])){
$del = $jadwal->deleteJadwal($_GET['delete']);
header('Location: index.php');
}
?>