-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhapusB.php
34 lines (33 loc) · 1.19 KB
/
hapusB.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
<?php session_start();
require 'configb.php';
if (isset($_GET['id'])) {
$mhs = $collection->findOne(['_id' => new MongoDB\BSON\ObjectID($_GET['id'])]);
}
if(isset($_POST['submit'])){
require 'configb.php';
$collection->deleteOne(['_id' => new MongoDB\BSON\ObjectID($_GET['id'])]);
$_SESSION['success'] = "Data Buku Berhasil dihapus";
header("Location: indexb.php");
}
?>
<!DOCTYPE html>
<html>
<head>
<title>APLIKASI</title>
<link rel="stylesheet" href="./vendor/twbs/bootstrap/dist/css/bootstrap.min.css">
</head>
<body>
<div class="container">
<br>
<CENTER><h1>Hapus Data Buku</h1></CENTER>
<h3> Yang bernama <?php echo "$mhs->Buku"; ?> dengan Kode <?php echo "$mhs->Kode"; ?> ? </h3>
<form method="POST">
<div class="form-group">
<input type="hidden" value="<?php echo "$mhs->Kode"; ?>" class="form-control" name="Kode">
<a href="indexb.php" class="btn btn-primary">Kembali</a>
<button type="submit" name="submit" class="btn btn-danger">Hapus</button>
</div>
</form>
</div>
</body>
</html>