| 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 |
require("include/session.php"); |
|---|
| 38 |
|
|---|
| 39 |
function showSearch($tabledefid,$basepath){ |
|---|
| 40 |
global $dblink; |
|---|
| 41 |
|
|---|
| 42 |
|
|---|
| 43 |
$querystatement="SELECT querytable FROM tabledefs WHERE id=".$tabledefid; |
|---|
| 44 |
$queryresult = mysql_query($querystatement,$dblink); |
|---|
| 45 |
if(!$queryresult) reportError(500,"Cannot retrieve Table Information"); |
|---|
| 46 |
$thetabledef=mysql_fetch_array($queryresult); |
|---|
| 47 |
|
|---|
| 48 |
|
|---|
| 49 |
$querystatement="SELECT * FROM ".$thetabledef["querytable"]." LIMIT 1"; |
|---|
| 50 |
$queryresult = mysql_query($querystatement,$dblink); |
|---|
| 51 |
if(!$queryresult) reportError(500,"Cannot retrieve Table Information"); |
|---|
| 52 |
$numfields = mysql_num_fields($queryresult); |
|---|
| 53 |
for ($i=0;$i<$numfields;$i++) $fieldlist[]=mysql_field_table($queryresult,$i).".".mysql_field_name($queryresult,$i); |
|---|
| 54 |
?><table border="0" cellspacing="0" cellpadding="0"> |
|---|
| 55 |
<tr> |
|---|
| 56 |
<td valign=top width="99%"> |
|---|
| 57 |
<div>match <select id="ASanyall" onChange="updateAS()"> |
|---|
| 58 |
<option value="and" selected="selected">all</option> |
|---|
| 59 |
<option value="or">any</option> |
|---|
| 60 |
</select> of the following rules:</div> |
|---|
| 61 |
<div id="theASCs" style="margin:0px;padding:0px;"> |
|---|
| 62 |
<div id="ASC1"> |
|---|
| 63 |
<select id="ASC1field" onChange="updateAS()"> |
|---|
| 64 |
<?php |
|---|
| 65 |
foreach($fieldlist as $field){ |
|---|
| 66 |
echo "<option value=\"".$field."\" >".$field."</option>\n";}?> |
|---|
| 67 |
</select> |
|---|
| 68 |
<select id="ASC1operator" onChange="updateAS()"> |
|---|
| 69 |
<option value="=" selected="selected">=</option> |
|---|
| 70 |
<option value="!=">!=</option> |
|---|
| 71 |
<option value=">">></option> |
|---|
| 72 |
<option value="<"><</option> |
|---|
| 73 |
<option value=">=">>=</option> |
|---|
| 74 |
<option value="<="><=</option> |
|---|
| 75 |
<option value="like">like</option> |
|---|
| 76 |
<option value="not like">not like</option> |
|---|
| 77 |
</select> |
|---|
| 78 |
<input type="text" id="ASC1text" size="30" maxlength="255" onKeyUp="updateAS()" value="" /> |
|---|
| 79 |
<button type="button" id="ASC1minus" class="invisibleButtons" onClick="removeLineAS(this)"><img src="<?php echo $_SESSION["app_path"] ?>common/stylesheet/<?php echo $_SESSION["stylesheet"] ?>/button-minus-disabled.png" align="middle" alt="-" width="16" height="16" border="0" /></button> |
|---|
| 80 |
<button type="button" id="ASC1plus" class="invisibleButtons" onClick="addlineAS()"><img src="<?php echo $_SESSION["app_path"] ?>common/stylesheet/<?php echo $_SESSION["stylesheet"] ?>/button-plus.png" align="middle" alt="+" width="16" height="16" border="0" /></button> |
|---|
| 81 |
</div> |
|---|
| 82 |
</div> |
|---|
| 83 |
<div> |
|---|
| 84 |
sql where clause<br/> |
|---|
| 85 |
<textarea id="ASSQL" style="width:99%" cols="90" rows="3" onKeyUp="ASEnableSave(this)"></textarea> |
|---|
| 86 |
</div> |
|---|
| 87 |
</td> |
|---|
| 88 |
<td valign="top"> |
|---|
| 89 |
<div align="right" style="margin-top:10px;"><br /> |
|---|
| 90 |
<input id="ASsearchbutton" type="button" onClick="performAdvancedSearch(this)" class="Buttons" disabled="true" value="search" style="width:90px;" accesskey="" /> |
|---|
| 91 |
</div> |
|---|
| 92 |
</td> |
|---|
| 93 |
</tr> |
|---|
| 94 |
</table><?php |
|---|
| 95 |
} |
|---|
| 96 |
|
|---|
| 97 |
|
|---|
| 98 |
if(isset($_GET["cmd"])){ |
|---|
| 99 |
switch($_GET["cmd"]){ |
|---|
| 100 |
case "show": |
|---|
| 101 |
showSearch($_GET["tid"],$_GET["base"]); |
|---|
| 102 |
break; |
|---|
| 103 |
} |
|---|
| 104 |
} |
|---|
| 105 |
?> |
|---|
| 106 |
|
|---|