-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathedit.php
More file actions
73 lines (62 loc) · 2.39 KB
/
edit.php
File metadata and controls
73 lines (62 loc) · 2.39 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
<?php
require 'function.php';
$Id = $_GET["Id"];
$data = query("SELECT * FROM inventaris WHERE Id = $Id")[0];
if (isset($_POST["submit"])){
if(edit($_POST) > 0){
echo "
<script>
alert('Data berhasil diedit!');
document.location.href='index.php';
</script>
";
}else{
echo "
<script>
alert('Data gagal diedit!');
document.location.href='index.php';
</script>
";
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Edit Data Inventaris</title>
<link rel="stylesheet" href="styleT.css">
</head>
<body>
<div class="container">
<div class="form-card">
<h1 class="form-title">Edit Data</h1>
<div class="divider"></div>
<form action="" method="POST">
<div class="form-group">
<input type="hidden" name="Id" value="<?= $data["Id"]?>">
<label for="Nama">Nama Barang</label>
<input type="text" id="Nama" name="Nama" placeholder="Masukkan nama barang" required value="<?= $data["Nama"] ?>">
</div>
<div class="form-group">
<label for="Jumlah">Jumlah Barang</label>
<input type="number" id="Jumlah" name="Jumlah" placeholder="Masukkan jumlah barang" required min="1" value="<?= $data["Jumlah"] ?>">
</div>
<div class="form-group">
<label for="Kategori">Kategori</label>
<input type="text" id="Kategori" name="Kategori" placeholder="Masukkan kategori barang" required value="<?= $data["Kategori"] ?>">
</div>
<div class="form-group">
<label for="Tanggal">Tanggal</label>
<input type="date" id="Tanggal" name="Tanggal" required value="<?= $data["Tanggal"] ?>">
</div>
<div class="form-actions">
<button type="submit" name="submit" class="btn btn-submit" >Edit</button>
<a href="index.php" class="btn btn-cancel">Batal</a>
</div>
</form>
</div>
</div>
</body>
</html>