-
Notifications
You must be signed in to change notification settings - Fork 0
/
supplier.php
65 lines (59 loc) · 1.41 KB
/
supplier.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
<html>
<head>
<link rel="stylesheet" href="jquery_ui/jquery-ui.min.css">
<script src="jquery_ui/external/jquery/jquery.js"></script>
<script src="jquery_ui/jquery-ui.min.js"></script>
<script src="supplier.js"></script>
</head>
<body>
<form id="suppDetailsForm" action="<?php echo $_SERVER['PHP_SELF']?>" method="get">
<input type="hidden" name="suppNo" value=""/>
</form>
<table>
<?php
include_once("Brain/User.php");
include_once("Brain/functions.php");
regGet('suppNo');
if (isset($suppNo)) {
$supp = getSupplier($suppNo);
echo
'<tr>
<th>Supplier ID</th>
<td>' . $supp[suppNo] . '</td>
</tr>
<tr>
<th>Supplier Name</th>
<td>' . $supp[suppName] . '</td>
</tr>
<tr>
<th>Tel.</th>
<td>' . $supp[suppTel] . '</td>
<tr>
<th>Address</th>
<td>' . $supp[suppAddr] . '</td>
</tr>';
}
else { //show all suppliers
$supps = getAllSuppliers(suppName, "ASC");
echo
'<tr>
<th>Supplier ID</th>
<th>Supplier Name</th>
<th>Tel</th>
<th>Address</th>
</tr>';
foreach ($supps as $s) {
echo
'<tr id="' . $s[suppNo] . '" onclick="showSuppDetails(this)">
<td>' . $s[suppNo] . '</td>
<td>' . $s[suppName] . '</td>
<td>' . $s[suppTel] . '</td>
<td>' . $s[suppAddr] . '</td>
</tr>';
}
echo '</form>';
}
?>
</table>
</body>
</html>