-
Notifications
You must be signed in to change notification settings - Fork 0
/
edit.php
62 lines (61 loc) · 2.01 KB
/
edit.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
<!doctype html>
<html lang="en-US">
<head>
<title>PS Test</title>
<link href="css/singlePageTemplate.css" rel="stylesheet" type="text/css">
<script>
function validateForm() {
var anum = document.forms["myform"]["anum"].value;
var aname = document.forms["myform"]["aname"].value;
var sloc = document.forms["myform"]["sloc"].value;
var price = document.forms["myform"]["price"].value;
if (anum == "" || anum == null) {
alert("Please enter Article Number");
return false;
}
if (aname == "" || aname == null) {
alert("Please enter Article Name");
return false;
}
if (sloc == "" || sloc == null) {
alert("Please enter Storage Location");
return false;
}
if (price == "" || price == null) {
alert("Please enter Price");
return false;
}
}
</script>
</head>
<body>
<!-- Main Container -->
<div class="container">
<!-- Navigation -->
<header> <a href="">
<h4 class="logo">PS Test</h4>
</a>
<h2 class="hero_header">PS COOPERATION </h2>
<p class="tagline">Article Management</p>
</header>
<?php
include('connection.php');
$searchkey = $_GET['id'];
$result = mysqli_query($db_connect,"SELECT * FROM articleinfo where RFIDID = '$searchkey'");
$row = mysqli_fetch_row($result);
echo "<table>";
echo "<form name='myform' action='/editaction.php' method='POST' onsubmit='return validateForm()'> ";
echo "<tr><td>RFID ID</td><td>$row[0]</td></tr>";
echo "<tr><td>Article Number</td><td><input type='text' name='anum' value='$row[1]' ></td></tr>";
echo "<tr><td>Article Name</td><td><input type='text' name='aname' value='$row[2]'></td></tr>";
echo "<tr><td>Storage Location</td><td><input type='text' name='sloc' value='$row[3]' ></td></tr>";
echo "<tr><td>Price</td><td><input type='text' name='price' value='$row[4]'></td></tr>";
echo "<tr><td><input type='submit' value='Update'></td></tr>";
echo "<input type='hidden' name='rfid' value='$row[0]'>";
echo "</form>";
echo "</table>"
?>
<div class="copyright">©2020- <strong>PS Test</strong></div>
</div>
</body>
</html>