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