Jump to content

chaosuk

Members
  • Posts

    10
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

chaosuk's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks for that, have made the changes to the site. Now just to work out how to search specifically for modelID which is a client imputed 4 digit number
  2. Figured it was easier posting the file, but here it is as requested <? //===========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> <? } ?>
  3. 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
  4. So as I'm already calling the config info via an include at the top of the page I'm guessing I can edit that row to remove the DB connection class?
  5. Thanks, but not working Getting the following error: Fatal error: Class 'DB' not found in on line 976
  6. Hi guys, using the code below within an admin panel to create a drop down allowing the user to select the profiles they wish to assign to the record they're creating, problem we have is that once a record is created, if they need to edit it for what ever reason the selected profile option isn't sticking. I've played around with lots of variants of if existing_record to try and get it add selected="selected" into the code but failed at every attempt, any advice gratefully received. <?php // List only breeder profiles in the database echo '<select name="profile" class="textinput noborder">'; echo '<option value="any">Any</option>'; $qryGetDistinctProfile = "SELECT * FROM profiles ORDER BY title ASC"; $resGetDistinctProfile = mysql_query($qryGetDistinctProfile,$connection) or die(mysql_error()); if(mysql_num_rows($resGetDistinctProfile) > 0){ $id = mysql_result($resProfile, 0, "id"); while ($row = mysql_fetch_assoc($resGetDistinctProfile)){ echo '<option value="'.$row['id'].'" >'.$row['title'].'</option>'; } } echo '</select>'; ?>
  7. Thanks for the feedback guys. For reference, the manufacturer profile is only being displayed on a single item page that is chosen from an initial category page showing all items within the category. Will try the options suggested and report back
  8. Hi all, I have a number of tables within a mysql database and I'm stuck on how to pull information from one based on the results being displayed by another. The site shows items for sale where by all the product information is held in tablea, when an individual item is being displayed I need to be able to pull a manufacturer profile from tableb based on the manufacturer name stored in tablea column profile. The manufacturer name is already being called into the page by existing code as the site has always shown the manufacturer name, I just can't work out out to pull the new profile information in as well from the new table. Any help appreciated Iain
  9. Thanks for the speedy response. In answer, no, I didn't do all the coding originally, I had someone into do it for me, there's been many changes to the site since that time that I have done however, and whilst I have been able to work out how to do some of things I've wanted as time has gone on, I've also been happy to accept help or advice from those that know far better than I, hence the request for some help.
  10. Hi one and all, have a client site that 2 or 3 times a year, for just a few days, applies a discount to many of the items in their store. The discounts are applied per item and not via a percentage and are simply held in a 'discount' field in the DB, when displayed we show both the orginal price and the new discounted price, all good and no problems. However, what I'd like to be able to do is have it so the client can go through the store, add the discounted prices to the items they choose, and then when done select from a drop down (or check box etc.) to 'show discounts' across the store. I know it's fairly easy to have add a 'show discount' option built into each record and the if/else is no issue on the frontend either, but I'd really like to have it as a one click option, turn on or turn off. Any help appreciated
×
×
  • 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.