-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathedit.php
More file actions
75 lines (64 loc) · 2.07 KB
/
edit.php
File metadata and controls
75 lines (64 loc) · 2.07 KB
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<?php
require 'function.php';
$id = $_GET["id"];
$mahasiswa = query("SELECT * FROM mahasiswa WHERE ID = $id")[0];
if(isset($_POST["submit"])) {
if (editData($_POST) >= 0) {
echo "
<script>
alert('Data berhasil diubah!');
document.location.href = '_home.php';
</script>
";
} else {
echo "
<script>
alert('Data gagal diubah!');
document.location.href = '_home.php';
</script>
";
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Ubah Data Mahasiswa</title>
<link rel="stylesheet" href="styles/secondary.css">
</head>
<body>
<h1>Ubah Data Mahasiswa</h1>
<form action="" method="POST">
<table>
<input type="hidden" placeholder="ID" id="ID" name="ID" value="<?= $mahasiswa["ID"] ?>" required autofocus/>
<tr>
<!-- <td><label for="NRP">NRP</label></td> -->
</tr>
<tr>
<!-- <td><label for="NRP">NRP</label></td> -->
<td><input type="text" placeholder="NRP" id="NRP" name="NRP" value="<?= $mahasiswa["NRP"] ?>" required autofocus/></td>
</tr>
<tr>
<!-- <td><label for="Nama">Nama</label></td> -->
<td><input type="text" placeholder="Nama" id="Nama" name="Nama" value="<?= $mahasiswa["Nama"] ?>" required/></td>
</tr>
<tr>
<!-- <td><label for="Email">Email</label></td> -->
<td>
<input type="text" placeholder="Email" id="Email" name="Email" value="<?= $mahasiswa["Email"] ?>" required/>
</td>
</tr>
<tr>
<!-- <td><label for="Jurusan">Jurusan</label></td> -->
<td>
<input type="text" placeholder="Jurusan" id="Jurusan" name="Jurusan" value="<?= $mahasiswa["Jurusan"] ?>" required/>
</td>
</tr>
</table>
<button type="submit" name="submit">Kirim</button>
</form>
</body>
</html>