-
Notifications
You must be signed in to change notification settings - Fork 0
/
editInventory.php
73 lines (65 loc) · 2.29 KB
/
editInventory.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
<!DOCTYPE html>
<html lang="en">
<?php
session_start();
$con = mysqli_connect('localhost', 'root', '');
mysqli_select_db($con, 'mms');
?>
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$shopid = $_POST['shopid'];
$q = "select * from product natural join inventory where shop_id='$shopid'";
$res = mysqli_query($con,$q);
}
else{
header('location:shopmanager.php');
}
?>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<title>edit inventory</title>
</head>
<style>
table, th, td {
border: 2px solid;
padding: 20px;
}
</style>
<body>
<div class="card">
<div class="card-header">
MMS
</div>
<div class="card-body row">
<button class="btn"> <a href="shopmanager.php">Back </a> </button>
<h5 class="card-title" style="text-align: center;margin:auto;">Edit inventory</h5>
<form method="POST" action="addProduct.php">
<input type="hidden" name="sid" value="<?php echo $shopid?>">
<button class="btn btn-primary" type="submit"> Add Product</button>
</form>
</div>
</div>
<table style="margin:35px auto ;width:max-content;">
<tr>
<th>Name</th>
<th>Price</th>
<th>Quantity</th>
<th>Action</th>
</tr>
<?php
while($row1 = mysqli_fetch_array($res)){
?>
<tr><form method="POST" action="editInventoryItem.php">
<input type='hidden' name='pid' value='<?php echo $row1['product_id']?>'>
<input type='hidden' name='sid' value='<?php echo $row1['shop_id']?>'>
<td><input name="name" type="text" readonly class="form-control-plaintext" id="staticEmail" value='<?php echo $row1['name']?>'></td>
<td><input name="price" type="text" readonly class="form-control-plaintext" id="staticEmail" value='<?php echo $row1['s_price']?>'></td>
<td><input name="qty" type="text" readonly class="form-control-plaintext" id="staticEmail" value='<?php echo $row1['quantity']?>'></td>
<td><input type='submit' class="btn btn-primary" value="Edit"></input> </td>
</form>
</tr>
<?php } ?>
</table>