Jump to content

search by field - code edit


chaosuk

Recommended Posts

Hi all,

 

been asked to add a search by model number facility to this website

 

click here for website

 

As you can see the main search facility works just fine and is handled by process.php, but, and for the life of me I can't see why not, I can't get the specific 'search by no.' to work!

 

Any advice appreciated, source code can be provided

 

Thanks

 

Iain

18228_.php

18229_.php

Link to comment
Share on other sites

Figured it was easier posting the file, but here it is as requested  :D

 

<? 
//===========request.form checkboxes===================

$checkbox=$_POST["checkbox"];
//============use for search recordset paging================

if (strlen($_GET["cb1"])!=0)
{

  $checkbox=$_GET["cb1"];
} 

//===========================================================

if ($checkbox=="1")
{

  $checkboxDisplay=" and tblModel.A_FN =".$checkbox;
}
  else
{

  $checkboxDisplay=" ";
} 


$checkbox2=$_POST["checkbox2"];
//============use for search recordset paging================

if (strlen($_GET["cb2"])!=0)
{

  $checkbox2=$_GET["cb2"];
} 

//===========================================================

if ($checkbox2=="1")
{

  $checkbox2Display=" and TS =".$checkbox2;

}
  else
{

  $checkbox2Display=" ";
} 


$checkbox3=$_POST["checkbox3"];
//============use for search recordset paging================

if (strlen($_GET["cb3"])!=0)
{

  $checkbox3=$_GET["cb3"];
} 

//===========================================================

if ($checkbox3=="1")
{

  $checkbox3Display=" and CON =".$checkbox3;
}
  else
{

  $checkbox3Display=" ";
} 


$checkbox4=$_POST["checkbox4"];
//============use for search recordset paging================

if (strlen($_GET["cb4"])!=0)
{

  $checkbox4=$_GET["cb4"];
} 

//===========================================================

if ($checkbox4=="1")
{

  $checkbox4Display=" and STI =".$checkbox4;
}
  else
{

  $checkbox4Display=" ";
} 


$checkbox5=$_POST["checkbox5"];
//============use for search recordset paging================

if (strlen($_GET["cb5"])!=0)
{

  $checkbox5=$_GET["cb5"];
} 

//===========================================================

if ($checkbox5=="1")
{

  $checkbox5Display=" and FA =".$checkbox5;
}
  else
{

  $checkbox5Display=" ";
} 


$checkbox6=$_POST["checkbox6"];
//============use for search recordset paging================

if (strlen($_GET["cb6"])!=0)
{

  $checkbox6=$_GET["cb6"];
} 

//===========================================================

if ($checkbox6=="1")
{

  $checkbox6Display=" and VID =".$checkbox6;
}
  else
{

  $checkbox6Display=" ";
} 


$checkbox7=$_POST["checkbox7"];
//============use for search recordset paging================

if (strlen($_GET["cb7"])!=0)
{

  $checkbox7=$_GET["cb7"];
} 

//===========================================================

if ($checkbox7=="1")
{

  $checkbox7Display=" and BGS =".$checkbox7;
}
  else
{

  $checkbox7Display=" ";
} 


$checkbox8=$_POST["checkbox8"];
//============use for search recordset paging================

if (strlen($_GET["cb8"])!=0)
{

  $checkbox8=$_GET["cb8"];
} 

//===========================================================

if ($checkbox8=="1")
{

  $checkbox8Display=" and GGS =".$checkbox8;
}
  else
{

  $checkbox8Display=" ";
} 


$checkbox9=$_POST["checkbox9"];
//============use for search recordset paging================

if (strlen($_GET["cb9"])!=0)
{

  $checkbox9=$_GET["cb9"];
} 

//===========================================================

if ($checkbox9=="1")
{

  $checkbox9Display=" and BGX =".$checkbox9;
}
  else
{

  $checkbox9Display=" ";
} 


$checkbox10=$_POST["checkbox10"];
//============use for search recordset paging================

if (strlen($_GET["cb10"])!=0)
{

  $checkbox10=$_GET["cb10"];
} 

//===========================================================

if ($checkbox10=="1")
{

  $checkbox10Display=" and GGX =".$checkbox10;
}
  else
{

  $checkbox10Display=" ";
} 

//=========== end of request.form checkboxes===========

//===========calculate each range of height============

$height=str_replace("'","''",$_POST["txtHeight"]);
//============use for search recordset paging================

if (strlen($_GET["height"])!=0)
{

  $height=$_GET["height"];
} 

//===========================================================

if ($height=="heightA")
{

  $rangeHeight="BETWEEN '4' AND '5'";
  $heightDisplay=" and modelHeight ".$rangeHeight." ";
}
  else
if ($height=="heightB")
{

  $rangeHeight="BETWEEN '5' AND '6'";
  $heightDisplay=" and modelHeight ".$rangeHeight." ";
}
  else
if ($height=="heightC")
{

  $rangeHeight="BETWEEN '6' AND '7'";
  $heightDisplay=" and modelHeight ".$rangeHeight." ";
}
  else
{

  $rangeHeight=" ";
  $heightDisplay=$rangeHeight;
} 

//===========end of range calculation==================

//===========calculate modelLocation ==================

$location=str_replace("'","''",$_POST["txtLocation"]);
//============use for search recordset paging================

if (strlen($_GET["location"])!=0)
{

  $location=$_GET["location"];
} 

//===========================================================

if ($location!="")
{

  $locationDisplay=" and modelLocation like '%".$location."' ";
}
  else
{

  $locationDisplay=" ";
} 


$hair=str_replace("'","''",$_POST["txtHair"]);
//============use for search recordset paging================

if (strlen($_GET["hair"])!=0)
{

  $hair=$_GET["hair"];
} 

//===========================================================

if ($hair!="")
{

  $hairDisplay=" and modelHair like '%".$hair."%' ";
}
  else
{

  $hairDisplay=" ";
} 


//==========calculate each range of bust size =========

$bSize=str_replace("'","''",$_POST["txtBust"]);
//============use for search recordset paging================

if (strlen($_GET["bSize"])!=0)
{

  $bSize=$_GET["bSize"];
} 

//===========================================================

if ($bSize=="bustA")
{

  $rangeBust="BETWEEN '20' AND '24'";
  $bustDisplay=" and modelSize ".$rangeBust." ";
}
  else
if ($bSize=="bustB")
{

  $rangeBust="BETWEEN '25' AND '29'";
  $bustDisplay=" and modelSize ".$rangeBust." ";
}
  else
if ($bSize=="bustC")
{

  $rangeBust="BETWEEN '30' AND '34'";
  $bustDisplay=" and modelSize ".$rangeBust." ";
}
  else
if ($bSize=="bustD")
{

  $rangeBust="BETWEEN '35' AND '39'";
  $bustDisplay=" and modelSize ".$rangeBust." ";
}
  else
if ($bSize=="bustE")
{

  $rangeBust="BETWEEN '40' AND '44'";
  $bustDisplay=" and modelSize ".$rangeBust." ";
}
  else
if ($bSize=="bustF")
{

  $rangeBust="BETWEEN '45' AND '49'";
  $bustDisplay=" and modelSize ".$rangeBust." ";
}
  else
if ($bSize=="bustG")
{

  $rangeBust="> '50'";
  $bustDisplay=" and modelSize ".$rangeBust." ";
}
  else
{

  $rangeBust=" ";
  $bustDisplay=$rangeBust;
} 

//==========end of bust size range=====================

//==========calculate each range of ages===============

$age=str_replace("'","''",$_POST["txtAge"]);
//============use for search recordset paging================

if (strlen($_GET["age"])!=0)
{

  $age=$_GET["age"];
} 

//===========================================================

if ($age=="ageA")
{

  $rangeAge="BETWEEN '18' AND '24'";
  $ageDisplay=" and modelAge ".$rangeAge." ";
}
  else
if ($age=="ageB")
{

  $rangeAge="BETWEEN '25' AND '29'";
  $ageDisplay=" and modelAge ".$rangeAge." ";
}
  else
if ($age=="ageC")
{

  $rangeAge="BETWEEN '30' AND '34'";
  $ageDisplay=" and modelAge ".$rangeAge." ";
}
  else
if ($age=="ageD")
{

  $rangeAge="BETWEEN '35' AND '39'";
  $ageDisplay=" and modelAge ".$rangeAge." ";
}
  else
if ($age=="ageE")
{

  $rangeAge="BETWEEN '40' AND '44'";
  $ageDisplay=" and modelAge ".$rangeAge." ";
}
  else
if ($age=="ageF")
{

  $rangeAge="BETWEEN '45' AND '49'";
  $ageDisplay=" and modelAge ".$rangeAge." ";
}
  else
if ($age=="ageG")
{

  $rangeAge="BETWEEN '50' AND '54'";
  $ageDisplay=" and modelAge ".$rangeAge." ";
}
  else
if ($age=="ageH")
{

  $rangeAge="BETWEEN '55' AND '59'";
  $ageDisplay=" and modelAge ".$rangeAge." ";
}
  else
if ($age=="ageI")
{

  $rangeAge="> '60'";
  $ageDisplay=" and modelAge ".$rangeAge." ";
}
  else
{

  $rangeAge=" ";
  $ageDisplay=$rangeAge;
} 

//=========end of range of ages===================

$eye=str_replace("'","''",$_POST["txtColour"]);
//============use for search recordset paging================

if (strlen($_GET["eye"])!=0)
{

  $eye=$_GET["eye"];
} 

//===========================================================

if ($eye!="")
{

  $eyeDisplay=" and modelEyeColour like '%".$eye."%' ";
}
  else
{

  $eyeDisplay=" ";
} 


//============calculate range of waist ==============

$waist=str_replace("'","''",$_POST["txtWaist"]);
//============use for search recordset paging================

if (strlen($_GET["waist"])!=0)
{

  $waist=$_GET["waist"];
} 

//===========================================================

if ($waist=="waistA")
{

  $rangeWaist="BETWEEN '20' AND '24'";
  $waistDisplay=" and modelWaist ".$rangeWaist." ";
}
  else
if ($waist=="waistB")
{

  $rangeWaist="BETWEEN '25' AND '29'";
  $waistDisplay=" and modelWaist ".$rangeWaist." ";
}
  else
if ($waist=="waistC")
{

  $rangeWaist="BETWEEN '30' AND '34'";
  $waistDisplay=" and modelWaist ".$rangeWaist." ";
}
  else
if ($waist=="waistD")
{

  $rangeWaist="BETWEEN '35' AND '39'";
  $waistDisplay=" and modelWaist ".$rangeWaist." ";
}
  else
if ($waist=="waistE")
{

  $rangeWaist="BETWEEN '40' AND '44'";
  $waistDisplay=" and modelWaist ".$rangeWaist." ";
}
  else
if ($waist=="waistF")
{

  $rangeWaist="BETWEEN '45' AND '49'";
  $waistDisplay=" and modelWaist ".$rangeWaist." ";
}
  else
if ($waist=="waistG")
{

  $rangeWaist=">'50'";
  $waistDisplay=" and modelWaist ".$rangeWaist." ";
}
  else
{

  $rangeWaist=" ";
  $waistDisplay=$rangeWaist;
} 

//============end of range of waist ==============

//============calculate range of dress ===========

$dSize=str_replace("'","''",$_POST["txtDress"]);
//============use for search recordset paging================

if (strlen($_GET["dSize"])!=0)
{

  $dSize=$_GET["dSize"];
} 

//===========================================================

if ($dSize=="dressA")
{

  $rangeDress="BETWEEN '0' AND '4'";
  $dressDisplay=" and modelDressSize ".$rangeDress." ";
}
  else
if ($dSize=="dressB")
{

  $rangeDress="BETWEEN '5' AND '9'";
  $dressDisplay=" and modelDressSize ".$rangeDress." ";
}
  else
if ($dSize=="dressC")
{

  $rangeDress="BETWEEN '10' AND '14'";
  $dressDisplay=" and modelDressSize ".$rangeDress." ";
}
  else
if ($dSize=="dressD")
{

  $rangeDress="BETWEEN '15' AND '19'";
  $dressDisplay=" and modelDressSize ".$rangeDress." ";
}
  else
if ($dSize=="dressE")
{

  $rangeDress="BETWEEN '20' AND '24'";
  $dressDisplay=" and modelDressSize ".$rangeDress." ";
}
  else
if ($dSize=="dressF")
{

  $rangeDress="BETWEEN '25' AND '29'";
  $dressDisplay=" and modelDressSize ".$rangeDress." ";
}
  else
if ($dSize=="dressG")
{

  $rangeDress=">30";
  $dressDisplay=" and modelDressSize ".$rangeDress." ";
}
  else
{

  $rangeDress=" ";
  $dressDisplay=" ".$rangeDress." ";
} 

//============end of range of dress ==============

$race=str_replace("'","''",$_POST["txtRace"]);
//============use for search recordset paging================

if (strlen($_GET["race"])!=0)
{

  $race=$_GET["race"];
} 

//===========================================================

if ($race!="")
{

  $raceDisplay=" and modelRace like '".$race."%' ";
}
  else
{

  $raceDisplay=" ";
} 

//============calculate range of hips=============

$hips=str_replace("'","''",$_POST["txtHips"]);
//============use for search recordset paging================

if (strlen($_GET["hips"])!=0)
{

  $hips=$_GET["hips"];
} 

//===========================================================

//hips = request.QueryString("hips")

if ($hips=="hipsA")
{

  $hipsRange="BETWEEN '25' AND '29'";
  $hipsDisplay=" and modelHips ".$hipsRange." ";
}
  else
if ($hips=="hipsB")
{

  $hipsRange="BETWEEN '30' AND '34'";
  $hipsDisplay=" and modelHips ".$hipsRange." ";
}
  else
if ($hips=="hipsC")
{

  $hipsRange="BETWEEN '35' AND '39'";
  $hipsDisplay=" and modelHips ".$hipsRange." ";
}
  else
if ($hips=="hipsD")
{

  $hipsRange="BETWEEN '40' AND '44'";
  $hipsDisplay=" and modelHips ".$hipsRange." ";
}
  else
if ($hips=="hipsE")
{

  $hipsRange="BETWEEN '45' AND '49'";
  $hipsDisplay=" and modelHips ".$hipsRange." ";
}
  else
if ($hips=="hipsF")
{

  $hipsRange="> '50'";
  $hipsDisplay=" and modelHips ".$hipsRange." ";
}
  else
{

  $hipsRange=" ";
  $hipsDisplay=" ".$hipsRange." ";
} 

//============end of hips calculation=============

//============calculate range of shoes============

$sSize=str_replace("'","''",$_POST["txtShoe"]);
//============use for search recordset paging================

if (strlen($_GET["sSize"])!=0)
{

  $sSize=$_GET["sSize"];
} 

//===========================================================

if ($sSize=="shoeA")
{

  $shoeRange="BETWEEN '0' AND '4'";
  $shoeDisplay=" and modelShoeSize ".$shoeRange." ";
}
  else
if ($sSize=="shoeB")
{

  $shoeRange="BETWEEN '5' AND '9'";
  $shoeDisplay=" and modelShoeSize ".$shoeRange." ";
}
  else
if ($sSize=="shoeC")
{

  $shoeRange="BETWEEN '10' AND '14'";
  $shoeDisplay=" and modelShoeSize ".$shoeRange." ";
}
  else
if ($sSize=="shoeD")
{

  $shoeRange="BETWEEN '15' AND '19'";
  $shoeDisplay=" and modelShoeSize ".$shoeRange." ";
}
  else
if ($sSize=="shoeE")
{

  $shoeRange=">'20'";
  $shoeDisplay=" and modelShoeSize ".$shoeRange." ";
}
  else
{

  $shoeRange=" ";
  $shoeDisplay=" ".$shoeRange." ";
} 

//============end of calculation==================


$remarks=str_replace("'","''",$_POST["txtRemarks"]);
if ($remarks!="")
{

  $remarksDisplay=" and modelRemarks like '%".$remarks."%' ";
}
  else
{

  $remarksDisplay=" ";
} 


$keyword=str_replace("'","''",$_POST["keyword"]);
$stageName=str_replace("'","''",$_POST["txtStage"]);
if ($stageName!="")
{

  $stageNameDisplay=" and modelName like '%".$stageName."%' ";
}
  else
{

  $stageNameDisplay=" ";
} 

$kategori=str_replace("'","''",$_POST["txtCategory"]);

$abc=substr($kategori,0,12);

if (strlen($_GET["cat"])!=0)
{
  $kategori=$_GET["cat"];
} 
if ($keyword!="")
{
  $SQLstmt=" SELECT * FROM tblModel,tblImages ";
  $SQLstmt=$SQLstmt." WHERE tblModel.modelStatus='Active' ";
  $SQLstmt=$SQLstmt."AND tblImages.imageTypeID = 1 ";
  $SQLstmt=$SQLstmt."AND tblModel.modelName LIKE '%".$keyword."%' ";
  $SQLstmt=$SQLstmt."AND tblModel.modelID = tblImages.modelID ";
  $rs=mysql_query($SQLstmt) or die( "Your search found no matching results");
}
  else
{
  $SQLstmt="Select * from tblModel, tblImages where ";
  $SQLstmt=$SQLstmt."tblModel.modelCategory like '%".$kategori."%' ";
  $SQLstmt=$SQLstmt." ".$stageNameDisplay." ";
  $SQLstmt=$SQLstmt." ".$heightDisplay." ";
  $SQLstmt=$SQLstmt." ".$locationDisplay." ";
  $SQLstmt=$SQLstmt." ".$hairDisplay." ";
  $SQLstmt=$SQLstmt." ".$bustDisplay." ";
  $SQLstmt=$SQLstmt." ".$ageDisplay." ";
  $SQLstmt=$SQLstmt." ".$eyeDisplay." ";
  $SQLstmt=$SQLstmt." ".$waistDisplay." ";
  $SQLstmt=$SQLstmt." ".$dressDisplay." ";
  $SQLstmt=$SQLstmt." ".$raceDisplay." ";
  $SQLstmt=$SQLstmt." ".$hipsDisplay." ";
  $SQLstmt=$SQLstmt." ".$shoeDisplay." ";
  $SQLstmt=$SQLstmt." ".$checkboxDisplay." ";
  $SQLstmt=$SQLstmt." ".$checkbox2Display." ";
  $SQLstmt=$SQLstmt." ".$checkbox3Display." ";
  $SQLstmt=$SQLstmt." ".$checkbox4Display." ";
  $SQLstmt=$SQLstmt." ".$checkbox5Display." ";
  $SQLstmt=$SQLstmt." ".$checkbox6Display." ";
  $SQLstmt=$SQLstmt." ".$checkbox7Display." ";
  $SQLstmt=$SQLstmt." ".$checkbox8Display." ";
  $SQLstmt=$SQLstmt." ".$checkbox9Display." ";
  $SQLstmt=$SQLstmt." ".$checkbox10Display." ";
  $SQLstmt=$SQLstmt."and modelStatus='Active' ";
  $SQLstmt=$SQLstmt."and tblImages.imageTypeID = 1 ";
  $SQLstmt=$SQLstmt."AND tblModel.modelID = tblImages.modelID ";
  $SQLstmt=$SQLstmt."ORDER BY tblModel.modelID DESC ";
  $rs=mysql_query($SQLstmt);
} 

if (mysql_num_rows($rs)==0)
{

  $countData="No results found of selected query"; ?>
				<tr>
					<td colspan="5" class="text9"><br>  <strong>Search Result</strong> </td>
				</tr>
                    <tr>
                        <td class="text" colspan="4">  <?   echo $countData; echo $SQLstmt;echo mysql_num_rows($rs);?></td>
                    </tr>
                    <tr>
                      <td colspan="5" height="4"><hr /></td>
                    </tr>			
<? 
}
  else
{
?><table width="100%" align="center" cellpadding="0" cellspacing="0">
                                            <tr><td class="text9"><br><strong>Search Result</strong></td><td colspan="3" align="right"></td></tr>
                                            <tr> 
                                              <td width="150" class="text"><div align="center"><strong>Thumbnail</strong></div></td>
							              <td width="150" class="text"><strong>Name</strong></td>
                                              <td width="150" class="text"><strong>Age</strong></td>
                                              <td width="150" class="text"><strong>Model 
                                                No</strong></td>
                                              <td width="75"></td>
                                </tr>
							                    <tr>
                      <td colspan="5" height="4"><hr /></td>
                    </tr>

                                            <tr> 
<? 


while ($line = mysql_fetch_array($rs)) {
										  if ($line["modelCategory"] == "Couples") {
											$width = 100; }
											else {
											$width = 100; }
?>
                                              <td class="text"><div align="center"><a href="../models/model.php?modelID=<? echo $line["modelID"]; ?>#"><img src="../cms/models/lineup/<? echo $line["modelID"]; ?>/<? echo $line["imageFile"]; ?>" height="100" width="<? echo $width; ?>" border="0"></a></div></td>
                                              <td width="100" class="text"><?  echo $line["modelName"]; ?></Td>
                                              <td width="100" class="text"><?  echo $line["modelAge"]; ?></Td>
                                              <td width="147" class="text"><?   echo $line["modelNo"]; ?></td>
                                              <td width="78" class="text"><a href="../models/model.php?modelID=<?     echo $line["modelID"]; ?>#">View</a></td>
</tr>
                    <tr>
                      <td colspan="5" height="4"><hr /></td>
                    </tr>
     <? 
}



?> 
</table></td> 
			                        
<? } ?>	 

Link to comment
Share on other sites

changed strlen to isset this got rid of alot of warnings. also changed = to == and == to === this got rid of the rest of the warnings.

 

 

also make sure your concecation is properly escaped i still have my doubts about it. ;)

 

 

if you are not used to doing

 


$variable = mysql_query("INSERT INTO table VALUES('".$GET["something"]."') "; 

 

you can always use curly braces {} to concecate (escape) variables in mysql.

 

 

//================request.form checkboxes============================
<?php 

$checkbox=$_POST["checkbox"];
//==================use for search recordset paging========================
if(isset($_GET["cb1"]))
{

  $checkbox=$_GET["cb1"];
} 

//========================================================================================

if ($checkbox==="1")
{

  $checkboxDisplay=" and tblModel.A_FN =".$checkbox;
}
  else
{

  $checkboxDisplay=" ";
} 


$checkbox2=$_POST["checkbox2"];
//==================use for search recordset paging========================

if(isset($_GET["cb2"]))
{

  $checkbox2=$_GET["cb2"];
} 

//========================================================================================

if ($checkbox2==="1")
{

  $checkbox2Display=" and TS =".$checkbox2;

}
  else
{

  $checkbox2Display=" ";
} 


$checkbox3=$_POST["checkbox3"];
//==================use for search recordset paging========================

if(isset($_GET["cb3"]))
{

  $checkbox3=$_GET["cb3"];
} 

//========================================================================================

if ($checkbox3==="1")
{

  $checkbox3Display=" and CON =".$checkbox3;
}
  else
{

  $checkbox3Display=" ";
} 


$checkbox4=$_POST["checkbox4"];
//==================use for search recordset paging========================

if (isset($_GET["cb4"]))
{

  $checkbox4=$_GET["cb4"];
} 

//========================================================================================

if ($checkbox4==="1")
{

  $checkbox4Display=" and STI =".$checkbox4;
}
  else
{

  $checkbox4Display=" ";
} 


$checkbox5=$_POST["checkbox5"];
//==================use for search recordset paging========================

if (isset($_GET["cb5"]))
{

  $checkbox5=$_GET["cb5"];
} 

//========================================================================================

if ($checkbox5==="1")
{

  $checkbox5Display=" and FA =".$checkbox5;
}
  else
{

  $checkbox5Display=" ";
} 


$checkbox6=$_POST["checkbox6"];
//==================use for search recordset paging========================

if(isset($_GET["cb6"]))
{

  $checkbox6=$_GET["cb6"];
} 

//========================================================================================

if ($checkbox6==="1")
{

  $checkbox6Display=" and VID =".$checkbox6;
}
  else
{

  $checkbox6Display=" ";
} 


$checkbox7=$_POST["checkbox7"];
//==================use for search recordset paging========================

if (isset($_GET["cb7"]))
{

  $checkbox7=$_GET["cb7"];
} 

//========================================================================================

if ($checkbox7==="1")
{

  $checkbox7Display=" and BGS =".$checkbox7;
}
  else
{

  $checkbox7Display=" ";
} 


$checkbox8=$_POST["checkbox8"];
//==================use for search recordset paging========================

if (isset($_GET["cb8"]))
{

  $checkbox8=$_GET["cb8"];
} 

//========================================================================================

if ($checkbox8==="1")
{

  $checkbox8Display=" and GGS =".$checkbox8;
}
  else
{

  $checkbox8Display=" ";
} 


$checkbox9=$_POST["checkbox9"];
//==================use for search recordset paging========================

if (isset($_GET["cb9"]))
{

  $checkbox9=$_GET["cb9"];
} 

//========================================================================================

if ($checkbox9==="1")
{

  $checkbox9Display=" and BGX =".$checkbox9;
}
  else
{

  $checkbox9Display=" ";
} 


$checkbox10=$_POST["checkbox10"];
//==================use for search recordset paging========================

if (isset($_GET["cb10"]))
{

  $checkbox10=$_GET["cb10"];
} 

//========================================================================================

if ($checkbox10==="1")
{

  $checkbox10Display=" and GGX =".$checkbox10;
}
  else
{

  $checkbox10Display=" ";
} 

//================ end of request.form checkboxes================

//================calculate each range of height==================

$height=str_replace("'","''",$_POST["txtHeight"]);
//==================use for search recordset paging========================

if (isset($_GET["height"]))
{

  $height=$_GET["height"];
} 

//========================================================================================

if ($height==="heightA")
{

  $rangeHeight="BETWEEN '4' AND '5'";
  $heightDisplay=" and modelHeight ".$rangeHeight." ";
}
  else
if ($height==="heightB")
{

  $rangeHeight="BETWEEN '5' AND '6'";
  $heightDisplay=" and modelHeight ".$rangeHeight." ";
}
  else
if ($height==="heightC")
{

  $rangeHeight="BETWEEN '6' AND '7'";
  $heightDisplay=" and modelHeight ".$rangeHeight." ";
}
  else
{

  $rangeHeight=" ";
  $heightDisplay=$rangeHeight;
} 

//================end of range calculation===========================

//================calculate modelLocation ===========================

$location=str_replace("'","''",$_POST["txtLocation"]);
//==================use for search recordset paging========================

if (isset($_GET["location"]))
{

  $location=$_GET["location"];
} 

//========================================================================================

if ($location!=="")
{

  $locationDisplay=" and modelLocation like '%".$location."' ";
}
  else
{

  $locationDisplay=" ";
} 


$hair=str_replace("'","''",$_POST["txtHair"]);
//==================use for search recordset paging========================

if (isset($_GET["hair"]))
{

  $hair=$_GET["hair"];
} 

//========================================================================================

if ($hair!=="")
{

  $hairDisplay=" and modelHair like '%".$hair."%' ";
}
  else
{

  $hairDisplay=" ";
} 


//===============calculate each range of bust size =============

$bSize=str_replace("'","''",$_POST["txtBust"]);
//==================use for search recordset paging========================

if (isset($_GET["bSize"]))
{

  $bSize=$_GET["bSize"];
} 

//========================================================================================

if ($bSize==="bustA")
{

  $rangeBust="BETWEEN '20' AND '24'";
  $bustDisplay=" and modelSize ".$rangeBust." ";
}
  else
if ($bSize==="bustB")
{

  $rangeBust="BETWEEN '25' AND '29'";
  $bustDisplay=" and modelSize ".$rangeBust." ";
}
  else
if ($bSize==="bustC")
{

  $rangeBust="BETWEEN '30' AND '34'";
  $bustDisplay=" and modelSize ".$rangeBust." ";
}
  else
if ($bSize==="bustD")
{

  $rangeBust="BETWEEN '35' AND '39'";
  $bustDisplay=" and modelSize ".$rangeBust." ";
}
  else
if ($bSize==="bustE")
{

  $rangeBust="BETWEEN '40' AND '44'";
  $bustDisplay=" and modelSize ".$rangeBust." ";
}
  else
if ($bSize==="bustF")
{

  $rangeBust="BETWEEN '45' AND '49'";
  $bustDisplay=" and modelSize ".$rangeBust." ";
}
  else
if ($bSize==="bustG")
{

  $rangeBust="> '50'";
  $bustDisplay=" and modelSize ".$rangeBust." ";
}
  else
{

  $rangeBust=" ";
  $bustDisplay=$rangeBust;
} 

//===============end of bust size range===============================

//===============calculate each range of ages======================

$age=str_replace("'","''",$_POST["txtAge"]);
//==================use for search recordset paging========================

if(isset($_GET["age"]))
{

  $age=$_GET["age"];
} 

//========================================================================================

if ($age==="ageA")
{

  $rangeAge="BETWEEN '18' AND '24'";
  $ageDisplay=" and modelAge ".$rangeAge." ";
}
  else
if ($age==="ageB")
{

  $rangeAge="BETWEEN '25' AND '29'";
  $ageDisplay=" and modelAge ".$rangeAge." ";
}
  else
if ($age==="ageC")
{

  $rangeAge="BETWEEN '30' AND '34'";
  $ageDisplay=" and modelAge ".$rangeAge." ";
}
  else
if ($age==="ageD")
{

  $rangeAge="BETWEEN '35' AND '39'";
  $ageDisplay=" and modelAge ".$rangeAge." ";
}
  else
if ($age==="ageE")
{

  $rangeAge="BETWEEN '40' AND '44'";
  $ageDisplay=" and modelAge ".$rangeAge." ";
}
  else
if ($age==="ageF")
{

  $rangeAge="BETWEEN '45' AND '49'";
  $ageDisplay=" and modelAge ".$rangeAge." ";
}
  else
if ($age==="ageG")
{

  $rangeAge="BETWEEN '50' AND '54'";
  $ageDisplay=" and modelAge ".$rangeAge." ";
}
  else
if ($age==="ageH")
{

  $rangeAge="BETWEEN '55' AND '59'";
  $ageDisplay=" and modelAge ".$rangeAge." ";
}
  else
if ($age==="ageI")
{

  $rangeAge="> '60'";
  $ageDisplay=" and modelAge ".$rangeAge." ";
}
  else
{

  $rangeAge=" ";
  $ageDisplay=$rangeAge;
} 

//=============end of range of ages============================

$eye=str_replace("'","''",$_POST["txtColour"]);
//==================use for search recordset paging========================
if(isset($_GET["eye"]))
{

  $eye=$_GET["eye"];
} 

//========================================================================================

if ($eye!=="")
{

  $eyeDisplay=" and modelEyeColour like '%".$eye."%' ";
}
  else
{

  $eyeDisplay=" ";
} 


//==================calculate range of waist =====================

$waist=str_replace("'","''",$_POST["txtWaist"]);
//==================use for search recordset paging========================

if(isset($_GET["waist"]))
{

  $waist=$_GET["waist"];
} 

//========================================================================================

if ($waist==="waistA")
{

  $rangeWaist="BETWEEN '20' AND '24'";
  $waistDisplay=" and modelWaist ".$rangeWaist." ";
}
  else
if ($waist==="waistB")
{

  $rangeWaist="BETWEEN '25' AND '29'";
  $waistDisplay=" and modelWaist ".$rangeWaist." ";
}
  else
if ($waist==="waistC")
{

  $rangeWaist="BETWEEN '30' AND '34'";
  $waistDisplay=" and modelWaist ".$rangeWaist." ";
}
  else
if ($waist==="waistD")
{

  $rangeWaist="BETWEEN '35' AND '39'";
  $waistDisplay=" and modelWaist ".$rangeWaist." ";
}
  else
if ($waist==="waistE")
{

  $rangeWaist="BETWEEN '40' AND '44'";
  $waistDisplay=" and modelWaist ".$rangeWaist." ";
}
  else
if ($waist==="waistF")
{

  $rangeWaist="BETWEEN '45' AND '49'";
  $waistDisplay=" and modelWaist ".$rangeWaist." ";
}
  else
if ($waist==="waistG")
{

  $rangeWaist=">'50'";
  $waistDisplay=" and modelWaist ".$rangeWaist." ";
}
  else
{

  $rangeWaist=" ";
  $waistDisplay=$rangeWaist;
} 

//==================end of range of waist =====================

//==================calculate range of dress ================

$dSize=str_replace("'","''",$_POST["txtDress"]);
//==================use for search recordset paging========================

if(isset($_GET["dSize"]))
{

  $dSize=$_GET["dSize"];
} 

//========================================================================================

if ($dSize==="dressA")
{

  $rangeDress="BETWEEN '0' AND '4'";
  $dressDisplay=" and modelDressSize ".$rangeDress." ";
}
  else
if ($dSize==="dressB")
{

  $rangeDress="BETWEEN '5' AND '9'";
  $dressDisplay=" and modelDressSize ".$rangeDress." ";
}
  else
if ($dSize==="dressC")
{

  $rangeDress="BETWEEN '10' AND '14'";
  $dressDisplay=" and modelDressSize ".$rangeDress." ";
}
  else
if ($dSize==="dressD")
{

  $rangeDress="BETWEEN '15' AND '19'";
  $dressDisplay=" and modelDressSize ".$rangeDress." ";
}
  else
if ($dSize==="dressE")
{

  $rangeDress="BETWEEN '20' AND '24'";
  $dressDisplay=" and modelDressSize ".$rangeDress." ";
}
  else
if ($dSize==="dressF")
{

  $rangeDress="BETWEEN '25' AND '29'";
  $dressDisplay=" and modelDressSize ".$rangeDress." ";
}
  else
if ($dSize==="dressG")
{

  $rangeDress=">30";
  $dressDisplay=" and modelDressSize ".$rangeDress." ";
}
  else
{

  $rangeDress=" ";
  $dressDisplay=" ".$rangeDress." ";
} 

//==================end of range of dress =====================

$race=str_replace("'","''",$_POST["txtRace"]);
//==================use for search recordset paging========================

if(isset($_GET["race"]))
{

  $race=$_GET["race"];
} 

//========================================================================================

if ($race!=="")
{

  $raceDisplay=" and modelRace like '".$race."%' ";
}
  else
{

  $raceDisplay=" ";
} 

//==================calculate range of hips===================

$hips=str_replace("'","''",$_POST["txtHips"]);
//==================use for search recordset paging========================

if (isset($_GET["hips"]))
{

  $hips=$_GET["hips"];
} 

//========================================================================================

//hips = request.QueryString("hips")

if ($hips==="hipsA")
{

  $hipsRange="BETWEEN '25' AND '29'";
  $hipsDisplay=" and modelHips ".$hipsRange." ";
}
  else
if ($hips==="hipsB")
{

  $hipsRange="BETWEEN '30' AND '34'";
  $hipsDisplay=" and modelHips ".$hipsRange." ";
}
  else
if ($hips==="hipsC")
{

  $hipsRange="BETWEEN '35' AND '39'";
  $hipsDisplay=" and modelHips ".$hipsRange." ";
}
  else
if ($hips==="hipsD")
{

  $hipsRange="BETWEEN '40' AND '44'";
  $hipsDisplay=" and modelHips ".$hipsRange." ";
}
  else
if ($hips==="hipsE")
{

  $hipsRange="BETWEEN '45' AND '49'";
  $hipsDisplay=" and modelHips ".$hipsRange." ";
}
  else
if ($hips==="hipsF")
{

  $hipsRange="> '50'";
  $hipsDisplay=" and modelHips ".$hipsRange." ";
}
  else
{

  $hipsRange=" ";
  $hipsDisplay=" ".$hipsRange." ";
} 

//==================end of hips calculation===================

//==================calculate range of shoes==================

$sSize=str_replace("'","''",$_POST["txtShoe"]);
//==================use for search recordset paging========================

if (isset($_GET["sSize"]))
{

  $sSize=$_GET["sSize"];
} 

//========================================================================================

if ($sSize==="shoeA")
{

  $shoeRange="BETWEEN '0' AND '4'";
  $shoeDisplay=" and modelShoeSize ".$shoeRange." ";
}
  else
if ($sSize==="shoeB")
{

  $shoeRange="BETWEEN '5' AND '9'";
  $shoeDisplay=" and modelShoeSize ".$shoeRange." ";
}
  else
if ($sSize==="shoeC")
{

  $shoeRange="BETWEEN '10' AND '14'";
  $shoeDisplay=" and modelShoeSize ".$shoeRange." ";
}
  else
if ($sSize==="shoeD")
{

  $shoeRange="BETWEEN '15' AND '19'";
  $shoeDisplay=" and modelShoeSize ".$shoeRange." ";
}
  else
if ($sSize==="shoeE")
{

  $shoeRange=">'20'";
  $shoeDisplay=" and modelShoeSize ".$shoeRange." ";
}
  else
{

  $shoeRange=" ";
  $shoeDisplay=" ".$shoeRange." ";
} 

//==================end of calculation===========================


$remarks=str_replace("'","''",$_POST["txtRemarks"]);
if ($remarks!=="")
{

  $remarksDisplay=" and modelRemarks like '%".$remarks."%' ";
}
  else
{

  $remarksDisplay=" ";
} 


$keyword=str_replace("'","''",$_POST["keyword"]);
$stageName=str_replace("'","''",$_POST["txtStage"]);
if ($stageName!="")
{

  $stageNameDisplay=" and modelName like '%".$stageName."%' ";
}
  else
{

  $stageNameDisplay=" ";
} 

$kategori=str_replace("'","''",$_POST["txtCategory"]);

$abc=substr($kategori,0,12);

if (isset($GET["cat"]))
{
  $kategori=$_GET["cat"];
} 
if ($keyword!=="")
{
  $SQLstmt=" SELECT * FROM tblModel,tblImages ";
  $SQLstmt=$SQLstmt." WHERE tblModel.modelStatus='Active' ";
  $SQLstmt=$SQLstmt."AND tblImages.imageTypeID = 1 ";
  $SQLstmt=$SQLstmt."AND tblModel.modelName LIKE '%".$keyword."%' ";
  $SQLstmt=$SQLstmt."AND tblModel.modelID = tblImages.modelID ";
  $rs=mysql_query($SQLstmt) or die( "Your search found no matching results");
}
  else
{
  $SQLstmt="Select * from tblModel, tblImages where ";
  $SQLstmt=$SQLstmt."tblModel.modelCategory like '%".$kategori."%' ";
  $SQLstmt=$SQLstmt."'".$stageNameDisplay."'";
  $SQLstmt=$SQLstmt."'".$heightDisplay."'";
  $SQLstmt=$SQLstmt."'".$locationDisplay."'";
  $SQLstmt=$SQLstmt."'".$hairDisplay."'";
  $SQLstmt=$SQLstmt."'".$bustDisplay."'";
  $SQLstmt=$SQLstmt."'".$ageDisplay."'";
  $SQLstmt=$SQLstmt."'".$eyeDisplay."'";
  $SQLstmt=$SQLstmt."'".$waistDisplay."'";
  $SQLstmt=$SQLstmt."'".$dressDisplay."'";
  $SQLstmt=$SQLstmt."'".$raceDisplay."'";
  $SQLstmt=$SQLstmt."'".$hipsDisplay."'";
  $SQLstmt=$SQLstmt."'".$shoeDisplay."'";
  $SQLstmt=$SQLstmt."'".$checkboxDisplay."'";
  $SQLstmt=$SQLstmt."'".$checkbox2Display."'";
  $SQLstmt=$SQLstmt."'".$checkbox3Display."'";
  $SQLstmt=$SQLstmt."'".$checkbox4Display."'";
  $SQLstmt=$SQLstmt."'".$checkbox5Display."'";
  $SQLstmt=$SQLstmt."'".$checkbox6Display."'";
  $SQLstmt=$SQLstmt."'".$checkbox7Display."'";
  $SQLstmt=$SQLstmt."'".$checkbox8Display."'";
  $SQLstmt=$SQLstmt."'".$checkbox9Display."'";
  $SQLstmt=$SQLstmt."'".$checkbox10Display."'";
  $SQLstmt=$SQLstmt."and modelStatus='Active' ";
  $SQLstmt=$SQLstmt."and tblImages.imageTypeID = 1 ";
  $SQLstmt=$SQLstmt."AND tblModel.modelID = tblImages.modelID ";
  $SQLstmt=$SQLstmt."ORDER BY tblModel.modelID DESC ";
  $rs=mysql_query($SQLstmt);
} 

if (!mysql_num_rows($rs)
{

  $countData="No results found of selected query"; ?>
				<tr>
					<td colspan="5" class="text9"><br>  <strong>Search Result</strong> </td>
				</tr>
                    <tr>
                        <td class="text" colspan="4">  <?php   echo $countData; echo $SQLstmt;echo mysql_num_rows($rs);?></td>
                    </tr>
                    <tr>
                      <td colspan="5" height="4"><hr /></td>
                    </tr>			
<?php 
}
  else
{
?><table width="100%" align="center" cellpadding="0" cellspacing="0">
                                            <tr><td class="text9"><br><strong>Search Result</strong></td><td colspan="3" align="right"></td></tr>
                                            <tr> 
                                              <td width="150" class="text"><div align="center"><strong>Thumbnail</strong></div></td>
							              <td width="150" class="text"><strong>Name</strong></td>
                                              <td width="150" class="text"><strong>Age</strong></td>
                                              <td width="150" class="text"><strong>Model 
                                                No</strong></td>
                                              <td width="75"></td>
                                </tr>
							                    <tr>
                      <td colspan="5" height="4"><hr /></td>
                    </tr>

                                            <tr> 
<?php 


while ($line = mysql_fetch_array($rs)) {
										  if ($line["modelCategory"] === "Couples") {
											$width = 100; }
											else {
											$width = 100; }
?>
                                              <td class="text"><div align="center"><a href="../models/model.php?modelID=<?php echo $line["modelID"]; ?>#"><img src="../cms/models/lineup/<?php echo $line["modelID"]; ?>/<? echo $line["imageFile"]; ?>" height="100" width="<?php echo $width; ?>" border="0"></a></div></td>
                                              <td width="100" class="text"><?php  echo $line["modelName"]; ?></Td>
                                              <td width="100" class="text"><?php  echo $line["modelAge"]; ?></Td>
                                              <td width="147" class="text"><?php   echo $line["modelNo"]; ?></td>
                                              <td width="78" class="text"><a href="../models/model.php?modelID=<?php     echo $line["modelID"]; ?>#">View</a></td>
</tr>
                    <tr>
                      <td colspan="5" height="4"><hr /></td>
                    </tr>
     <?php 
}



?> 
</table></td> 
			                        
<?php } ?>	

Link to comment
Share on other sites

took my time editing it so it was almost error free the remaining 8 errors are because the resource (connection) has not been defined in mysql_query and mysql_num_rows

 

 


<?php 

$checkbox= (int) $_POST["checkbox"];
//==================use for search recordset paging========================
if(isset($_GET["cb1"]))
{


  $checkbox= (int) $_GET["cb1"];
} 

//========================================================================================

if ($checkbox==="1")
{

  $checkboxDisplay=" and tblModel.A_FN =".$checkbox;
}
  else
{

  $checkboxDisplay=" ";
} 


$checkbox2= (int) $_POST["checkbox2"];
//==================use for search recordset paging========================

if(isset($_GET["cb2"]))
{
$checkbox2= (int) $_GET["cb2"];

} 

//========================================================================================

if ($checkbox2==="1")
{

  $checkbox2Display=" and TS =".$checkbox2;

}
  else
{

  $checkbox2Display=" ";
} 
$checkbox3= (int) $_POST["checkbox3"];


//==================use for search recordset paging========================

if(isset($_GET["cb3"]))
{

  $checkbox3= (int) $_GET["cb3"];
} 

//========================================================================================

if ($checkbox3==="1")
{

  $checkbox3Display=" and CON =".$checkbox3;
}
  else
{

  $checkbox3Display=" ";
} 


$checkbox4= (int) $_POST["checkbox4"];
//==================use for search recordset paging========================

if (isset($_GET["cb4"]))
{

  $checkbox4= (int) $_GET["cb4"];
} 

//========================================================================================

if ($checkbox4==="1")
{

  $checkbox4Display=" and STI =".$checkbox4;
}
  else
{

  $checkbox4Display=" ";
} 


$checkbox5= (int) $_POST["checkbox5"];
//==================use for search recordset paging========================

if (isset($_GET["cb5"]))
{

  $checkbox5= (int) $_GET["cb5"];
} 

//========================================================================================

if ($checkbox5==="1")
{

  $checkbox5Display=" and FA =".$checkbox5;
}
  else
{

  $checkbox5Display=" ";
} 


$checkbox6= (int) $_POST["checkbox6"];
//==================use for search recordset paging========================

if(isset($_GET["cb6"]))
{

  $checkbox6= (int) $_GET["cb6"];
} 

//========================================================================================

if ($checkbox6==="1")
{

  $checkbox6Display=" and VID =".$checkbox6;
}
  else
{

  $checkbox6Display=" ";
} 


$checkbox7= (int) $_POST["checkbox7"];
//==================use for search recordset paging========================

if (isset($_GET["cb7"]))
{

  $checkbox7= (int) $_GET["cb7"];
} 

//========================================================================================

if ($checkbox7==="1")
{

  $checkbox7Display=" and BGS =".$checkbox7;
}
  else
{

  $checkbox7Display=" ";
} 


$checkbox8= (int) $_POST["checkbox8"];
//==================use for search recordset paging========================

if (isset($_GET["cb8"]))
{

  $checkbox8= (int) $_GET["cb8"];
} 

//========================================================================================

if ($checkbox8==="1")
{

  $checkbox8Display=" and GGS =".$checkbox8;
}
  else
{

  $checkbox8Display=" ";
} 


$checkbox9= (int) $_POST["checkbox9"];
//==================use for search recordset paging========================

if (isset($_GET["cb9"]))
{

  $checkbox9= (int) $_GET["cb9"];
} 

//========================================================================================

if ($checkbox9==="1")
{

  $checkbox9Display=" and BGX =".$checkbox9;
}
  else
{

  $checkbox9Display=" ";
} 


$checkbox10= (int) $_POST["checkbox10"];
//==================use for search recordset paging========================

if (isset($_GET["cb10"]))
{

$checkbox10= (int) $_GET["cb10"];
} 

//========================================================================================

if ($checkbox10==="1")
{

  $checkbox10Display=" and GGX =".$checkbox10;
}
  else
{

  $checkbox10Display=" ";
} 

//================ end of request.form checkboxes================

//================calculate each range of height==================

$height=str_replace("'","''",$_POST["txtHeight"]);
//==================use for search recordset paging========================

if (isset($_GET["height"]))
{

  $height=$_GET["height"];
} 

//========================================================================================

if ($height==="heightA")
{

  $rangeHeight="BETWEEN '4' AND '5'";
  $heightDisplay=" and modelHeight ".$rangeHeight." ";
}
  else
if ($height==="heightB")
{

  $rangeHeight="BETWEEN '5' AND '6'";
  $heightDisplay=" and modelHeight ".$rangeHeight." ";
}
  else
if ($height==="heightC")
{

  $rangeHeight="BETWEEN '6' AND '7'";
  $heightDisplay=" and modelHeight ".$rangeHeight." ";
}
  else
{

  $rangeHeight=" ";
  $heightDisplay=$rangeHeight;
} 

//================end of range calculation===========================

//================calculate modelLocation ===========================

$location=str_replace("'","''",$_POST["txtLocation"]);
//==================use for search recordset paging========================

if (isset($_GET["location"]))
{

  $location=$_GET["location"];
} 

//========================================================================================

if ($location!=="")
{

  $locationDisplay=" and modelLocation like '%".$location."' ";
}
  else
{

  $locationDisplay=" ";
} 


$hair=str_replace("'","''",$_POST["txtHair"]);
//==================use for search recordset paging========================

if (isset($_GET["hair"]))
{

  $hair=$_GET["hair"];
} 

//========================================================================================

if ($hair!=="")
{

  $hairDisplay=" and modelHair like '%".$hair."%' ";
}
  else
{

  $hairDisplay=" ";
} 


//===============calculate each range of bust size =============

$bSize=str_replace("'","''",$_POST["txtBust"]);
//==================use for search recordset paging========================

if (isset($_GET["bSize"]))
{

  $bSize=$_GET["bSize"];
} 

//========================================================================================

if ($bSize==="bustA")
{

  $rangeBust="BETWEEN '20' AND '24'";
  $bustDisplay=" and modelSize ".$rangeBust." ";
}
  else
if ($bSize==="bustB")
{

  $rangeBust="BETWEEN '25' AND '29'";
  $bustDisplay=" and modelSize ".$rangeBust." ";
}
  else
if ($bSize==="bustC")
{

  $rangeBust="BETWEEN '30' AND '34'";
  $bustDisplay=" and modelSize ".$rangeBust." ";
}
  else
if ($bSize==="bustD")
{

  $rangeBust="BETWEEN '35' AND '39'";
  $bustDisplay=" and modelSize ".$rangeBust." ";
}
  else
if ($bSize==="bustE")
{

  $rangeBust="BETWEEN '40' AND '44'";
  $bustDisplay=" and modelSize ".$rangeBust." ";
}
  else
if ($bSize==="bustF")
{

  $rangeBust="BETWEEN '45' AND '49'";
  $bustDisplay=" and modelSize ".$rangeBust." ";
}
  else
if ($bSize==="bustG")
{

  $rangeBust="> '50'";
  $bustDisplay=" and modelSize ".$rangeBust." ";
}
  else
{

  $rangeBust=" ";
  $bustDisplay=$rangeBust;
} 

//===============end of bust size range===============================

//===============calculate each range of ages======================

$age=str_replace("'","''",$_POST["txtAge"]);
//==================use for search recordset paging========================

if(isset($_GET["age"]))
{

  $age= (int) $_GET["age"];
} 

//========================================================================================

if ($age==="ageA")
{

  $rangeAge="BETWEEN '18' AND '24'";
  $ageDisplay=" and modelAge ".$rangeAge." ";
}
  else
if ($age==="ageB")
{

  $rangeAge="BETWEEN '25' AND '29'";
  $ageDisplay=" and modelAge ".$rangeAge." ";
}
  else
if ($age==="ageC")
{

  $rangeAge="BETWEEN '30' AND '34'";
  $ageDisplay=" and modelAge ".$rangeAge." ";
}
  else
if ($age==="ageD")
{

  $rangeAge="BETWEEN '35' AND '39'";
  $ageDisplay=" and modelAge ".$rangeAge." ";
}
  else
if ($age==="ageE")
{

  $rangeAge="BETWEEN '40' AND '44'";
  $ageDisplay=" and modelAge ".$rangeAge." ";
}
  else
if ($age==="ageF")
{

  $rangeAge="BETWEEN '45' AND '49'";
  $ageDisplay=" and modelAge ".$rangeAge." ";
}
  else
if ($age==="ageG")
{

  $rangeAge="BETWEEN '50' AND '54'";
  $ageDisplay=" and modelAge ".$rangeAge." ";
}
  else
if ($age==="ageH")
{

  $rangeAge="BETWEEN '55' AND '59'";
  $ageDisplay=" and modelAge ".$rangeAge." ";
}
  else
if ($age==="ageI")
{

  $rangeAge="> '60'";
  $ageDisplay=" and modelAge ".$rangeAge." ";
}
  else
{

  $rangeAge=" ";
  $ageDisplay=$rangeAge;
} 

//=============end of range of ages============================

$eye=str_replace("'","''",$_POST["txtColour"]);
//==================use for search recordset paging========================
if(isset($_GET["eye"]))
{

  $eye= (string) $_GET["eye"];
} 

//========================================================================================

if ($eye!=="")
{

  $eyeDisplay=" and modelEyeColour like '%".(string)
  $eye."%' ";
}
  else
{

  $eyeDisplay=" ";
} 


//==================calculate range of waist =====================

$waist=str_replace("'","''",$_POST["txtWaist"]);
//==================use for search recordset paging========================

if(isset($_GET["waist"]))
{

  $waist= (string) $_GET["waist"];
} 

//========================================================================================

if ($waist==="waistA")
{

  $rangeWaist="BETWEEN '20' AND '24'";
  $waistDisplay=" and modelWaist ".$rangeWaist." ";
}
  else
if ($waist==="waistB")
{

  $rangeWaist="BETWEEN '25' AND '29'";
  $waistDisplay=" and modelWaist ".$rangeWaist." ";
}
  else
if ($waist==="waistC")
{

  $rangeWaist="BETWEEN '30' AND '34'";
  $waistDisplay=" and modelWaist ".$rangeWaist." ";
}
  else
if ($waist==="waistD")
{

  $rangeWaist="BETWEEN '35' AND '39'";
  $waistDisplay=" and modelWaist ".$rangeWaist." ";
}
  else
if ($waist==="waistE")
{

  $rangeWaist="BETWEEN '40' AND '44'";
  $waistDisplay=" and modelWaist ".$rangeWaist." ";
}
  else
if ($waist==="waistF")
{

  $rangeWaist="BETWEEN '45' AND '49'";
  $waistDisplay=" and modelWaist ".$rangeWaist." ";
}
  else
if ($waist==="waistG")
{

  $rangeWaist=">'50'";
  $waistDisplay=" and modelWaist ".$rangeWaist." ";
}
  else
{

  $rangeWaist=" ";
  $waistDisplay=$rangeWaist;
} 

//==================end of range of waist =====================

//==================calculate range of dress ================

$dSize=str_replace("'","''",$_POST["txtDress"]);
//==================use for search recordset paging========================

if(isset($_GET["dSize"]))
{

  $dSize= (int) $_GET["dSize"];
} 

//========================================================================================

if ($dSize==="dressA")
{

  $rangeDress="BETWEEN '0' AND '4'";
  $dressDisplay=" and modelDressSize ".$rangeDress." ";
}
  else
if ($dSize==="dressB")
{

  $rangeDress="BETWEEN '5' AND '9'";
  $dressDisplay=" and modelDressSize ".$rangeDress." ";
}
  else
if ($dSize==="dressC")
{

  $rangeDress="BETWEEN '10' AND '14'";
  $dressDisplay=" and modelDressSize ".$rangeDress." ";
}
  else
if ($dSize==="dressD")
{

  $rangeDress="BETWEEN '15' AND '19'";
  $dressDisplay=" and modelDressSize ".$rangeDress." ";
}
  else
if ($dSize==="dressE")
{

  $rangeDress="BETWEEN '20' AND '24'";
  $dressDisplay=" and modelDressSize ".$rangeDress." ";
}
  else
if ($dSize==="dressF")
{

  $rangeDress="BETWEEN '25' AND '29'";
  $dressDisplay=" and modelDressSize ".$rangeDress." ";
}
  else
if ($dSize==="dressG")
{

  $rangeDress=">30";
  $dressDisplay=" and modelDressSize ".$rangeDress." ";
}
  else
{

  $rangeDress=" ";
  $dressDisplay=" ".$rangeDress." ";
} 

//==================end of range of dress =====================

$race=str_replace("'","''",(int) $_POST["txtRace"]);
//==================use for search recordset paging========================

if(isset($_GET["race"]))
{

  $race= (int) $_GET["race"];
} 

//========================================================================================

if ($race!=="")
{

$raceDisplay=" and modelRace like '".(string)$race."%'";
}
  else
{

  $raceDisplay=" ";
} 

//==================calculate range of hips===================

$hips=str_replace("'","''",(int) $_POST["txtHips"]);
//==================use for search recordset paging========================

if (isset($_GET["hips"]))
{

  $hips= (string) $_GET["hips"];
} 

//========================================================================================

//hips = request.QueryString("hips")

if ($hips==="hipsA")
{

  $hipsRange="BETWEEN '25' AND '29'";
  $hipsDisplay=" and modelHips ".$hipsRange." ";
}
  else
if ($hips==="hipsB")
{

  $hipsRange="BETWEEN '30' AND '34'";
  $hipsDisplay=" and modelHips ".$hipsRange." ";
}
  else
if ($hips==="hipsC")
{

  $hipsRange="BETWEEN '35' AND '39'";
  $hipsDisplay=" and modelHips ".$hipsRange." ";
}
  else
if ($hips==="hipsD")
{

  $hipsRange="BETWEEN '40' AND '44'";
  $hipsDisplay=" and modelHips ".$hipsRange." ";
}
  else
if ($hips==="hipsE")
{

  $hipsRange="BETWEEN '45' AND '49'";
  $hipsDisplay=" and modelHips ".$hipsRange." ";
}
  else
if ($hips==="hipsF")
{

  $hipsRange="> '50'";
  $hipsDisplay=" and modelHips ".$hipsRange." ";
}
  else
{

  $hipsRange=" ";
  $hipsDisplay=" ".$hipsRange." ";
} 

//==================end of hips calculation===================

//==================calculate range of shoes==================

$sSize=str_replace("'","''",(int) $_POST["txtShoe"]);
//==================use for search recordset paging========================

if (isset($_GET["sSize"]))
{

  $sSize= (int) $_GET["sSize"];
} 

//========================================================================================

if ($sSize==="shoeA")
{

  $shoeRange="BETWEEN '0' AND '4'";
  $shoeDisplay=" and modelShoeSize ".$shoeRange." ";
}
  else
if ($sSize==="shoeB")
{

  $shoeRange="BETWEEN '5' AND '9'";
  $shoeDisplay=" and modelShoeSize ".$shoeRange." ";
}
  else
if ($sSize==="shoeC")
{

  $shoeRange="BETWEEN '10' AND '14'";
  $shoeDisplay=" and modelShoeSize ".$shoeRange." ";
}
  else
if ($sSize==="shoeD")
{

  $shoeRange="BETWEEN '15' AND '19'";
  $shoeDisplay=" and modelShoeSize ".$shoeRange." ";
}
  else
if ($sSize==="shoeE")
{

  $shoeRange=">'20'";
  $shoeDisplay=" and modelShoeSize ".$shoeRange." ";
}
  else
{

  $shoeRange=" ";
  $shoeDisplay=" ".$shoeRange." ";
} 

//==================end of calculation===========================


$remarks=str_replace("'","''",(string)	$_POST["txtRemarks"]);
if ($remarks!=="")
{

  $remarksDisplay=" and modelRemarks like '%".(string)
  $remarks."%' ";
}
  else
{

  $remarksDisplay=" ";
} 


$keyword=str_replace("'","''",(string)	$_POST["keyword"]);
$stageName=str_replace("'","''",(string) $_POST["txtStage"]);
if ($stageName!=="")
{

  $stageNameDisplay=" and modelName like '%".(string)
  $stageName."%' ";
}
  else
{

  $stageNameDisplay=" ";
} 

$kategori=str_replace("'","''",(string)	$_POST["txtCategory"]);

$abc=substr((string)$kategori,0,12);

if (isset($GET["cat"]))
{
  $kategori= (string) $_GET["cat"];
} 
if ($keyword!=="")
{
  $SQLstmt=" SELECT * FROM tblModel,tblImages ";
  $SQLstmt=$SQLstmt." WHERE tblModel.modelStatus='Active' ";
  $SQLstmt=$SQLstmt."AND tblImages.imageTypeID = 1 ";
  $SQLstmt=$SQLstmt."AND tblModel.modelName LIKE '%".(string)
  $keyword."%' ";
  $SQLstmt=$SQLstmt."AND tblModel.modelID = tblImages.modelID ";
  $rs=sprintf($SQLstmt);
  $rs=mysql_query($SQLstmt);
  if($rs===FALSE)
  	  { echo "Your search found no matching results"; }
}
  else
{
  $SQLstmt="Select * from tblModel, tblImages where ";
  $SQLstmt=$SQLstmt."tblModel.modelCategory like '%".(string)$kategori."%' ";
  $SQLstmt=$SQLstmt."'".$stageNameDisplay."'";
  $SQLstmt=$SQLstmt."'".$heightDisplay."'";
  $SQLstmt=$SQLstmt."'".$locationDisplay."'";
  $SQLstmt=$SQLstmt."'".$hairDisplay."'";
  $SQLstmt=$SQLstmt."'".$bustDisplay."'";
  $SQLstmt=$SQLstmt."'".$ageDisplay."'";
  $SQLstmt=$SQLstmt."'".$eyeDisplay."'";
  $SQLstmt=$SQLstmt."'".$waistDisplay."'";
  $SQLstmt=$SQLstmt."'".$dressDisplay."'";
  $SQLstmt=$SQLstmt."'".$raceDisplay."'";
  $SQLstmt=$SQLstmt."'".$hipsDisplay."'";
  $SQLstmt=$SQLstmt."'".$shoeDisplay."'";
  $SQLstmt=$SQLstmt."'".$checkboxDisplay."'";
  $SQLstmt=$SQLstmt."'".$checkbox2Display."'";
  $SQLstmt=$SQLstmt."'".$checkbox3Display."'";
  $SQLstmt=$SQLstmt."'".$checkbox4Display."'";
  $SQLstmt=$SQLstmt."'".$checkbox5Display."'";
  $SQLstmt=$SQLstmt."'".$checkbox6Display."'";
  $SQLstmt=$SQLstmt."'".$checkbox7Display."'";
  $SQLstmt=$SQLstmt."'".$checkbox8Display."'";
  $SQLstmt=$SQLstmt."'".$checkbox9Display."'";
  $SQLstmt=$SQLstmt."'".$checkbox10Display."'";
  $SQLstmt=$SQLstmt."and modelStatus='Active' ";
  $SQLstmt=$SQLstmt."and tblImages.imageTypeID = 1 ";
  $SQLstmt=$SQLstmt."AND tblModel.modelID = tblImages.modelID ";
  $SQLstmt=$SQLstmt."ORDER BY tblModel.modelID DESC ";
    $rs=sprintf($SQLstmt); 
  $rs=mysql_query($SQLstmt);
} 

if (mysql_num_rows($rs) < 1)
{

  $countData="No results found of selected query"; ?>
				<tr>
					<td colspan="5" class="text9"><br>  <strong>Search Result</strong> </td>
				</tr>
                    <tr>
                        <td class="text" colspan="4">  <?php   echo $countData; echo $SQLstmt;echo mysql_num_rows($rs);?></td>
                    </tr>
                    <tr>
                      <td colspan="5" height="4"><hr /></td>
                    </tr>			
<?php 
}
  else
{
?><table width="100%" align="center" cellpadding="0" cellspacing="0">
                                            <tr><td class="text9"><br><strong>Search Result</strong></td><td colspan="3" align="right"></td></tr>
                                            <tr> 
                                              <td width="150" class="text"><div align="center"><strong>Thumbnail</strong></div></td>
							              <td width="150" class="text"><strong>Name</strong></td>
                                              <td width="150" class="text"><strong>Age</strong></td>
                                              <td width="150" class="text"><strong>Model 
                                                No</strong></td>
                                              <td width="75"></td>
                                </tr>
							                    <tr>
                      <td colspan="5" height="4"><hr /></td>
                    </tr>

                                            <tr> 
<?php 


while ($line = mysql_fetch_assoc($rs))
{
										  if ($line["modelCategory"] === "Couples") {
											$width = 100; }
											else {
											$width = 100; }
?>
                                              <td class="text"><div align="center"><a href="../models/model.php?modelID=<?php echo $line["modelID"]; ?>#"><img src="../cms/models/lineup/<?php echo $line["modelID"]; ?>/<?php
                                              echo $line["imageFile"]; ?>" height="100" width="<?php echo $width; ?>" border="0"></a></div></td>
                                              <td width="100" class="text"><?php  echo $line["modelName"]; ?></Td>
                                              <td width="100" class="text"><?php  echo $line["modelAge"]; ?></Td>
                                              <td width="147" class="text"><?php   echo $line["modelNo"]; ?></td>
                                              <td width="78" class="text"><a href="../models/model.php?modelID=<?php     echo $line["modelID"]; ?>#">View</a></td>
</tr>
                    <tr>
                      <td colspan="5" height="4"><hr /></td>
                    </tr>
     <?php 
}



?> 
</table></td> 
			                        
<?php } ?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.