Custom Search

Classified Advertising
?>
Sponsored By
Motorcyclesupermarket.com
 
 
PostCode: Make:
  Model
Price from to
  
".$lprice." and price < ".$hprice." "; if ( $iID <> "All" ) { $query = $query . " and make = '".$iID."' ";} if ( $imodel <> "All" ) { $query = $query . " and model = '".$imodel."' ";} if ( $tppc <> "ZZ" and $pclength == 2) { $query = $query . " and left(trim(postcode),2) = '".$tppc."' "; } if ( $tppc <> "ZZ" and $pclength == 1) { $query = $query . " and ( left(trim(postcode),2) = '".$tppc."0' or left(trim(postcode),2) = '".$tppc."1' or left(trim(postcode),2) = '".$tppc."2' or left(trim(postcode),2) = '".$tppc."3' or left(trim(postcode),2) = '".$tppc."4' or left(trim(postcode),2) = '".$tppc."5' or left(trim(postcode),2) = '".$tppc."6' or left(trim(postcode),2) = '".$tppc."7' or left(trim(postcode),2) = '".$tppc."8' or left(trim(postcode),2) = '".$tppc."9' )"; } //echo $query; //$query = "SELECT COUNT(make) AS numrows FROM newclass_ads WHERE make = '".$iID."' and price > ".$lprice." and price < ".$hprice." " ; $result = mysql_query($query) or die('Error!!!!!!, query failed 1' . mysql_error()); $row = mysql_fetch_array($result, MYSQL_ASSOC); $iRecordcount = $row['numrows']; // echo $iRecordcount; // how many pages we have when using paging? $iPagecount = ceil($iRecordcount/$rowsPerPage); If ($iPage > $iPagecount) { $iPage=$iPagecount ;} $offset = ($iPage - 1) * $rowsPerPage; if ($iPagecount > 1 ) { ?>
1) { $page = $iPage - 1; $prev = " prev "; $first = " first "; } else { $prev = " prev "; // we're on page one, don't enable 'previous' link $first = " first "; // nor 'first page' link } // print 'next' link only if we're not // on the last page if ($iPage < $iPagecount) { $page = $iPage + 1; // $next = " "; $next = " next "; $last = " last "; } else { $next = " next "; // we're on the last page, don't enable 'next' link $last = " last "; // nor 'last page' link } // print the page navigation link echo "" . "
" . $first . $prev . " Showing page $iPage of $iPagecount pages " . $next . $last . "
"; ?>
0 ) { $query = "SELECT * FROM newclass_ads where make = '".$iID."' and model = '".$imodel."' and price > ".$lprice." and price < ".$hprice." and left(trim(postcode),2) = '".$tppc."' order by primkey LIMIT $offset, $rowsPerPage "; $query = "SELECT * FROM newclass_ads WHERE price > ".$lprice." and price < ".$hprice." "; if ( $iID <> "All" ) { $query = $query . " and make = '".$iID."' ";} if ( $imodel <> "All" ) { $query = $query . " and model = '".$imodel."' ";} if ( $tppc <> "ZZ" and $pclength == 2) { $query = $query . " and left(trim(postcode),2) = '".$tppc."' "; } if ( $tppc <> "ZZ" and $pclength == 1) { $query = $query . " and ( left(trim(postcode),2) = '".$tppc."0' or left(trim(postcode),2) = '".$tppc."1' or left(trim(postcode),2) = '".$tppc."2' or left(trim(postcode),2) = '".$tppc."3' or left(trim(postcode),2) = '".$tppc."4' or left(trim(postcode),2) = '".$tppc."5' or left(trim(postcode),2) = '".$tppc."6' or left(trim(postcode),2) = '".$tppc."7' or left(trim(postcode),2) = '".$tppc."8' or left(trim(postcode),2) = '".$tppc."9' )"; } $query = $query . " order by primkey LIMIT $offset, $rowsPerPage "; //echo $query; // $query = "SELECT * FROM newclass_ads where make = '".$iID."' and price > ".$lprice." and price < ".$hprice." order by primkey LIMIT $offset, $rowsPerPage "; $result = mysql_query($query) or die('Error!!!!!!, query failed 2'); while ( $DOC = mysql_fetch_object( $result ) ) { ?> adtype == 10 ){ $adclass = "gold" ;$adclass2 = "goldhead" ;$adclass3 = "goldbody" ;$detbut = "viewadg.gif" ;} if ($DOC->adtype == 5 ){ $adclass = "silver" ; $adclass2 = "silverhead" ;$adclass3 = "bronzebody" ;$detbut = "viewads.gif" ;} echo '
'; ?> '.$DOC->primkey.' '.$DOC->make.' ' .$DOC->model.''; $pricey = $DOC->price; if ( is_null ($DOC->price) ) { $pricey = "N/A" ; } echo '
£'.$pricey.'
'; echo '
'.$DOC->make.' ' .$DOC->model.'
'; $texty = substr ($DOC->comments,0,250); echo $texty; ?>
tp == "T" ) {$tp = "(T)rader";} if ( $DOC->tp == "P" ) {$tp = "(P)rivate";} $upc = $DOC->postcode; ?> weblink == "" ) { echo ''; } else { echo ''; } ?>
logoimg; if ($lggoD != "http://motorcyclesupermarket.com/images/dealerLogos/images/"){ echo ''.$DOC->dealership.''; } ?>
 
View AD




";} if ($iPagecount > 1 ) {?>
1) { $page = $iPage - 1; $prev = " prev "; $first = " first "; $prev = " prev "; $first = " first "; } else { $prev = " prev "; // we're on page one, don't enable 'previous' link $first = " first "; // nor 'first page' link } // print 'next' link only if we're not // on the last page if ($iPage < $iPagecount) { $page = $iPage + 1; // $next = " "; $next = " next "; $last = " last "; $next = " next "; $last = " last "; } else { $next = " next "; // we're on the last page, don't enable 'next' link $last = " last "; // nor 'last page' link } // print the page navigation link echo "" . "
" . $first . $prev . " Showing page $iPage of $iPagecount pages " . $next . $last . "
"; ?>