1234.00 } function format_number_0dp($str,$decimal_places='0',$decimal_padding="0"){ // --------- PROVIDED BY: jarratt at si-works dot net ------------------- /* firstly format number and shorten any extra decimal places */ /* Note this will round off the number pre-format $str if you dont want this fucntionality */ $str = number_format($str,$decimal_places,'.',''); // will return 12345.67 $number = explode('.',$str); $number[1] = (isset($number[1]))?$number[1]:''; // to fix the PHP Notice error if str does not contain a decimal placing. $decimal = str_pad($number[1],$decimal_places,$decimal_padding); return (float) $number[0]; // example: format_number_2dp('1234'); --> 1234.00 } // ============================================================================= // =============== GRAB URL ADDITIONAL DETAILS =========================== // ============================================================================= $criteria = " WHERE properties.hold=1 "; $content = "default"; // only to be able to run a non-matching query - may later use a default $hiddenfields = ""; // this is for daily weekly select box on the filter if(isset($_GET['regularity']) && $_GET['regularity']>-1){ $criteriadaily = " AND (properties.typeofbooking = ". $_GET['regularity'] . " ) "; $regularity = $_GET['regularity']; if($regularity==0){ $daysel = " SELECTED "; } else{ $weeksel = " SELECTED "; } if(strlen($criteria)>0){ $criteria .= " AND "; } else{ $criteria .= " WHERE "; } $criteria .= "(properties.typeofbooking = $regularity )"; $linktext .= "regularity=$regularity&"; $hiddenfields .= ""; } // EO regularity if(isset($_GET['crewtype']) && $_GET['crewtype']>-1){ if(strlen($search_text)>0){ $search_text .= " and "; } // EO text $crewtype = $_GET['crewtype']; if($crewtype==1){ $search_text .= " bareboat yachts "; $baresel = " SELECTED "; } else{ $search_text .= " crewed yachts "; $crewsel = " SELECTED "; } if(strlen($criteria)>0){ $criteria .= " AND "; } else{ $criteria .= " WHERE "; } $criteriaskipper = " AND (property_extended.b1 = $crewtype ) "; $criteria_array['crewtype'] = $crewtype; $criteria .= "(property_extended.b1 = $crewtype )"; $linktext .="crewtype=$crewtype&"; $hiddenfields .= ""; } // EO new crewtype if(isset($_GET['minpax']) && $_GET['minpax']>-1){ $minpax = $_GET['minpax']; if(strlen($search_text)>0){ $search_text .= " and can carry at least $minpax passengers "; } // EO text if(strlen($criteria)>0){ $criteria .= " AND "; } else{ $criteria .= " WHERE "; } $criteria_array['minpax'] = $minpax; $criteria .= "(property_extended.b10 >= $minpax )"; $linktext .="minpax=$minpax&"; $hiddenfields .= ""; } // EO new crewtype if($_GET['furlingmainsail']==1){ if(strlen($search_text)>0){ $search_text .= " and "; } // EO text if(strlen($criteria)>0){ $criteria .= " AND "; } else{ $criteria .= " WHERE "; } $criteria .= " parcare=1 "; $linktext .= "furlingmainsail=1&"; $search_text .= " with furling mainsail "; } // --amenity if($_GET['entertainment']==1){ if(strlen($search_text)>0){ $search_text .= " and "; } // EO text if(strlen($criteria)>0){ $criteria .= " AND "; } else{ $criteria .= " WHERE "; } $criteria .= " tv=1 "; $linktext .= "entertainment=1&"; $search_text .= " with entertainment system "; } // --amenity if($_GET['waterski']==1){ if(strlen($search_text)>0){ $search_text .= " and "; } // EO text if(strlen($criteria)>0){ $criteria .= " AND "; } else{ $criteria .= " WHERE "; } $criteria .= " masinaspalat=1 "; $linktext .= "waterski=1&"; $search_text .= " with water skis "; } // --amenity if($_GET['events']==1){ if(strlen($search_text)>0){ $search_text .= " and "; } // EO text if(strlen($criteria)>0){ $criteria .= " AND "; } else{ $criteria .= " WHERE "; } $criteria .= " animale=1 "; $linktext .= "events=1&"; $search_text .= " suitable for events & meetings "; } // --amenity if($_GET['internet']==1){ if(strlen($search_text)>0){ $search_text .= " and "; } // EO text if(strlen($criteria)>0){ $criteria .= " AND "; } else{ $criteria .= " WHERE "; } $criteria .= " internet=1 "; $linktext .= "internet=1&"; $search_text .= " with internet "; } // --amenity if($_GET['satphone']==1){ if(strlen($search_text)>0){ $search_text .= " and "; } // EO text if(strlen($criteria)>0){ $criteria .= " AND "; } else{ $criteria .= " WHERE "; } $criteria .= " telefon=1 "; $linktext .= "satphone=1&"; $search_text .= " with satelite telephone "; } // --amenity if($_GET['gps']==1){ if(strlen($search_text)>0){ $search_text .= " and "; } // EO text if(strlen($criteria)>0){ $criteria .= " AND "; } else{ $criteria .= " WHERE "; } $criteria .= " piscina=1 "; $linktext .= "gps=1&"; $search_text .= " with GPS "; } // --amenity if($_GET['manufacturer']>0){ $manufacturer = $_GET['manufacturer']; $ser = mysql_query("SELECT manufacturer FROM boat_manufacturers WHERE manufacturer_id='$manufacturer'"); $res = mysql_fetch_array($ser, MYSQL_ASSOC); $manufacturer_text = $res['manufacturer']; if(strlen($search_text)>0){ $search_text .= " and "; } // EO text if(strlen($criteria)>0){ $criteria .= " AND "; } else{ $criteria .= " WHERE "; } $criteria .= " boat_models.manufacturer_id=$manufacturer "; $linktext .= "manufacturer=$manufacturer&"; $search_text .= " manufacturered by $manufacturer_text "; } // --amenity if($_GET['handicap']==1){ if(strlen($search_text)>0){ $search_text .= " and "; } // EO text if(strlen($criteria)>0){ $criteria .= " AND "; } else{ $criteria .= " WHERE "; } $criteria .= " handicap=1 "; $linktext .= "handicap=1&"; $search_text .= " that is a classic yacht "; } // --amenity if($_GET['autpilot']==1){ if(strlen($search_text)>0){ $search_text .= " and "; } // EO text if(strlen($criteria)>0){ $criteria .= " AND "; } else{ $criteria .= " WHERE "; } $criteria .= " customamenities1=1 "; $linktext .= "autpilot=1&"; $search_text .= " with autopilot "; } // --amenity if($_GET['ssbvhf']==1){ if(strlen($search_text)>0){ $search_text .= " and "; } // EO text if(strlen($criteria)>0){ $criteria .= " AND "; } else{ $criteria .= " WHERE "; } $criteria .= " customamenities2=1 "; $linktext .= "ssbvhf=1&"; $search_text .= " with SSB, VHF "; } // --amenity if($_GET['jetski']==1){ if(strlen($search_text)>0){ $search_text .= " and "; } // EO text if(strlen($criteria)>0){ $criteria .= " AND "; } else{ $criteria .= " WHERE "; } $criteria .= " customamenities3=1 "; $linktext .= "jetski=1&"; $search_text .= " with jetski "; } // --amenity if($_GET['scuba']==1){ if(strlen($search_text)>0){ $search_text .= " and "; } // EO text if(strlen($criteria)>0){ $criteria .= " AND "; } else{ $criteria .= " WHERE "; } $criteria .= " customamenities4=1 "; $linktext .= "scuba=1&"; $search_text .= " with scuba gear "; } // --amenity if($_GET['bbq']==1){ if(strlen($search_text)>0){ $search_text .= " and "; } // EO text if(strlen($criteria)>0){ $criteria .= " AND "; } else{ $criteria .= " WHERE "; } $criteria .= " customamenities5=1 "; $linktext .= "bbq=1&"; $search_text .= " with BBQ "; } // --amenity if($_GET['jacuzzi']==1){ if(strlen($search_text)>0){ $search_text .= " and "; } // EO text if(strlen($criteria)>0){ $criteria .= " AND "; } else{ $criteria .= " WHERE "; } $criteria .= " customamenities6=1 "; $linktext .= "jacuzzi=1&"; $search_text .= " with jacuzzi "; } // --amenity if($_GET['jacuzzi']==1){ if(strlen($search_text)>0){ $search_text .= " and "; } // EO text if(strlen($criteria)>0){ $criteria .= " AND "; } else{ $criteria .= " WHERE "; } $criteria .= " customamenities6=1 "; $linktext .= "jacuzzi=1&"; $search_text .= " with jacuzzi "; } // --amenity if($_GET['snorkel']==1){ if(strlen($search_text)>0){ $search_text .= " and "; } // EO text if(strlen($criteria)>0){ $criteria .= " AND "; } else{ $criteria .= " WHERE "; } $criteria .= " customamenities9=1 "; $linktext .= "snorkel=1&"; $search_text .= " with snorkelling gear "; } // --amenity if($_GET['aircon']==1){ if(strlen($search_text)>0){ $search_text .= " and "; } // EO text if(strlen($criteria)>0){ $criteria .= " AND "; } else{ $criteria .= " WHERE "; } $criteria .= " customamenities10=1 "; $linktext .= "aircon=1&"; $search_text .= " with air conditioning "; } // --amenity if($_GET['sport_fish']==1){ if(strlen($search_text)>0){ $search_text .= " and "; } // EO text if(strlen($criteria)>0){ $criteria .= " AND "; } else{ $criteria .= " WHERE "; } $hiddenfields .= ""; $criteria .= " amenities_fishing=1 "; $linktext .= "sport_fish=1&"; $search_text .= " suitable for sport fishing "; } // --amenity if($_GET['racing']==1){ if(strlen($search_text)>0){ $search_text .= " and "; } // EO text if(strlen($criteria)>0){ $criteria .= " AND "; } else{ $criteria .= " WHERE "; } $criteria .= " racing=1 "; $linktext .= "racing=1&"; $search_text .= " available for racing "; } // --amenity if($_GET['greatvalue']==1){ if(strlen($search_text)>0){ $search_text .= " and "; } // EO text if(strlen($criteria)>0){ $criteria .= " AND "; } else{ $criteria .= " WHERE "; } $criteria .= " customamenities7=1 "; $linktext .= "greatvalue=1&"; $search_text .= " "; } // --amenity if($_GET['sortprice']=='desc'){ $orderstring = "pprice DESC, properties.pprice2 DESC, "; $biaisorder = ""; $descsel = " SELECTED "; } else{ if(isset($_GET['sortprice']) && strlen($_GET['sortprice'])>0){ $biaisorder = ""; $ascsel = " SELECTED "; } else{ $biaisorder .= ", "; } $orderstring = "pprice ASC, properties.pprice2 ASC, "; } if(isset($_GET['luxury'])){ if(strlen($search_text)>0){ $search_text .= " and "; } // EO text $search_text .= " luxury yachts "; if(strlen($criteria)>0){ $criteria .= " AND "; } else{ $criteria .= " WHERE "; } $criteria .= "(properties.luxury ='1')"; $linktext .= "luxury=1&"; $content = "%luxury%"; $hiddenfields .= ""; } // EO model if(isset($_GET['model'])){ $model = $_GET['model']; $model = str_replace('"',"%",$model); $model = str_replace("'","%",$model); if(strlen($search_text)>0){ $search_text .= " and "; } // EO text $search_text .= " model is '$model' "; if(strlen($criteria)>0){ $criteria .= " AND "; } else{ $criteria .= " WHERE "; } $criteria .= "(boat_models.model LIKE '%$model%')"; $linktext .= "model=$model&"; $content = "%$model%"; $hiddenfields .= ""; } // EO model if(isset($_GET['water'])){ $water = $_GET['water']; $water = str_replace('"',"%",$water); $water = str_replace("'","%",$water); $selectedplace = $water; if(strlen($search_text)>0){ $search_text .= " and "; } // EO text $search_text .= " in $water "; if(strlen($criteria)>0){ $criteria .= " AND "; } else{ $criteria .= " WHERE "; } // $criteria .= "(ajt_ports.body_of_water = '$water')"; // $criteria .= "(property_extended2.additional_ports LIKE '%$water%)'"; $linktext .= "water=$water&"; $content = "%$water%"; $hiddenfields .= ""; } // EO port if(isset($_GET['region'])){ $region = $_GET['region']; $region = str_replace('"',"%",$region); $region = str_replace("'","%",$region); if(strlen($search_text)>0){ $search_text .= " and "; } // EO text $search_text .= " in $region "; $selectedplace = $region; if(strlen($criteria)>0){ $criteria .= " AND "; } else{ $criteria .= " WHERE "; } // $criteria .= "(ajt_ports.region = '$region')"; // $criteria .= "(property_extended2.additional_ports LIKE '%$region%)'"; $linktext .= "region=$region&"; $content = "%$region%"; $hiddenfields .= ""; } // EO port if(isset($_GET['country'])){ $country = $_GET['country']; $port = str_replace('"',"%",$country); $country = str_replace("'","%",$country); $selectedplace = $country; if(strlen($search_text)>0){ $search_text .= " and "; } // EO text $search_text .= " in $country "; if(strlen($criteria)>0){ $criteria .= " AND "; } else{ $criteria .= " WHERE "; } // $criteria .= "(ajt_ports.country = '$country')"; // $criteria .= "(property_extended2.additional_ports LIKE '%$country%')"; $linktext .= "country=$country&"; $content = "%$country%"; $hiddenfields .= ""; } // EO port if(isset($_GET['port'])){ $port = $_GET['port']; $port = str_replace('"',"%",$port); $port = str_replace("'","%",$port); if(strlen($search_text)>0){ $search_text .= " and "; } // EO text $search_text .= " in $port "; $selectedplace = $port; if(strlen($criteria)>0){ $criteria .= " AND "; } else{ $criteria .= " WHERE "; } // $criteria .= "(ajt_ports.port = '$port')"; // $criteria .= "(property_extended2.additional_ports LIKE '%$port%')"; $linktext .= "port=$port&"; $content = "%$port%"; $hiddenfields .= ""; } // EO port if(isset($_GET['allwords'])){ $allwords = $_GET['allwords']; $linktext .= "allwords=$allwords&"; $hiddenfields .= ""; } if($_GET['boattype']>-1 || $_GET['overboatttype']>-1){ if(isset($_GET['overboattype'])){ $boattype = $_GET['overboattype']; } else{ $boattype = $_GET['boattype']; } switch($boattype){ case 1: $boattypetext = 'motor yachts'; break; case 2: $boattypetext = 'sail yachts'; break; case 3: $boattypetext = 'catamarans'; break; } if(strlen($search_text)>0){ $search_text .= " and "; } // EO text $search_text .= " $boattypetext "; $criteriaboat_type = " AND (properties.typeofproperties = $boattype ) "; $criteria .= " AND properties.typeofproperties = $boattype "; $linktext .="boattype=$boattype&"; $criteria_array['boattype'] = $boattype; } // EO. if isset if($_GET['overlength']>-1 || $_GET['length']>1){ if($_GET['overlength']>-1){ $length = $_GET['overlength']; $linktext .= "overlength=$overlength&"; $criteria .= " AND properties.sleeps >= $overlength "; $hiddenfields .= ""; } else{ $length = $_GET['length']; $criteria .= " AND properties.sleeps = $length "; $linktext .="overlength=$overlength&"; $hiddenfields .= ""; } if(strlen($search_text)>0){ $search_text .= " and "; } // EO text $search_text .= " more than $length metres "; } // EO. if isset if($_GET['cabins']>-1 || $_GET['overcabins']>-1){ $biaisorder = ""; $orderstring = " (property_extended.b13*1) ASC, "; $cabinscheck = true; if(isset($_GET['overcabins'])){ $cabins = $_GET['overcabins']; } else{ $cabins = $_GET['cabins']; } if($cabins==5){ $criteriacabins = " AND property_extended.b13 >= $cabins "; $criteria .= " AND property_extended.b13 >= $cabins "; } else{ $criteriacabins = " AND property_extended.b13 >= $cabins "; $criteria .= " AND property_extended.b13 >= $cabins "; } if(strlen($search_text)>0){ $search_text .= " and "; } // EO text $search_text .= " yachts with $cabins or more cabins "; $linktext .="cabins=$cabins&"; $criteria_array['cabins'] = $cabins; } if(isset($_GET['chartable'])){ $chartable = $_GET['chartable']; $criteria .= " AND properties.typeofbooking = $chartable"; $linktext .="chartable=$chartable&"; $hiddenfields .= ""; } if(isset($_GET['classic'])){ $classic = $_GET['classic']; $criteria .= " AND properties.handicap = $classic"; $linktext .="chartable=$classic&"; $hiddenfields .= ""; } if(isset($_GET['hot'])){ $hot = $_GET['hot']; $criteria .= " AND properties.customamenities8 = $hot"; $linktext .="hot=$hot&"; $hiddenfields .= ""; } if(isset($_GET['aircon'])){ $aircon = $_GET['aircon']; $criteria .= " AND properties.customamenities10 = $aircon"; $linktext .="aircon=$aircon&"; $hiddenfields .= ""; } if(isset($_GET['jacuzzi'])){ $jacuzzi = $_GET['jacuzzi']; $criteria .= " AND properties.customamenities6 = $jacuzzi"; $linktext .="jacuzzi=$jacuzzi&"; $hiddenfields .= ""; } if(isset($_GET['events'])){ $events = $_GET['events']; $criteria .= " AND properties.animale = $events"; $linktext .="events=$events&"; $hiddenfields .= ""; } if(isset($_GET['locations']) && $_GET['locations']!='All'){ $locations = $_GET['locations']; $locations = str_replace("`","%",$locations); $locations = str_replace('"',"%",$locations); $locations = str_replace('%20'," ",$locations); if(strlen($search_text)>0){ $search_text .= " and "; } // EO text $search_text .= " in $locations"; $locations_header = ucwords(strtolower(": $locations")); $selectedplace = $locations; if(strlen($criteria)>0){ $criteria .= " AND "; } else{ $criteria .= " WHERE "; } $linktext .= "locations=$locations&"; if($locations=="UK"){ $criteria .= " (ajt_ports.port = '$locations' OR ajt_ports.country='$locations' OR regions.region_name = '$locations' OR ajt_ports.body_of_water='$locations' ) "; $criterialocations = " AND regions.region_name='$locations' "; } else{ $criteria .= " (ajt_ports.port LIKE '%$locations%' OR ajt_ports.country LIKE '%$locations%' OR regions.region_name LIKE '%$locations%' OR ajt_ports.body_of_water LIKE '%$locations%' ) "; $criterialocations = " AND regions.region_name LIKE '%$locations%' "; } $criteria_array['locations'] = $locations; $content = "%$locations%"; $biaisorder = "port_bias2 DESC, $biaisorder"; $extrajoins = "LEFT JOIN ajt_boat_ports ON ajt_boat_ports.boat_id = properties.pid LEFT JOIN ajt_ports ON ajt_boat_ports.port_id = ajt_ports.port_id LEFT JOIN regions ON ajt_ports.region_id = regions.region_id"; $maxports = ", MAX( CASE WHEN ajt_ports.port='$locations' THEN ajt_boat_ports.port_bias ELSE 0 END) AS port_bias2 "; if($deep_search==1){ $locations_header = ucwords(strtolower(": $locations")); // ---- build contextual links ----- $test1 = mysql_query("SELECT COUNT(*) AS total FROM properties LEFT JOIN property_extended ON properties.pid =property_extended.id LEFT JOIN property_extended2 ON properties.pid = property_extended2.pid WHERE hold=1 AND additional_ports LIKE '%$locations%' AND typeofproperties=1 AND sleeps>20 AND typeofbooking=1") or die(mysql_error()); $result = mysql_fetch_array($test1, MYSQL_ASSOC); if($result['total'] > 0){ $locations_links1 .= "Motor"; } // EO if super mega motor $test1 = mysql_query("SELECT COUNT(*) AS total FROM properties LEFT JOIN property_extended ON properties.pid =property_extended.id LEFT JOIN property_extended2 ON properties.pid = property_extended2.pid WHERE hold=1 AND additional_ports LIKE '%$locations%' AND typeofproperties=2 AND sleeps>20 AND typeofbooking=1") or die(mysql_error()); $result = mysql_fetch_array($test1, MYSQL_ASSOC); if($result['total'] > 0){ if(strlen($locations_links1)>0){ $locations_links1 .= "  |  "; } $locations_links1 .= "Sail"; } // EO if super mega sail if(strlen($locations_links1)>0){ $locations_links .= "Super and Mega Yachts:   $locations_links1
"; } $test1 = mysql_query("SELECT COUNT(*) AS total FROM properties LEFT JOIN property_extended ON properties.pid =property_extended.id LEFT JOIN property_extended2 ON properties.pid = property_extended2.pid WHERE hold=1 AND additional_ports LIKE '%$locations%' AND typeofproperties=1 AND b1=1") or die(mysql_error()); $result = mysql_fetch_array($test1, MYSQL_ASSOC); if($result['total'] > 0){ $locations_links2 .= "Bareboat"; } // EO if motor bareboat $test1 = mysql_query("SELECT COUNT(*) AS total FROM properties LEFT JOIN property_extended ON properties.pid =property_extended.id LEFT JOIN property_extended2 ON properties.pid = property_extended2.pid WHERE hold=1 AND additional_ports LIKE '%$locations%' AND typeofproperties=1 AND b1=2") or die(mysql_error()); $result = mysql_fetch_array($test1, MYSQL_ASSOC); if($result['total'] > 0){ if(strlen($locations_links2)>0){ $locations_links2 .= "  |  "; } $locations_links2 .= "Crewed"; } // EO if motor crewed if(strlen($locations_links2)>0){ $locations_links .= "Motor Boats:   $locations_links2
"; } $test1 = mysql_query("SELECT COUNT(*) AS total FROM properties LEFT JOIN property_extended ON properties.pid =property_extended.id LEFT JOIN property_extended2 ON properties.pid = property_extended2.pid WHERE hold=1 AND additional_ports LIKE '%$locations%' AND typeofproperties=2 AND b1=1") or die(mysql_error()); $result = mysql_fetch_array($test1, MYSQL_ASSOC); if($result['total'] > 0){ $locations_links3 .= "Bareboat"; } // EO if motor bareboat $test1 = mysql_query("SELECT COUNT(*) AS total FROM properties LEFT JOIN property_extended ON properties.pid =property_extended.id LEFT JOIN property_extended2 ON properties.pid = property_extended2.pid WHERE hold=1 AND additional_ports LIKE '%$locations%' AND typeofproperties=2 AND b1=2") or die(mysql_error()); $result = mysql_fetch_array($test1, MYSQL_ASSOC); if($result['total'] > 0){ if(strlen($locations_links3)>0){ $locations_links3 .= "  |  "; } $locations_links3 .= "Crewed"; } // EO if motor crewed if(strlen($locations_links3)>0){ $locations_links .= "Monohull Sailboats:   $locations_links3
"; } $test1 = mysql_query("SELECT COUNT(*) AS total FROM properties LEFT JOIN property_extended ON properties.pid =property_extended.id LEFT JOIN property_extended2 ON properties.pid = property_extended2.pid WHERE hold=1 AND additional_ports LIKE '%$locations%' AND typeofproperties=3 AND b1=1") or die(mysql_error()); $result = mysql_fetch_array($test1, MYSQL_ASSOC); if($result['total'] > 0){ $locations_links4 .= "Bareboat"; } // EO if motor bareboat $test1 = mysql_query("SELECT COUNT(*) AS total FROM properties LEFT JOIN property_extended ON properties.pid =property_extended.id LEFT JOIN property_extended2 ON properties.pid = property_extended2.pid WHERE hold=1 AND additional_ports LIKE '%$locations%' AND typeofproperties=3 AND b1=2") or die(mysql_error()); $result = mysql_fetch_array($test1, MYSQL_ASSOC); if($result['total'] > 0){ if(strlen($locations_links4)>0){ $locations_links4 .= "  |  "; } $locations_links4 .= "Crewed"; } // EO if motor crewed if(strlen($locations_links4)>0){ $locations_links .= "Catamarans:   $locations_links4
"; } $test1 = mysql_query("SELECT COUNT(*) AS total FROM properties LEFT JOIN property_extended ON properties.pid =property_extended.id LEFT JOIN property_extended2 ON properties.pid = property_extended2.pid WHERE hold=1 AND animale=1 AND additional_ports LIKE '%$locations%' AND typeofproperties=1") or die(mysql_error()); $result = mysql_fetch_array($test1, MYSQL_ASSOC); if($result['total'] > 0){ $locations_links5 .= "Motor"; } // EO if events bareboat $test1 = mysql_query("SELECT COUNT(*) AS total FROM properties LEFT JOIN property_extended ON properties.pid =property_extended.id LEFT JOIN property_extended2 ON properties.pid = property_extended2.pid WHERE hold=1 AND animale=1 AND additional_ports LIKE '%$locations%' AND typeofproperties=2") or die(mysql_error()); $result = mysql_fetch_array($test1, MYSQL_ASSOC); if($result['total'] > 0){ if(strlen($locations_links5)>0){ $locations_links5 .= "  |  "; } $locations_links5 .= "Sail"; } // EO if events crewed if(strlen($locations_links5)>0){ $locations_links .= "Yachts for Special Events:   $locations_links5
"; } if(strlen($locations_links)>0){ $locations_links = "

Sort through the boats below or use these handy links to quickly find the boats that best fit your needs:
$locations_links

"; } } // EO deep_search } // EO. if isset if(isset($_GET['content'])){ $content = $_GET['content']; $linktext .= "content=$content&"; $hiddenfields .= ""; } if(isset($_GET['keywords'])){ $keywords1 = $_GET['keywords']; $quicksearch = $_GET['keywords']; if(strlen($search_text)>0){ $search_text .= " and "; } $search_text .= " keywords containing '". $_GET['keywords'] . "' "; $quicksearch = str_replace('"',"`",$quicksearch); $quicksearch = str_replace("'","`",$quicksearch); $quicksearch = str_replace(","," ",$quicksearch); if(strlen($biaisorder)>0){ $biaisorder ="keysel, $biaisorder"; } else{ $biaisorder = "keysel ASC,"; } $keywords_q = "(CASE WHEN properties.pname LIKE '$keywords1%' THEN -1 WHEN properties.pname LIKE '%$keywords1%' THEN 0 WHEN properties.description LIKE '%$keywords1%' THEN 1 ELSE 2 END) AS keysel,"; $quicksearch = explode(" ",$quicksearch); $content = ""; if($_GET['allwords']=='any'){ $criteria .= " AND (properties.pname = 'ZZZZZZZ' "; // bit of a cheat foreach($quicksearch AS $key => $value){ if(strlen($value)>1){ $content .= "%$value"; $criteria .= " OR properties.pname LIKE '%$value%' "; $criteria .= " OR properties.description LIKE '%$value%' "; $criteria .= " OR property_extended2.additional_ports LIKE '%$value%'"; $criteria .= " OR properties.keywords LIKE '%$value%'"; // $criteria .= " OR properties.pshortdescription LIKE '%$value%' "; // $criteria .= " OR ajt_ports.port LIKE '%$value%' OR ajt_ports.country LIKE '%$value%' "; } // EO. if not = " " } // EO. foreach $content .= "%"; $criteria .= ")"; } // EO check allwords != all else{ foreach($quicksearch AS $key => $value){ if(strlen($value)>1){ $content .= "%$value"; $criteria .= " AND (properties.pname LIKE '%$value%' "; $criteria .= " OR properties.description LIKE '%$value%' "; // $criteria .= " OR properties.pshortdescription LIKE '%$value%' "; // $criteria .= " OR ajt_ports.port LIKE '%$value%' OR ajt_ports.country LIKE '%$value%' "; $criteria .= " OR property_extended2.additional_ports LIKE '%$value%'"; $criteria .= " OR properties.keywords LIKE '%$value%')"; } // EO. if not = " " } // EO. foreach $content .= "%"; $linktext .= "allwords=all&"; } // EO. allwords == 'all' $linktext .= "keywords=$keywords1&"; $quickbox = ""; $hiddenfields .= ""; } // EO. if isset // ============================================================================= // ================= BUILD QUERIES ========================= // ============================================================================= $querybase = " SELECT SQL_CALC_FOUND_ROWS $keywords_q properties.pid, properties.pname, properties.picture, properties.dormitoare AS berths, properties.regiunea AS regiunea, properties.town, properties.typeofproperties, properties.pprice, properties.pprice2, MIN(CASE WHEN ajt_calendar_price.end_date >= NOW() THEN ajt_calendar_price.daily END) AS dailymin, MAX(CASE WHEN ajt_calendar_price.end_date >= NOW() THEN ajt_calendar_price.daily END) AS dailymax, MIN(CASE WHEN ajt_calendar_price.end_date >= NOW() THEN ajt_calendar_price.weekly END) AS weeklymin, MAX(CASE WHEN ajt_calendar_price.end_date >= NOW() THEN ajt_calendar_price.weekly END) AS weeklymax, properties.pprice AS pprice111, properties.pprice2 AS pprice222, properties.typeofbooking AS daily, property_extended2.regionwinter AS winter, property_extended.b5 AS year, property_extended.b13 AS cabins, property_extended.b1 AS crewed, properties.customamenities7, properties.bb_comments, currency.currency AS booking_currency, currency.html_ref AS currency_html_ref, properties.seasonal_prices, properties.low_price, properties.high_price $maxports FROM properties LEFT JOIN currency ON properties.currency_id = currency.id LEFT JOIN property_extended2 ON property_extended2.pid = properties.pid LEFT JOIN property_extended ON property_extended.id = properties.pid LEFT JOIN boat_models ON property_extended.b31 = boat_models.model_id LEFT JOIN ajt_calendar_price ON ajt_calendar_price.pid = properties.pid $extrajoins "; if(isset($_GET['startpos'])){ $startpos = $_GET['startpos']; } else{ $startpos = 0; } if(isset($_GET['endpos'])){ $endpos = $_GET['endpos']; } else{ $endpos = $endpos + 30; } // ============================ RUN QUERIES ================================================== $content_query = mysql_query("SELECT * FROM ajt_content WHERE searchtext = '$content' OR searchtext LIKE '%$content,'"); if(mysql_num_rows($content_query)==0){ $content_query = mysql_query("SELECT * FROM ajt_content WHERE searchtext LIKE '%$content%'"); } $runquery1 = mysql_query("$querybase $criteria GROUP BY properties.pid ORDER BY $biaisorder $orderstring pname ASC LIMIT $startpos,30") or die("$biaisorder $orderstring pname"); if($_GET['showquery']=='true'){ die("$querybase $criteria GROUP BY properties.pid ORDER BY $biaisorder $orderstring pname ASC LIMIT $startpos,30") or die("$biaisorder $orderstring pname"); } $total_num_yachts = mysql_query("SELECT FOUND_ROWS() AS rows_found"); $result = mysql_fetch_array($total_num_yachts, MYSQL_ASSOC); $num_results = $result['rows_found']; if($num_results<30){ $maxfound = $num_results + $startpos; } else{ $maxfound = $startpos + 30; } // ============================ EO RUN QUERIES =============================================== $startpos2 = $startpos + 30; $endpos2 = $endpos + 30; $endpos3 = $endpos - 30; $startpos3 = $startpos - 30; if($startpos2 > $num_results){ $startpos2 = 0; } if($startpos3 < 0){ $startpos3 = 0; } if($num_results-$startpos<30){ $maxpos = $num_results; } else{ $maxpos = $startpos + 30; } if(!preg_match('/locations/',$linktext)){ $linktext .= "locations=All&"; } if($startpos>0){ $back = "<<< Prev 30"; } if($startpos2>0){ $next = "Next 30 >>>"; } if(isset($_GET['query_id'])){ $query_id = $_GET['query_id']; mysql_query("UPDATE ajt_track_search SET num_results = $num_results WHERE search_id=$query_id"); } // ============================================================================= // =================== NULL RESULTS QUERIES ========================== // ============================================================================= function makelink($exception){ $linkers = "function=search"; global $criteria_array; if(sizeof($criteria_array)>0){ foreach($criteria_array AS $key => $value){ if($key!=$exception){ $linkers .= "&$key=$value"; } } // EO foreach } // EO if sizeof return $linkers; } // EO function // ====================== FIND PORT FOR LOCALE ========================================== $ports_query = mysql_query("SELECT port, country, regions.region_name AS region, body_of_water FROM ajt_ports LEFT JOIN regions ON ajt_ports.region_id = regions.region_id WHERE port LIKE '%$locations%' OR regions.region_name LIKE '%$locations%' OR country LIKE '%$locations%' OR body_of_water LIKE '%$locations' "); // ============================================================================= // =================== BUILD DESTINATIONS LIST ========================== // ============================================================================= $query = " SELECT country AS tara, regions.region_name AS regiunea, port AS town FROM ajt_ports LEFT JOIN regions ON ajt_ports.region_id = regions.region_id JOIN ajt_boat_ports ON ajt_ports.port_id = ajt_boat_ports.port_id JOIN properties ON ajt_boat_ports.boat_id = properties.pid WHERE bb_active = 1 AND properties.hold > 0 GROUP BY ajt_ports.port_id ORDER BY country, regions.region_name, port "; $location_query = mysql_query($query); $destinations_drop_down = "\n"; $cabins_drop_down = ""; $price_drop_down = " "; if($boattype>0){ $boattypes[$boattype] = " SELECTED"; } $boat_drop_down = ""; $daily_drop_down = " "; $crew_drop_down = " "; // daily and crew added $currency_drop_down = ""; if(isset($_GET['currency'])){ $currency_link = "¤cy=".strtoupper($_GET['currency']); } // ============================================================================= // ================= HTML OUTPUT ========================= // ============================================================================= // ------------ KEYWORD SETTINGS ------------------------------------ $meta_keywords = "luxury yacht charter, 2007 cricket world cup, cricket cup world, caribbean yacht charter, boatbookings.com, Cricket world cup 2007, ICC, travel, vacations, england cricket, india cricket, yacht broker, private yachts, private megayacht, caribbean cricket, catamaran chartering events, west indies, jamacia, barbados, motor yachts, sailing, cannes film festival, monaco grand prix, america's cup"; $meta_description = "Charter a luxury boat, sail boat or catamaran for the ICC Cricket World Cup 2007 and watch live cricket matches in style. Follow the Cricket World Cup 2007 on a luxury yacht charter. Boatbookings.com can find the perfect boat or yacht for the Cricket World Cup."; $meta_title = $content_html_title; // ------ END OF KEYWORD SETTINGS ------------------------------------ include_once("$default_path/inqludes/header.html"); PRINT<<
$content_display EOT; // ========================== END OF CONTENT ================================== PRINT<<$content_html_title
$content_html_image

$content_html_text

$locations_links

$num_results boats found: Currently displaying $startpos to $maxpos.      $back      $next
$remove_keywords

$hiddenfields EOT; // $daily_drop_down // $crew_drop_down $oldcabins = -1; while($result = mysql_fetch_array($runquery1, MYSQL_ASSOC)){ if($class!="CLASS=darkrow"){ $class="CLASS=darkrow";} else{ $class=""; } // ----- catch variables $pid = $result['pid']; $price = "enter price please"; $crew = $result['crewed']; $pname = $result['pname']; $berths = $result['berths']; $year = $result['year']; $keysel = $result['keysel']; $currency_html_ref = $result['currency_html_ref']; if($year > 1900){ $year = "Year: ".$year; }else{ $year = null; } $cabins = $result['cabins']; if($cabinscheck && $oldcabins != $cabins){ if($cabins==1){ $cabinstext = "Cabin"; } else{ $cabinstext = "Cabins"; } $header_row = << EOT; $oldcabins = $cabins; } else{ $header_row = ""; } $boattype = $result['typeofproperties']; $picture = $result['picture']; $port = $result['town']; $regiunea = $result['regiunea']; $regionlist = $result['regionlist']; $regionlist = str_replace(",",", ",$regionlist); $dailymin = $result['dailymin']; $weeklymin = $result['weeklymin']; $dailymax = $result['dailymax']; $weeklymax = $result['weeklymax']; $bb_comments = $result['bb_comments']; $cur_sym = $currency_html_ref; $booking_currency = strtoupper($result['booking_currency']); if($booking_currency==strtoupper($_GET['currency']) || strlen($_GET['currency'])==0){ $exchange_rate = 1; } else{ $exchange_rate_temp = 1 / $currencies[$booking_currency][1]; $exchange_rate = $exchange_rate_temp * $currencies[strtoupper($_GET['currency'])][1]; $cur_sym = $currencies[strtoupper($_GET['currency'])][0]; $booking_currency = strtoupper($_GET['currency']); } // EO if else if($result['num_ports']>1){ $portlist = str_replace("","$port,",$result['portlist']); $portlist = ""; } else{ $portlist = ""; } switch($crew){ case 1: $crew = "Bareboat"; break; case 2: $crew = "Crewed"; break; default: $crew = "Flexible"; break; } switch($boattype){ case 1: $boattype = "Motor"; break; case 2: $boattype = "Sail"; break; case 3: $boattype = "Catamaran"; break; } // EO switch // ==================== PRICE BUILDER ================== if($result['daily']==0){ $dailyprice = $result['pprice']; $weeklyprice = 0; $perioda = " per day"; if($dailymin>$result['pprice'] || $dailymin==0 || $dailymin == null){ $dailymin = $result['pprice']; } if($dailymax<$result['pprice']){ $dailymax = $result['pprice']; } } else{ $weeklyprice = $result['pprice']; $dailyprice = 0; $perioda = " per week"; if($weeklymin>$result['pprice']){ $weeklymin = $result['pprice']; } if($weeklymax<$result['pprice']){ $weeklymax = $result['pprice']; } } // ---- set prices summary line ------- if(strlen($bb_comments)>0){ $bb_comments = "Boatbookings.com says:".'"'.$bb_comments.'"'."

"; } $prices_line = ""; if($dailymin>0){ $prices_line = "From $cur_sym " . format_number_0dp($dailymin*$exchange_rate); if($dailymax>0 && $dailymax!=$dailymin){ $prices_line .= " to $cur_sym " . format_number_0dp($dailymax*$exchange_rate); } $prices_line .= " per day"; } // EO IF mindaily>0 if($weeklymin>0){ $prices_line = "From $cur_sym " . format_number_0dp($weeklymin*$exchange_rate); if($weeklymax>0 && $weeklymax!=$weeklymin){ $prices_line .= " to $cur_sym " . format_number_0dp($weeklymax*$exchange_rate); } $prices_line .= " per week"; } // EO IF minweekly>0 if(strlen($prices_line)==0){ if($result['pprice']>0){ $prices_line = "From $cur_sym " . format_number_0dp($result['pprice'] * $exchange_rate) . " $perioda"; } else{ $prices_line = "Enquire for prices"; } } if($seasonal_prices==1){ $prices_line = "From $cur_sym " . format_number_0dp($result['low_price'] * $exchange_rate) . " to " . format_number_0dp($result['high_price'] * $exchange_rate) . " $perioda"; } // ================== OUTPUT =================================== $star=""; if($result['customamenities7']==1){ $preferred="Boatbookings.com Preferred $star"; }else{ $preferred=""; } $linktext2 = str_replace('&','0EOF0',$linktext); if( isset($_COOKIE['MyYachts'][$pid]) ){ $favourites_link = "Remove from “My Yachts”"; } // EO if else{ $favourites_link = "Add to “My Yachts”"; } // EO if // ------------- RETURN LINK SESSION VARIABLE ----------------------------- $_SESSION['search']="$linktext"."startpos=$startpos"; $_SESSION['search_text']=$search_text; PRINT<< EOT; } // EO while PRINT<<

$num_results boats found: Currently displaying $startpos to $maxpos.      $back      $next EOT; // ========================================================================================== // ====================== CREATE RESULT ROWS ============================================== // ========================================================================================== PRINT<<

If you cannot find the charter yacht you are looking for or would like more information about chartering, boats or destinations, please contact us. We can organize any charter boat that is available worldwide through our global network of charter representatives and suppliers. Our service is free to you.

Charter Yacht Disclaimer: The yacht specifications, prices, images and availability above are displayed in good faith to help you find the right yacht for your next charter. Although we strive for accuracy, this information is not guaranteed. All information is subject to change without notice and is offered without warranty. A Boatbookings.com yacht charter consultant will confirm each charter and all pricing details during your charter selection process, and there is no formal commitment until a contract is signed by the charterer and the boat owner or operator. Full terms of service can be found here.

We look forward to working with you on your next charter, and welcome all enquiries. Click here for more information about boatbookings.com or here to learn how to use this site

London:
$tel_uk
Cannes:
$tel_charter_hotline
Athens:
$tel_athens
Ft Lauderdale:
$tel_america
Singapore:
$tel_singapore Mauritius:
$tel_mauritius
EOT; include_once("$default_path/inqludes/footer.html"); ?>
Sort: $destinations_drop_down $cabins_drop_down $boat_drop_down $price_drop_down $crew_drop_down

Yachts with $cabins $cabinstext

Also available in: " . str_replace(",",", ", $portlist) . "
$pname
Berths: $berths
Cabins: $cabins
Crew: $crew

Type: $boattype
$year
Details and Reservations $pname
$bb_comments $prices_line $price_links$preferred
$favourites_link