/
frmPartsAdd.php
64 lines (59 loc) · 2.38 KB
/
frmPartsAdd.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
<?php
print("<div id=\"$frmPartAddName\" style=\"display:$defaultDivStyle\">\n");
print("<form action=\"$frmAction?AddPart=true\" method=\"post\" enctype = \"multipart/form-data\">\n");
if (IsSet($frmPartAddTableWidth)) {
print("<table border=\"$mainTableBorder\" width = \"$frmPartAddTableWidth\" cellspacing=\"10\">\n");
} else {
print("<table border=\"$mainTableBorder\" width = \"$masterTableWidth\" cellspacing=\"10\">\n");
}
for ($idx = 0; $idx < $frmPartElementCount; $idx++) {
print("\t<tr>\n");
print("\t<td>");
print("$frmPartElementText[$idx]");
print("\t</td>\n");
print("\t<td>");
$fieldName = $frmPartElementNames[$idx];
$fieldType = $frmPartElementTypes[$idx];
if (IsSet($_POST[$fieldName])) {
$fieldValue = $_POST[$fieldName];
} else {
$fieldValue = "";
}
if ($fieldName == "partDrawingFilePath") {
writeInputFile($fieldName);
} else if ($fieldName == "partPreviewImage") {
writeInputFile($fieldName);
} else if ($fieldName == "partCustomerName") {
writeSelectAndAdd($fieldName, $customerNames, 180, "addCustomer", "Add Customer", "javascript:showAddCustomer();");
} else {
writeTextBox($fieldName, $fieldValue);
}
print("\t</td>");
/* Add the operations list for the first row with
a column span of size $frmPartElementCount */
/* A list of operations that have been added for this part */
if ($idx == 0) {
print("\t<td>");
print("Operations added:<br>");
print("\t</td>");
}
if ($idx == 1) {
print("\t<td valign=\"top\" rowspan=\"$frmPartElementCount\">");
print("<select id = \"operationList\" size = \"$frmPartElementCount\" style=\"width:250\">\n");
print("</select>");
print("<br>");
writeButton("addOperation", "Create Operation", "javascript:showAddOperation();");
writeButton("addOperation", "Delete Operation", "javascript:deleteSelectedOperation();");
print("\t</td>");
}
print("\t</tr>\n");
}
/* A hidden textbox to store the Operations for posting */
writeTextBox("operationStore", "");
writeTextBox("customerStore", "");
writeTextBox("operationDeleteList", "");
print("</table>\n");
writeSubmit("addPart", "Add part");
print("</form>\n");
print("</div>\n");
?>