| 1 |
<?php |
|---|
| 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 |
require("include/session.php"); |
|---|
| 40 |
|
|---|
| 41 |
function showSearch($tabledefid,$basepath,$db){ |
|---|
| 42 |
|
|---|
| 43 |
$querystatement="SELECT querytable FROM tabledefs WHERE id=".$tabledefid; |
|---|
| 44 |
$queryresult = $db->query($querystatement); |
|---|
| 45 |
if(!$queryresult) $error = new appError(500,"Cannot retrieve Table Information"); |
|---|
| 46 |
$thetabledef=$db->fetchArray($queryresult); |
|---|
| 47 |
|
|---|
| 48 |
|
|---|
| 49 |
$querystatement="SELECT * FROM ".$thetabledef["querytable"]." LIMIT 1"; |
|---|
| 50 |
$queryresult = $db->query($querystatement); |
|---|
| 51 |
if(!$queryresult) $error = new appError(500,"Cannot retrieve Table Information"); |
|---|
| 52 |
$numfields = $db->numFields($queryresult); |
|---|
| 53 |
for ($i=0;$i<$numfields;$i++) $fieldlist[]=$db->fieldTable($queryresult,$i).".".$db->fieldName($queryresult,$i); |
|---|
| 54 |
?> |
|---|
| 55 |
<p align="right" style="float:right"> |
|---|
| 56 |
<input id="ASsearchbutton" type="button" onclick="performAdvancedSearch(this)" class="Buttons" disabled="disabled" value="search" /> |
|---|
| 57 |
</p> |
|---|
| 58 |
|
|---|
| 59 |
<p>match <select id="ASanyall" onchange="updateAS()"> |
|---|
| 60 |
<option value="and" selected="selected">all</option> |
|---|
| 61 |
<option value="or">any</option> |
|---|
| 62 |
</select> of the following rules:</p> |
|---|
| 63 |
<div id="theASCs"> |
|---|
| 64 |
<div id="ASC1"> |
|---|
| 65 |
<select id="ASC1field" onchange="updateAS()"> |
|---|
| 66 |
<?php |
|---|
| 67 |
foreach($fieldlist as $field){ |
|---|
| 68 |
echo "<option value=\"".$field."\" >".$field."</option>\n";}?> |
|---|
| 69 |
</select> |
|---|
| 70 |
<select id="ASC1operator" onchange="updateAS()"> |
|---|
| 71 |
<option value="=" selected="selected">=</option> |
|---|
| 72 |
<option value="!=">!=</option> |
|---|
| 73 |
<option value=">">></option> |
|---|
| 74 |
<option value="<"><</option> |
|---|
| 75 |
<option value=">=">>=</option> |
|---|
| 76 |
<option value="<="><=</option> |
|---|
| 77 |
<option value="like">like</option> |
|---|
| 78 |
<option value="not like">not like</option> |
|---|
| 79 |
</select> |
|---|
| 80 |
<input type="text" id="ASC1text" size="30" maxlength="255" onkeyup="updateAS()" value="" /> |
|---|
| 81 |
<button type="button" id="ASC1minus" class="graphicButtons buttonMinusDisabled" onclick="removeLineAS(this)"><span>-</span></button> |
|---|
| 82 |
<button type="button" id="ASC1plus" class="graphicButtons buttonPlus" onclick="addlineAS()"><span>+</span></button> |
|---|
| 83 |
</div> |
|---|
| 84 |
</div> |
|---|
| 85 |
<p> |
|---|
| 86 |
sql where clause<br/> |
|---|
| 87 |
<textarea id="ASSQL" style="width:99%" cols="90" rows="3" onkeyup="ASEnableSave(this)"></textarea> |
|---|
| 88 |
</p><?php |
|---|
| 89 |
} |
|---|
| 90 |
|
|---|
| 91 |
|
|---|
| 92 |
if(isset($_GET["cmd"])){ |
|---|
| 93 |
switch($_GET["cmd"]){ |
|---|
| 94 |
case "show": |
|---|
| 95 |
showSearch($_GET["tid"],$_GET["base"],$db); |
|---|
| 96 |
break; |
|---|
| 97 |
} |
|---|
| 98 |
} |
|---|
| 99 |
?> |
|---|
| 100 |
|
|---|