forked from hananda/simdatindo
-
Notifications
You must be signed in to change notification settings - Fork 1
/
editbrg.php
101 lines (93 loc) · 2.35 KB
/
editbrg.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
101
<?php
session_start();
include "koneksi.php";
error_reporting(0);
$waktu=time()+25200;
$expired=30;
if (empty($_SESSION['username']) AND empty($_SESSION['password']))
{
include "formlogin.php";
}
else
{
if (($_SESSION[level] == "admin") || ($_SESSION[level] == "operator"))
{
?>
<html>
<head>
<link href="css/test.css" type="text/css" rel="stylesheet">
<link href="../simdatindo/images/icon.jpg" rel="shortcut icon" />
<title>ATM Logistic</title>
<style>
table{
border:medium none black;
width:500px;
margin-bottom:10px;
margin-top: 10px;
}
td.field
{
width:300px;
}
td.field input
{
width:100%;
}
</style>
</head>
</html>
<body>
<div id="header">
</div>
<div id="main_content">
<?php include "atas.php";?>
<p align="center"><strong>Silahkan edit form dibawah ini untuk mengedit barang</strong></p>
<?php
$part_number = $_GET['part_number'];
$query = "SELECT * FROM tbl_barang WHERE part_number='$part_number'";
$sql = custom_query($query);
while ($r = mysqli_fetch_array($sql))
{
?>
<form action="updatebrg.php" method="post">
<table align="center" id="tabeledit" width="200" border="0">
<tr>
<td width="112" height="34"><strong>Part Number</strong></td>
<td width="378"><span class="field">
<input name="part_number" type="text" id="part_number" value="<?php echo $r['part_number']; ?>" maxlength="10" readonly>
</span></td>
</tr>
<tr>
<td height="34"><strong>Deskripsi</strong></td>
<td class="field"><div align="center"><span class="field">
<input name="deskripsi" type="text" id="deskripsi" value="<?php echo $r['description']; ?>">
</span></div></td>
</tr>
<tr>
<td height="34"><strong>Jumlah</strong></td>
<td><span class="field">
<input name="jumlah" type="text" id="jumlah" value="<?php echo $r['jumlah']; ?>">
</span></td>
</tr>
<tr>
<td bgcolor="#FFFFFF" height="34" colspan="2"><div align="right"> <input name="simpan" type="submit" value="Simpan" id="simpan"></div></td>
</tr>
</table>
</form>
<?php
}
include "menu.php";
?>
</div>
<div id="footer"></div>
</body>
<?php
}
else
{
echo "<script>
alert('Maaf anda tidak memiliki akses untuk melihat halaman ini, silakan login terlebih dahulu.');javascript:window.location='formlogin.php';
</script>";
}
}
?>