Location: PHPKode > scripts > phpRetrieve > phpRetrieve/viewDesign.php
<div id="left" >

			<?php
				
				include('navigator.php');

			?>
			
</div>
<div id="right" >
		&nbsp;&nbsp;<a class="button" href="javascript: submitMyForm('SQL');"  title="Show MySQL" ><span><b>Show MySQL</b></span></a>
		&nbsp;&nbsp;<a class="button" href="javascript: submitMyForm('Run');"  title="Run Query" ><span><b>Run</b></span></a>
		&nbsp;&nbsp;<a class="button" href="javascript: submitMyForm('Save');"  title="Save Query" ><span><b>Save</b></span></a>
		<div class="clear">
			<br/>&nbsp;&nbsp;Table '<?php echo $tbl; ?>'contains <?php echo $rc; ?> records.
		</div>
		<form id="myForm" method="post" action="getCriteria.php">
		<table>
			<tr><th style="width:120px;">Field</th><th style="width:100px;">Type</th><th style="width:50px;">Select</th><th style="width:100px;">Condition</th><th style="width:150px;" colspan="2">Criteria</th></tr>
			<?php
				
				//Show field information
				$i = 0;
				if($tbl != ""){
					while ($array = mysql_fetch_array($fld_result)) {
						$i++;
						$fld = $array['Field'];
						$tpe = $array['Type'];
						$chk = ""; if(isset($arr[$fld]['Select'])){ if($arr[$fld]['Select'] == "yes"){ $chk="Checked=Checked"; }}
						$eq="";$gt="";$lt="";$ge="";$le="";$lk="";$bt="";$vl2="style='display: none;'";$in="";
						if(isset($arr[$fld]['Condition'])){
							if($arr[$fld]['Condition'] == "eq"){ $eq="Selected=Selected"; }
							if($arr[$fld]['Condition'] == "gt"){ $gt="Selected=Selected"; }
							if($arr[$fld]['Condition'] == "lt"){ $lt="Selected=Selected"; }
							if($arr[$fld]['Condition'] == "ge"){ $ge="Selected=Selected"; }
							if($arr[$fld]['Condition'] == "le"){ $le="Selected=Selected"; }
							if($arr[$fld]['Condition'] == "lk"){ $lk="Selected=Selected"; }
							if($arr[$fld]['Condition'] == "bt"){ $bt="Selected=Selected"; $vl2=""; }
							if($arr[$fld]['Condition'] == "in"){ $in="Selected=Selected"; }
						}
						if(isset($arr[$fld]['Val1'])){ $val1=$arr[$fld]['Val1']; } else{ $val1 = ""; }
						if(isset($arr[$fld]['Val2'])){ $val2=$arr[$fld]['Val2']; } else{ $val2 = ""; }
						echo "<tr><td>".$fld."<input type='hidden' value='$fld' name='".$i."_field'></td>
									<td>".$tpe."</td>
									<td style='text-align: center;'><input type='checkbox' name='".$i."_include' value='yes' $chk/></td>
									<td style='text-align: center;'>
										<select name='".$i."_condition' onchange=\"secondField(this.options[this.selectedIndex].value, '".$i."_Val2')\">
											<option value='eq' $eq>=</option>
											<option value='gt' $gt>&gt;</option>
											<option value='lt' $lt>&lt;</option>
											<option value='ge' $ge>&gt;=</option>
											<option value='le' $le>&lt;=</option>
											<option value='lk' $lk>Like</option>
											<option value='bt' $bt>Between</option>
											<option value='in' $in>In</option>
										</select>
									</td>
									<td style='text-align: center;'>
										<input name='".$i."_Val1' id='".$i."_Val1' value=\"".htmlentities($val1, ENT_QUOTES)."\" type='text' Size='12' />									
									</td>
									<td style='text-align: center;'>
										<input name='".$i."_Val2' id='".$i."_Val2' $vl2 value=\"".htmlentities($val2, ENT_QUOTES)."\" type='text' Size='12' />									
									</td>
								</tr> ";
					}
				}
			?>
			
		</table>
		<input name="fieldcount" value="<?php echo $i; ?>" type="hidden" />
		<input id="do" name="do" value="Run" type="hidden" />
		</form>
</div>
Return current item: phpRetrieve