-
Notifications
You must be signed in to change notification settings - Fork 0
/
mspersontext_cat.php
68 lines (66 loc) · 3.32 KB
/
mspersontext_cat.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
66
67
68
<?php
include("functions.php");
include("accesscontrol.php");
print_header("Category Indicators","#FFF0E0",0);
?>
<script type="text/javascript">
function fill_parent(pc,pref,shi,rom) {
thisform = document.forms['catform'];
parentform = window.opener.document.forms['optionsform'];
selected = 0;
for (i=1; i<7; i++) {
if (thisform.elements["select"+i+"A"]) {
selected = 1;
val = (thisform.elements["choice"+i+"A"][0].checked) ? thisform.elements["choice"+i+"A"][0].value : thisform.elements["choice"+i+"A"][1].value;
val += "=" + thisform.elements["select"+i+"A"].value;
if (thisform.elements["select"+i+"B"].value) {
val += (thisform.elements["logical"+i][0].checked) ? thisform.elements["logical"+i][0].value : thisform.elements["logical"+i][1].value;
val += (thisform.elements["choice"+i+"B"][0].checked) ? thisform.elements["choice"+i+"B"][0].value : thisform.elements["choice"+i+"B"][1].value;
val += "=" + thisform.elements["select"+i+"B"].value;
}
parentform.elements["cat"+i].value = val;
parentform.elements["mark"+i].value = thisform.elements["mark"+i].value;
parentform.elements["tag"+i].value = thisform.elements["tag"+i].value;
}
}
if (selected == 0) {
alert("You must at least choose one category. If you want to remove 'Category' from your field selections, press Cancel.");
} else {
alert("For now, you'll need to hit the submit button again in the other window after this window closes.");
//parentform.submit();
window.close();
}
}
</script>
<h3>Please specify preferences for category fields:</h3>
<form name="catform" onsubmit="return false;">
<?php
$sql = "SELECT * from category ORDER BY Category";
$result = sqlquery_checked($sql);
while ($row = mysqli_fetch_object($result)) {
$option_text .= "<option value=\"".$row->CategoryID."\">".$row->Category."</option>\n";
}
for ($str_index=0; $str_index<strlen($fields); $str_index++) {
$i = substr($fields,$str_index,1);
echo " <p>Put <input type=text name=\"mark{$i}\" value=\"*\" size=5>";
echo " (XML tag <input type=text name=\"tag{$i}\" value=\"cat{$i}\" size=5>) in Field $i if:<br>\n";
echo " <input type=\"radio\" name=\"choice{$i}A\" value=\"in\" checked>In\n";
echo " <input type=\"radio\" name=\"choice{$i}A\" value=\"out\">Not In: \n";
echo " <select name=\"select{$i}A\" size=\"1\">\n";
echo " <option value=\"\">Select a Category...</option>\n";
echo $option_text;
echo " </select><br> ";
echo " (option) <input type=\"radio\" name=\"logical{$i}\" value=\" OR \" checked>Or\n";
echo " <input type=\"radio\" name=\"logical{$i}\" value=\" AND \">And:<br>\n";
echo " <input type=\"radio\" name=\"choice{$i}B\" value=\"in\" checked>In\n";
echo " <input type=\"radio\" name=\"choice{$i}B\" value=\"out\">Not In: \n";
echo " <select name=\"select{$i}B\" size=\"1\">\n";
echo " <option value=\"\"> </option>\n";
echo $option_text;
echo " </select><br> ";
}
?>
<p> <button name="go" type="button" onclick="fill_parent();">Submit These Choices</button>
<button name="cancel" type="button" onclick="window.close();">Cancel</button></p>
</form>
<?php print_footer(); ?>