-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin_editStok.php
101 lines (80 loc) · 2.94 KB
/
admin_editStok.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<?php include("login.php");?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>OJK</title>
<link rel="stylesheet" href="css/jquery.mobile-1.3.2.css">
<link rel="stylesheet" href="css/finance.css">
<script src="js/jquery.js"></script>
<script src="js/jquery-ui.js"></script>
<script src="js/jquery.mobile-1.3.2.min.js"></script>
<script type="text/javascript">
</script>
<?php include("database.php");?>
</head>
<?php
$database = new database;
$con = $database->db_connect();
//====================================================
/*var_dump($_POST);
var_dump($_SESSION);*/
if (isset($_POST['button']) && $_POST['button'] == 'Tambahkan') {
$tbl_br = "tb_barang";
$where_br = "Kode_Barang=\"".$_POST['kode']."\"";
$set_br = array(
'Jenis_Barang' => $_POST['jenis'],
'Keterangan' => $_POST['ket'],
'Stok_Barang' => $_POST['stok']
);
$stok = $database->update($tbl_br, $set_br, $where_br);
if ($stok === true) {
echo "<script type='text/javascript'>".
"alert('Update Berhasil');".
"window.location = 'admin_stok.php';".
"</script> ";
} else {
echo "<script type='text/javascript'>".
"alert('Gagal simpans');".
"window.location = 'admin_stok.php';".
"</script> ";
}
}
?>
<body>
<div data-role="page" >
<div data-role="header" class="header w">
<h2><span>Tambah Stok <?php echo $_GET['b'] ?></span></h2>
<a href="admin_stok.php" data-ajax="false" data-role="button" data-theme="d" data-icon="arrow-l" class="ui-icon-alt" data-iconpos="notext">back</a>
</div>
<div data-role="content">
<form method="post" action="admin_editStok.php" data-ajax="false"><!-- data-ajax="false" -->
<ul data-role="listview" data-theme="d">
<li>
<div data-role="fieldcontain">
<label for="kode">Kode Barang</label>
<input type="text" name="kode" id="kode" value="<?php echo $_GET['a'] ?>" data-mini="true" readonly>
</div>
<div data-role="fieldcontain">
<label for="jenis">Jenis Barang</label>
<input type="text" name="jenis" id="jenis" value="<?php echo $_GET['b'] ?>" data-mini="true" required>
</div>
<div data-role="fieldcontain">
<label for="stok">Stok</label>
<input type="number" name="stok" id="stok" value="<?php echo $_GET['d'] ?>" data-mini="true" required>
</div>
<div data-role="fieldcontain">
<label for="ket">Satuan</label>
<input type="text" name="ket" id="ket" value="<?php echo $_GET['c'] ?>" data-mini="true" required>
</div>
<input type="submit" data-icon="check" name="button" value="Tambahkan" data-mini="true" data-inline="true" data-theme="b" data-ajax="false">
</li>
</ul>
</form>
</div>
<div data-role="footer" data-position="fixed" data-id="mainfoot">
</div>
</div>
</body>
</html>