-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathedit_form.php
More file actions
81 lines (63 loc) · 2.18 KB
/
edit_form.php
File metadata and controls
81 lines (63 loc) · 2.18 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
76
77
78
79
80
81
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Inventory</title>
<link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen">
<link href="bootstrap/css/bootstrap-theme.min.css" rel="stylesheet" media="screen">
<link href="assets/datatables.min.css" rel="stylesheet" type="text/css">
<script src="assets/jquery-1.11.3-jquery.min.js"></script>
<script src="bootstrap/js/main.js"></script>
</head>
<?php
include_once 'config/dbconfig.php';
if($_GET['edit_id']) {
$id = $_GET['edit_id'];
$stmt=$db_con->prepare("SELECT * FROM items WHERE id=:id");
$stmt->execute(array(':id'=>$id));
$row=$stmt->fetch(PDO::FETCH_ASSOC);
}
?>
<body>
<style type="text/css">
#dis {
display:none;
}
</style>
<div id="dis">
</div>
<form method='post' id='inv-UpdateForm' action='#'>
<table class='table table-bordered'>
<input type='hidden' name='id' value='<?php echo $row['id']; ?>' />
<tr>
<td>Item Name</td>
<td><input type='text' name='name' class='form-control' value='<?php echo $row['name']; ?>' required></td>
</tr>
<tr>
<td>Category</td>
<td><input type='text' name='category' class='form-control' value='<?php echo $row['category']; ?>' required></td>
</tr>
<tr>
<td>Item SKU</td>
<td><input type='text' name='sku' class='form-control' value='<?php echo $row['sku']; ?>' required></td>
</tr>
<tr>
<td>Price</td>
<td><input type='text' name='price' class='form-control' value='<?php echo $row['price']; ?>' required></td>
</tr>
<tr>
<td>Quantity Available</td>
<td><input type='text' name='qtyavail' class='form-control' value='<?php echo $row['qtyavail']; ?>' required></td>
</tr>
<tr>
<td colspan="2">
<button type="submit" class="btn btn-primary" name="btn-update" id="btn-update">
<span class="glyphicon glyphicon-plus"></span> Save Updates
</button>
</td>
</tr>
</table>
</form>
</body>
</html>