"; $sql = "select * from property "; $sql .= " inner join location1 on property.location1_id = location1.location1_id"; $sql .= " inner join location2 on property.location2_id = location2.location2_id"; $sql .= " inner join destination on location1.destination_id = destination.destination_id"; //$sql .= " inner join category2 on property.category2_id = category2.category2_id"; $caseSearchA=''; $caseSearchB=''; if(!$p_for) #---- value from quick search { if($property_for == 1) #-- Sale { $sql .= " inner join property_sale on property.property_id = property_sale.property_id"; $sql .= " and property.property_for like '%Sale%'"; $sql .= " and property_sale.sale_type != '' "; $pNameC = "property_sale"; $pfor = "Sale"; $caseSearchA = 'AY'; } #-- End Sale else if($property_for == 1.1) #-- Sale - Resales (inc.top.php) { $sql .= " inner join property_sale on property.property_id = property_sale.property_id"; $sql .= " and property.property_for like '%Sale%'"; $sql .= " and property_sale.sale_type like 'resales' "; $pNameC = "property_sale"; $pfor = "Sale"; $caseSearchA = 'AY'; } #-- END Sale - Resales else if($property_for == 1.2) #-- Sale - Offplan (inc.top.php) { $sql .= " inner join property_sale on property.property_id = property_sale.property_id"; $sql .= " and property.property_for like '%Sale%'"; $sql .= " and property_sale.sale_type like 'offplan' "; $pNameC = "property_sale"; $pfor = "Sale"; $caseSearchA = 'AY'; } #-- End Sale - Offplan else if($property_for == 1.3) #-- Sale - Projects (inc.top.php) { $sql .= " inner join property_sale on property.property_id = property_sale.property_id"; $sql .= " and property.property_for like '%Sale%'"; $sql .= " and property_sale.sale_type like 'projects' "; $pNameC = "property_sale"; $pfor = "Sale"; $caseSearchA = 'AY'; } #-- End Sale - Projects else if($property_for == 2) #--- Holiday Rentals [short term] { $sql .= " and property.property_for like '%Rent%'"; $sql .= " and property.term_type like '%short%'"; $pNameC = "property"; $pfor = "Rent"; $caseSearchA = 'AY'; } #-- End Holiday else if($property_for == 3) #--- Long Term Rental { $sql .= " inner join property_long on property.property_id = property_long.property_id"; $sql .= " and property.property_for like '%Rent%'"; $sql .= " and property.term_type like '%long%'"; $pNameC = "property_long"; $pfor = "Rent"; $caseSearchA = 'AY'; } #-- End Long Term else if($property_for == 4) #--- Special Offers [ Promotions ] { $sql .= " inner join property_spoffer on property.property_id = property_spoffer.property_id"; $sql .= " and property.property_for like '%Promotions%'"; $sql .= " and property.term_type like '%spoffer%'"; $pNameC = "property_spoffer"; $pfor = "Promotions"; $caseSearchA = 'AY'; } #-- End Special Offers else if($property_for == 5) #--- All Rent (inc.top.php) { $sql .= " and property.property_for like '%Rent%'"; $sql .= " and property.term_type != ''"; $pNameC = "property"; $pfor = "Rent"; $caseSearchA = 'AY'; } #--- End All Rent if(isset($prop_category2_id)){$pe=0; foreach($prop_category2_id as $a=>$c2id){ $frmHid .= ""; if($pe>0){ $sql .= " or "; } else { $sql .= " and ( "; } $sql .= " ".$pNameC.".category2_id = '$c2id' "; $pe++; } $sql .= " )"; } $frmHid .= ""; $frmHid .= ""; } #---- End quick search else #---- value from topsearch OR ref sraech fromquick { $frmHid .= ""; switch($p_for) { case "Sale": ### Sale $sql .= " inner join property_sale on property.property_id = property_sale.property_id"; $sql .= " and property.property_for like '%Sale%'"; $sql .= " and property_sale.sale_type != '' "; $pNameC = "property_sale"; $pfor = "Sale"; $caseSearchB = 'BY'; break; case "Rent": ### Rent [ short / long ] $sql .= " and property.property_for like '%Rent%'"; if($rent_type_select=="short"){ //- Short Term Type $sql .= " and property.term_type like '%short%'"; $frmHid .= ""; $pNameC = "property"; } #--- End rent_type_select=="short" else if($rent_type_select=="long"){ //- Long Term Type $sql .= " inner join property_long on property.property_id = property_long.property_id"; $sql .= " and property.term_type like '%long%'"; $frmHid .= ""; $pNameC = "property_long"; } #--- End $rent_type_select=="long" else { #-- if !$rent_type_select => from map.php $sql .= " and ( property.term_type like '%short%'"; $sql .= " or property.term_type like '%long%' )"; } if(isset($r_term)){foreach($r_term as $a=>$i_d){ $frmHid .= ""; }}//- GOTO Holiday price search //- GOTO Long Term price search $pfor = "Rent"; $caseSearchB = 'BY'; break; case "Rent-Short": #-- from map.php $sql .= " and property.property_for like '%Rent%'"; $sql .= " and property.term_type like '%short%'"; $frmHid .= ""; $pNameC = "property"; break; case "Long-Short": #-- from map.php $sql .= " and property.property_for like '%Rent%'"; $sql .= " inner join property_long on property.property_id = property_long.property_id"; $sql .= " and property.term_type like '%long%'"; $frmHid .= ""; $pNameC = "property_long"; break; case "Promotions": ### special offer [ promotions ] $sql .= " inner join property_spoffer on property.property_id = property_spoffer.property_id"; $sql .= " and property.property_for like '%Promotions%'"; if($r_term) { $r=0; while($r < count($r_term)){ $frmHid .= ""; $r++; } if(in_array("spoffer",$r_term)){ $sql .= " and property.term_type like '%spoffer%'"; } } $pNameC = "property_spoffer"; $pfor = "Promotions"; $caseSearchB = 'BY'; break; } #-- End Switch if($p_type){ $sql .= " and ( "; $count_ptype = count($p_type); $c2i=0; while($c2i < $count_ptype) { $frmHid .= ""; if($c2i > 0){ $sql .= " or "; } $sql .= " ".$pNameC.".category2_id = '".$p_type[$c2i]."'"; $c2i++; } $sql .= " )"; } #--- end category2, p_type if($term_type){ $sql .= " and property.term_type like '%".$term_type."%'"; $caseSearchB = 'BY'; } if($loc1){ $sql .= " and ("; $count_loc1 = count($loc1); $L1i=0; $L2i=0; while($L1i < $count_loc1) { if($L1i > 0){ $sql .= " or "; } $loc1_v = $loc1[$L1i]; $sql .= " property.location1_id = '".$loc1_v."'"; $frmHid .= ""; if($loc2[$loc1_v]) { if($loc2[$loc1_v] && (in_array("*",$loc2[$loc1_v]))) { $sql .= " and (property.location2_id != '')"; $frmHid .= ""; } else { $count_loc2 = count($loc2[$loc1_v]); $sql .= " and ("; while($L2i < $count_loc2) { $frmHid .= ""; if($L2i > 0){ $sql .= " or "; } $sql .= " property.location2_id = '".$loc2[$loc1_v][$L2i]."'"; $L2i++; } $sql .= " )"; } } #-- End location2 $L1i++; } $sql .= " )"; $caseSearchB = 'BY'; } #end location1 $frmHid .= ""; } #---- End topsearch ############ if($prop_bed){ if($prop_bed == '*'){ $ql .= " and property.bedroom_search != '0'"; } else{ $sql .= " and property.bedroom_search >= '$prop_bed'"; } $frmHid .= ""; } #-- Destinations, Regions, Locations --# #-- from QuickSearch or [ Advance Search Sale, Rent ] if($alldest == 'yes'){ $sql .= " and destination.destination_id != ''"; $frmHid .= ""; } # All destinations else { ////////////////////////////////////////////////// if(isset($qdest_id)){foreach($qdest_id as $a=>$i_d){$frmHid .= "";}} if(isset($regions)){foreach($regions as $a=>$i_d){$frmHid .= "";}} if(isset($regions_sub)){foreach($regions_sub as $a=>$i_d){$frmHid .= "";}} if(isset($location)){foreach($location as $a=>$i_d){$frmHid .= "";}} if(isset($location_sub)){foreach($location_sub as $a=>$i_d){$frmHid .= "";}} ////////////////////////////////////////////////// if($regions||$qdest_id){ $sql .= " and ( "; if(isset($regions)){ $q_diff = array_diff($qdest_id, $regions); }else{ $q_diff = $qdest_id; } if(isset($q_diff)){ $k=0; if(isset($location)){ $r_diff = array_diff($regions_sub, $location); }else{ $r_diff = $regions_sub; } //for region foreach($q_diff as $index=>$destination_id){ if(isset($r_diff)){ $sqlb = ""; $i=0; foreach($r_diff as $index=>$reg_id){ $LC = get_value(location1,location1_id,destination_id,$reg_id); $location1_id = $reg_id; if($destination_id == $LC){ if(isset($location_sub)){ $sqlc = ""; $ii=0; foreach($location_sub as $index=>$loc_id){ $LC1 = get_value(location2,location2_id,location1_id,$loc_id); if($location1_id == $LC1){ //$dest_n = get_value(location2,location2_id,name,$loc_id); if($ii>0){$sqlc .= " or ";}else{ $sqlc .= " and ("; } $sqlc .= " location2.location2_id = '$loc_id' "; $ii++; } }if($ii>0){$sqlc .= " ) ";} } //$dest_n = get_value(location1,location1_id,name,$reg_id); if($i>0){$sqlb .= " or ";} $sqlb .= " location1.location1_id = '$reg_id' ".$sqlc; if($i<0){$sqlb .= ") ";} $i++; } } } if(isset($location)){ $sqlbb = ""; $w=0; foreach($location as $index=>$regAll){ $LC = get_value(location1,location1_id,destination_id,$regAll); if($destination_id == $LC){ //$dest_n = get_value(location1,location1_id,name,$regAll); if($w>0){ $sqlbb .= " or "; } $sqlbb .= " location1.location1_id = '$regAll' "; $w++; } } } //$dest_n = get_value(destination,destination_id,name,$destination_id); if($k>0){$sqla .= " or ";} if(($sqlbb!="")&&($sqlb!="")){$sqlb = " and ( ".$sqlbb." or ".$sqlb." ) ";} else{$sqlb = " and ( ".$sqlbb." ".$sqlb." ) ";} $sqla .= " destination.destination_id = '$destination_id' ".$sqlb; if($k<0){$sqla .= ")e ";} $k++; } } if(isset($regions)){ $n=0; // All foreach($regions as $index=>$destination_id){ //$dest_n = get_value(destination,destination_id,name,$destination_id); if($n>0){$sqlaa .= " or ";} $sqlaa .= " destination.destination_id = '$destination_id' "; $n++; } } if(($sqlaa!="")&&($sqla!="")){$sql .= $sqlaa." or ".$sqla; }else{$sql .= $sqlaa." ".$sqla;} $sql .= " ) "; } #-- End if if($regions||$qdest_id) } #-- end else if($prop_destination_id!=''){ $sql .= " and destination.destination_id = '$prop_destination_id'"; $frmHid .= ""; } if($prop_region_id!=''){ $sql .= " and location1.location1_id = '$prop_region_id'"; $frmHid .= ""; } #-- END Destinations, Regions, Locations --# #------------------- PRICE SEARCH -----------------------# if($price_buy) #-- Price Search Sale --# { switch($price_buy) { case "*": $sql .= " and property_sale.price_search != ''"; break; case 1: $sql .= " and property_sale.price_search <= '499999'"; break; case 2: $sql .= " and (property_sale.price_search >= '500000' and property_sale.price_search <= '999999')"; break; case 3: $sql .= " and (property_sale.price_search >= '1000000' and property_sale.price_search <= '1999999')"; break; case 4: $sql .= " and property_sale.price_search >= '2000000'"; break; } #-- End switch $frmHid .= ""; } #-- End if price Search if($price_holiday && in_array("short",$r_term)) #-- Price Search Holiday Rentals [short term] --# { switch($price_holiday){ case "*": $sql .= " and property.property_price_search != ''"; break; case 1: $sql .= " and property.property_price_search <= '500'"; break; case 2: $sql .= " and property.property_price_search <= '1000'"; break; case 3: $sql .= " and property.property_price_search <= '1500'"; break; case 4: $sql .= " and property.property_price_search <= '2000'"; break; case 5: $sql .= " and property.property_price_search >= '2001'"; break; } #-- End switch $frmHid .= ""; } #-- End if price Search if($price_long && in_array("long",$r_term))#-- Price Search Long Term Rental --# { switch($price_long){ case "*": $sql .= " and property_long.price_search != ''"; break; case 1: $sql .= " and property_long.price_search <= '999'"; break; case 2: $sql .= " and (property_long.price_search >= '1000' and property_long.price_search <= '1999')"; break; case 3: $sql .= " and (property_long.price_search >= '2000' and property_long.price_search <= '2999')"; break; case 4: $sql .= " and (property_long.price_search >= '3000' and property_long.price_search <= '3999')"; break; case 5: $sql .= " and (property_long.price_search >= '4000' and property_long.price_search <= '4999')"; break; case 6: $sql .= " and property_long.price_search >= '5000'"; break; } #-- End switch $frmHid .= ""; } #-- End if price Search if($price_special && in_array("spoffer",$r_term))#-- Price Search --# { switch($price_special){ case "*": $sql .= " and property_spoffer.price_search != ''"; break; case 1: $sql .= " and property_spoffer.price_search <= '999'"; break; case 2: $sql .= " and (property_spoffer.price_search >= '1000' and property_spoffer.price_search <= '1999')"; break; case 3: $sql .= " and (property_spoffer.price_search >= '2000' and property_spoffer.price_search <= '2999')"; break; case 4: $sql .= " and (property_spoffer.price_search >= '3000' and property_spoffer.price_search <= '3999')"; break; case 5: $sql .= " and (property_spoffer.price_search >= '4000' and property_spoffer.price_search <= '4999')"; break; case 6: $sql .= " and property_spoffer.price_search >= '5000'"; break; } #-- End switch $frmHid .= ""; } #-- End if price Search #------------------- END PRICE SEARCH -----------------------# if($prop_name){ $sql .= " and ( property.property_name like '%$prop_name%' or property.short_desc like '%$prop_name%' )"; $frmHid .= ""; } if($prop_code){ $sql .= " and property.property_show_id like '%$prop_code%'"; $frmHid .= ""; } #- Sort By if($psort_by){ switch($psort_by) { case 1: # Price low to high if($pNameC=="property_sale"){ $sql_order_by = " property_sale.price_search ASC"; } if($pNameC=="property"){ $sql_order_by = " property.property_price_search ASC"; } if($pNameC=="property_long"){ $sql_order_by = " property_long.price_search ASC"; } if($pNameC=="property_spoffer"){ $sql_order_by = " property_spoffer.price_search ASC"; } else { $sql_order_by = " property.property_price_search ASC"; } #-- !$pNameC || $pNameC=="property" break; case 2: # Price high to low if($pNameC=="property_sale"){ $sql_order_by = " property_sale.price_search DESC"; } if($pNameC=="property"){ $sql_order_by = " property.property_price_search DESC"; } if($pNameC=="property_long"){ $sql_order_by = " property_long.price_search DESC"; } if($pNameC=="property_spoffer"){ $sql_order_by = " property_spoffer.price_search DESC"; } else { $sql_order_by = " property.property_price_search DESC"; } #-- !$pNameC || $pNameC=="property" break; case 3: # Location, from a - z $sql_order_by = " location2.name ASC"; break; case 4: # Bedrooms low to high $sql_order_by = " property.bedroom_search ASC"; break; case 5: # Bedrooms high to low $sql_order_by = " property.bedroom_search DESC"; break; case 6: # Ref# number $sql_order_by = " property.property_show_id ASC"; break; case 7: # Property type $sql_order_by = " category2.name ASC"; break; } //$frmHid .= ""; } else { $sql_order_by = " property.bedroom_search asc"; //$sql_order_by = " property.property_price_search asc, property.bedroom_search asc"; } $sql .= " and property.property_status = 'Available' "; $linkp = ""; $frmHid .= ""; $frmHid .= ""; echo $frmHid; $sql .= " order by ".$sql_order_by; $results = mysql_db_query($database_connection,$sql); $result = $perpage; $numrows = mysql_num_rows($results); $numpage = $numrows/$result; if (!$paper || $paper == 1) { $start = 1; $paper = 1; } else { $start = (($paper-1)*$result)+1; $result = $result * $paper; } if ($numrows != 0) { $show_page .= "Pages : "; } for ($i=1;$i<$numpage+1;$i++) { if ($paper == $i) { $SELpage .= ""; // $linkpage = "$i"; } else { $SELpage .= ""; // $linkpage = "$i"; } $show_page .= $linkpage; $show_page .= " "; } if ($paper==$i-1) { $result = $numrows; } if ($numrows > 0) { $ofpage = $i-1; $show_row = "Data Found : $numrows"; ?>
Sort by : Pages : of
Currency : view rate
when ref search, no pfor $term_type = ""; #_| if($pNameC=="property_sale"){ $p_for = "Sale"; $pfor = "Sale"; } if($pNameC=="property"){ $p_for = "Rent"; $pfor = "Rent"; $term_type = "short"; } if($pNameC=="property_long"){ $p_for = "Rent"; $pfor = "Rent"; $term_type = "long"; } if($pNameC=="property_spoffer"){ $p_for = "Promotions"; $pfor = "Promotions"; } //- For Box Term Type $bxTerm1=""; $bxTerm2=""; $bxTerm3=""; $bxTerm4=""; $tmp_no_pfor = ""; //- for when no pfor $tmp_no_termtype = ""; //- for when no pfor==rent $tmp_bx_pfor = " ".$row[property_for]; $tmp_bx_termtype = " ".$row[term_type]; $pos1 = strpos($tmp_bx_pfor, "Sale"); $pos2 = strpos($tmp_bx_pfor, "Rent"); $pos2_1 = strpos($tmp_bx_termtype, "short"); $pos2_2 = strpos($tmp_bx_termtype, "long"); $pos4 = strpos($tmp_bx_pfor, "Promotions"); if($pos1==true){$bxTerm1 = "sale"; $tmp_no_pfor="Sale";} //- for check the Sale term type [sale] if($pos4==true){$bxTerm4 = "offer"; $tmp_no_pfor="Promotions";} //- for check the Special Offer term type [offer] if(($pos2==true)&&($pos2_1==true)){ $bxTerm2 = "short"; $tmp_no_pfor="Rent"; $tmp_no_termtype="short"; } //- for check the Short term type [rent] if(($pos2==true)&&($pos2_2==true)){ $bxTerm3 = "long"; $tmp_no_pfor="Rent"; $tmp_no_termtype="long"; } //- for check the Long term type [rent] #---- for if !pfor || p_for if(!$p_for && !$pfor){ $p_for = $pfor = $tmp_no_pfor; if($tmp_no_pfor=="Rent"){ $term_type = $tmp_no_termtype; } } #--- Prepare For Rent [ Short ] $qshow = $row["quick_show"]; $r_zero = $row[0]; $p_for = $p_for; $term_type = $term_type; $pfor = $pfor; $qsid = $row["property_show_id"]; $qbs = $row["bedroom_search"]; $qqs = $row["quick_sleep"]; $qqp = $row["quick_pool"]; $ql2id = $row["location2_id"]; $ql1id = $row["location1_id"]; $qc2id = $row["category2_id"]; $pph1 = $row["property_p1"]; $ppn = $row["property_name"]; $qof = $row["spoffer_txt"]; $qqbt = $row["quick_bath"]; $show_add = "Y"; $qd_id = $row["destination_id"]; $qqv = $row["quick_view"]; if(($pfor == "Sale")||($p_for == "Sale")){ $qcl = 4; $qch = 4; $qcltxt = get_value(property_sale,property_id,quick_choose_low,$row[0]); $qchtxt = get_value(property_sale,property_id,quick_choose_high,$row[0]); $pr1txt = get_value(property_sale,property_id,quick_low,$row[0]); $pr2txt = get_value(property_sale,property_id,quick_high,$row[0]); $psd = get_value(property_sale,property_id,short_desc,$row[0]); $qaof = get_value(property_sale,property_id,all_offer_txt,$row[0]); $qc2id = get_value(property_sale,property_id,category2_id,$row[0]); } if(($pfor == "Promotions")||($p_for == "Promotions")){ $qcl = 4; $qch = 4; $qcltxt = get_value(property_spoffer,property_id,quick_choose_low,$row[0]); $qchtxt = get_value(property_spoffer,property_id,quick_choose_high,$row[0]); $pr1txt = get_value(property_spoffer,property_id,quick_low,$row[0]); $pr2txt = get_value(property_spoffer,property_id,quick_high,$row[0]); $psd = get_value(property_spoffer,property_id,short_desc,$row[0]); $qaof = get_value(property_spoffer,property_id,all_offer_txt,$row[0]); $qc2id = get_value(property_spoffer,property_id,category2_id,$row[0]); } if(($pfor == "Rent")||($p_for == "Rent")){ if($term_type == "long"){ $qcl = 4; $qch = 4; $qcltxt = get_value(property_long,property_id,quick_choose_low,$row[0]); $qchtxt = get_value(property_long,property_id,quick_choose_high,$row[0]); $pr1txt = get_value(property_long,property_id,quick_low,$row[0]); $pr2txt = get_value(property_long,property_id,quick_high,$row[0]); $psd = get_value(property_long,property_id,short_desc,$row[0]); $qaof = get_value(property_long,property_id,all_offer_txt,$row[0]); $qc2id = get_value(property_long,property_id,category2_id,$row[0]); } else if($term_type == "short"){ $qcl = $row["quick_choose_low"]; $qch = $row["quick_choose_high"]; $qdl = $row["quick_daily_low"]; $qdh = $row["quick_daily_high"]; $qml = $row["quick_monthly_low"]; $qmh = $row["quick_monthly_high"]; $qon = $row["quick_ownership"]; $qps = $row["property_price_search"]; $qaof = $row["all_offer_txt"]; $psd = $row["short_desc"]; } } ?>
Data Not Found!

Pages : of