-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheditM.php
48 lines (48 loc) · 1.94 KB
/
editM.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
<?php session_start();
require 'config/configM.php';
if (isset($_GET['id'])) {
$mhs = $collectionMahasiswa->findOne(['_id' => new MongoDB\BSON\ObjectID($_GET['id'])]);
}
if(isset($_POST['submit'])){
$collectionMahasiswa->updateOne(
['_id' => new MongoDB\BSON\ObjectID($_GET['id'])],
['$set' => ['NIM' => $_POST['NIM'], 'Nama' => $_POST['Nama'], 'JK' => $_POST['JK'], 'Fak' => $_POST['Fak'], 'PS' => $_POST['PS'],]]
);
$_SESSION['success'] = "Data Mahasiswa berhasil diubah";
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>Edit Data Mahasiswa</h1></CENTER>
<a href="index.php" class="btn btn-primary">Kembali</a>
<form method="POST">
<div class="form-group">
<strong>NIM:</strong><br>
<input type="text" class="form-control" name="NIM" required="" placeholder="xxxxxxxxx">
<br>
<strong>Nama:</strong><br>
<input type="text" class="form-control" name="Nama" placeholder="Masukan Nama Lengkap">
<br>
<strong>Jenis Kelamin:</strong><br>
<input type="text" class="form-control" name="JK" placeholder="Jenis Kelamin">
<br>
<strong>Fakultas:</strong><br>
<input type="text" class="form-control" name="Fak" placeholder="Masukan nama Fakultas">
<br>
<strong>Program Studi:</strong><br>
<input type="text" class="form-control" name="PS" placeholder="Masukan nama Program Studi">
<br>
<button type="submit" name="submit" class="btn btn-dark">Simpan Perubahan</button>
</div>
</form>
</div>
</body>
</html>