-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpartinventory.php
More file actions
31 lines (29 loc) · 955 Bytes
/
Copy pathpartinventory.php
File metadata and controls
31 lines (29 loc) · 955 Bytes
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
<?php
$servername = "localhost";
$username = "admin";
$password = "admin";
$dbname = "woodysdb";
$conn = new mysqli($servername, $username, $password, $dbname);
function returnFormLocation($conn) {
$query = "SELECT * FROM `businesslocation`";
$location = $conn->query($query);
echo "<h4>Inventory Location</h4><br>";
if ($location->num_rows > 0) {
// output data of each row
while($row = $location->fetch_assoc()) {
echo "<input type=\"radio\" name=\"locationid\" value=\"".$row["id"]."\">".$row["loc_address"]."<br>";
}
} else {
echo "0 results";
}
}
echo "<h3>Did you use any parts?</h3>";
echo "<form method=\"POST\" action=\"partupdate.php\">";
echo returnFormLocation($conn);
echo "
<label for=\"part\">Part</label>
<input type=\"part\" name=\"part\"><br>
<input type=\"submit\" value=\"Submit Changes\">
</form>
";
echo "<a href=\"employee.php\">Go back</a>";