\n"; echo "\n"; ### Field columns echo "\n"; $z=0; for($x = 0; $x < $col; $x++) { if(isset($InsCol[$x]) && $InsCol[$x]== "on") { echo "\n"; $z++; } if(isset($DelCol[$x]) && $DelCol[$x]== "on") continue; echo "\n"; } echo "\n"; ### Sort columns echo "\n"; $z = 0; for($x = 0; $x < $col; $x++) { if(isset($InsCol[$x]) && $InsCol[$x]== "on") { echo "\n"; $z++; } if(isset($DelCol[$x]) && $DelCol[$x]== "on") continue; echo "\n"; $z++; } ### Show columns echo "\n"; $z=0; for($x = 0; $x < $col; $x++) { if(isset($InsCol[$x]) && $InsCol[$x]== "on") { echo "\n"; $z++; } if(isset($DelCol[$x]) && $DelCol[$x]== "on") continue; $sel = ""; if(isset($Show[$x])) { $sel = "checked"; $curShow[$z] = $Show[$x]; } echo "\n"; $z++; } ### Criteria columns echo "\n"; $z=0; for($x = 0; $x < $col; $x++) { if(isset($InsCol[$x]) && $InsCol[$x]== "on") { echo "\n"; $z++; } if(isset($DelCol[$x]) && $DelCol[$x]== "on") continue; if(get_magic_quotes_gpc()) { $stripped_Criteria = stripslashes($Criteria[$x]); } else { $stripped_Criteria = $Criteria[$x]; } echo "\n"; $curCriteria[$z] = $Criteria[$x]; $z++; } ### And/Or columns and rows $w=0; for($y = 0; $y <= $row; $y++) { $bgcolor = $cfgBgcolorOne; if($y % 2 == 0) $bgcolor = $cfgBgcolorTwo; if($InsRow[$y]== "on") { echo "\n"; $z=0; for ($x = 0; $x < $col; $x++) { if($InsCol[$x]== "on") { $or = "Or".$w; echo "\n"; $z++; } if($DelCol[$x]== "on") continue; $or = "Or".$w; echo "\n"; $z++; } $w++; } if($DelRow[$y]== "on") continue; echo "\n"; $z=0; for ($x = 0; $x < $col; $x++) { if(isset($InsCol[$x]) && $InsCol[$x]== "on") { $or = "Or".$w; echo "\n"; $z++; } if(isset($DelCol[$x]) && $DelCol[$x]== "on") continue; $or = "Or".$y; if(!isset(${$or})) ${$or} = ""; if(get_magic_quotes_gpc()) { $stripped_or = stripslashes(${$or}[$x]); } else { $stripped_or = ${$or}[$x]; } echo "\n"; ${"cur".$or}[$z] = ${$or}[$x]; $z++; } $w++; } ### Modify columns echo "\n"; $z=0; for($x = 0; $x < $col; $x++) { if(isset($InsCol[$x]) && $InsCol[$x]== "on") { $curAndOrCol[$z]=$AndOrCol[$y]; if($AndOrCol[$z] == 'or') { $chk[ 'or'] = "checked"; $chk[ 'and'] = ""; } else { $chk[ 'and'] = "checked"; $chk[ 'or'] = ""; } echo "\n"; $z++; } if(isset($DelCol[$x]) && $DelCol[$x]== "on") continue; $curAndOrCol[$z]=$AndOrCol[$y]; if(isset($AndOrCol[$z]) && $AndOrCol[$z] == 'or') { $chk[ 'or'] = "checked"; $chk[ 'and'] = ""; } else { $chk[ 'and'] = "checked"; $chk[ 'or'] = ""; } echo "\n"; $z++; } echo "
$strField:\n"; echo "\n"; echo "
Sort:\n"; echo "\n"; echo "
Show:
Criteria:"; echo ""; echo "
"; $chk[ 'or'] = "checked"; $chk[ 'and'] = ""; # Row controls echo "
Ins: And:
Del: Or:
"; $curAndOrRow[$w]=$AndOrRow[$y]; if($AndOrRow[$y] == 'and') { $chk[ 'and'] = "checked"; $chk[ 'or'] = ""; } else { $chk[ 'or'] = "checked"; $chk[ 'and'] = ""; } # Row controls echo "
Ins: And:
Del: Or:
"; echo ""; echo "
Modify: Or: And:
Ins:   Del:
Or: And:
Ins:   Del:
\n"; ### Other controls echo "
Use Tables:
\n"; $w--; echo "\n"; echo "\n"; echo "\n"; echo "Add/Delete Criteria Row:
"; echo "Add/Delete Field Columns:
"; echo "\n"; echo "\n"; echo "\n"; echo ""; ### Generate a query echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo ""; echo "
"; echo " SQL query on database $db:
"; echo "
"; ?>