/
frmShowOperations.php
63 lines (54 loc) · 2.23 KB
/
frmShowOperations.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
<?php
$frmOperationShowName="OperationShow";
print("<div id=\"$frmOperationAddName\" style=\"display:$defaultDivStyle\">\n");
/* Variable that adds a unique prefix to the
element names in this form */
$frmElementPrefix = "operation";
/* Variable indicating number of elements in the form */
$frmElementCount = 5;
/* Variable array to store the names of the elements */
$frmElementText = array ('Operation name', 'Machine ID', 'Operation description', 'Operation cutting time', 'Operation clamping time');
/* Variable array to store the names of the colums in the Database */
$frmElementDBNames = array ('Name', 'MachineID', 'Description', 'CuttingTime', 'ClampingTime');
/* Variable for row & column widths of the local table */
$operationTableWidth = 570;
$operationTableRowWidth = $operationTableWidth;
$operationTableColWidth = "100%";
/* Variable array to store the names of the elements */
$itemCount=0;
while ($itemCount < $frmElementCount) {
$frmElementNames[$itemCount] = "$frmElementPrefix$frmElementDBNames[$itemCount]";
$frmElementTypes[$itemCount] = "text";
$itemCount++;
};
print("<table border=\"0.5\" width = \"$operationTableWidth\">\n");
for ($idx = 0; $idx < $frmElementCount; $idx++) {
print("\t<tr width = \"$operationTableRowWidth\">\n");
print("\t<td width = $operationTableColWidth>");
print("$frmElementText[$idx]");
print("\t</td>\n");
print("\t<td width = \"$operationTableColWidth\">");
$fieldName = $frmElementNames[$idx];
$fieldType = $frmElementTypes[$idx];
if (IsSet($_POST[$fieldName])) {
$fieldValue = $_POST[$fieldName];
} else {
$fieldValue = "";
}
writeTextBox($fieldName, $fieldValue);
if ($frmElementDBNames[$idx] == "MachineID") {
print("\t<td>");
writeButton("findMachineID","Find machine ID", "javascript:void();");
print("\t</td>\n");
}
print("\t</td>");
print("\t</tr>\n");
}
print("\t<tr>\n");
print("\t<td>");
writeButton("addOperation", "Add Operation", "javascript:void();");
print("\t</td>");
print("\t<\tr>\n");
print("</table>\n");
print("</div>\n");
?>