<table class='table table-bordered table-responsive'> <tr> <th>NPM</th> <th>Nama</th> <th>Kelas</th> <th>Nilai</th> <th colspan="2" >Action</th> </tr> <?php require "crud.php"; $obj = new CRUD(); $show = $obj->showMhs(); while ($data = $show->fetch(PDO::FETCH_OBJ)) { echo "\n\t<tr>\n\t\t<td>{$data->NPM}</td>\n\t\t<td>{$data->nama}</td>\n\t\t<td>{$data->kelas}</td>\n\t\t<td>{$data->nilai}</td>\n\t\t<td><center><a class='btn btn-info' href='edit.php?npm={$data->NPM}'>Edit</center></td>\n\t\t<td><center><a class='btn btn-danger' href='list.php?delete={$data->id_mhs}'>Delete</a></center></td>\n\t</tr>"; } ?> </table> <a href="index.php" class="btn btn-success">Tambah Nilai</a> </div> </body> </html> <?php if (isset($_GET['delete'])) { $del = $obj->deleteMhs($_GET['delete']); if ($del == "Success") { header('Location: list.php'); } }