-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathubah.php
86 lines (68 loc) · 1.64 KB
/
ubah.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
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
76
77
78
79
80
81
82
83
84
85
86
<?php
session_start();
if (!isset($_SESSION["login"])){
header("Location: login.php");
exit;
}
require 'koneksi.php';
$no = isset ($_GET["no"]) ? $_GET["no"] : null;
$krt = query("SELECT * FROM pengguna WHERE no = $no")[0];
if (isset($_POST["submit"]))
{
if (ubah ($_POST) > 0)
{
echo "
<script>
alert('Kartu Berhasil di Ubah');
document.location.href = 'index.php';
</script>
";
} else
{
echo "
<script>
alert('Kartu Gagal DI Ubah');
document.location.href = 'ubah.php';
</script>
";
}
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Ubah Kartu ID</title>
<style>
label{
display: block;
}
</style>
</head>
<body>
<h1>Ubah ID Kartu</h1>
<form action="" method="post">
<input type="hidden" name="no" value="<?= $krt["no"]; ?>">
<ul>
<li>
<label for ="idcard">ID Card</label>
<input type ="text" name="idcard" id="idcard" required="" value="<?= $krt["idcard"]; ?>">
</li>
<li>
<label for ="nama">Nama</label>
<input type="Text" name="nama" id="nama" required="" value="<?= $krt["nama"]; ?>">
</li>
<li>
<label for ="golongan">Golongan</label>
<input type="Text" name="golongan" id="golongan" required="" value="<?= $krt["golongan"]; ?>">
</li>
<li>
<label for ="ket">Status</label>
<input type="Text" name="ket" id="ket" required="" value="<?= $krt["ket"]; ?>">
</li>
<li>
<button type="submit" name="submit">Ubah Kartu</button> <input type="button" value="Cancel" onclick="window.location.href='index.php'" />
</li>
</ul>
</form>
</body>
</html>