I modified the search module 2.2. I changed two fields: Region and City. Checkbox to the list (combo). Here's the code below which is working corretamante. Code below:
Code: |
<?php if($showRegion==0){ ?>
<tr>
<td align="left" nowrap>
<?php echo _REALESTATE_MANAGER_LABEL_REGION; ?>: </td><td align="left"><select name="Region" size="1" style="width: 160px" class="inputbox">
<option value="Todos">Todos</option>
<?php
$cregiao="SELECT DISTINCT hregion FROM #__rem_houses ORDER BY hregion ASC";
$database->setQuery($cregiao);
$regioes=$database->loadResultArray();
foreach($regioes as $regiao){
echo '<option value="$regiao">'.$regiao.'</option>';
}
?>
</select>
<!--<input type="checkbox" name="Region" checked="checked">-->
</td>
</tr>
<?php } elseif($showRegion==1){ ?>
<!--<input type="hidden" name="Region" value="on">-->
<input type="hidden" name="Region" value="">
<?php }?>
<?php if($showCity==0){?>
<tr>
<td align="left" nowrap>
<?php echo _REALESTATE_MANAGER_LABEL_CITY; ?>: </td><td align="left"><select name="City" size="1" style="width: 160px" class="inputbox">
<option value="">Todas</option>
<?php
$ccidade="SELECT DISTINCT hcity FROM #__rem_houses ORDER BY hcity ASC";
$database->setQuery($ccidade);
$cidades=$database->loadResultArray();
foreach($cidades as $cidade){
echo '<option value="$cidade">'.$cidade.'</option>';
}
?>
</select><!--<input type="checkbox" name="City" checked="checked">-->
</td>
</tr>
<?php } elseif($showCity==1){ ?>
<!--<input type="hidden" name="City" value="on">-->
<input type="hidden" name="City" value="">
<?php }?>
|
Now I want to modify in component realestatemanager.php for allow search for modify fields.
In component, I modify here
in line 1175 I commented the lines
Code: |
//if(isset($_REQUEST['Region']) && $_REQUEST['Region']=="on"){
// $Region = " ";
// if($is_add_or) $Region = " or " ;
// $is_add_or = true;
// $Region .= "LOWER(b.hregion) LIKE '$exactly' ";
// }
// if(isset($_REQUEST['City']) && $_REQUEST['City']=="on"){
// $City = " ";
// if($is_add_or) $City = " or " ;
// $is_add_or = true;
// $City .= "LOWER(b.hcity) LIKE '$exactly' ";
// }
|
-> Added variables p / region and city
line 1273 and 1275
->Added Combo for region and city
Code: |
$listing_region=mosGetParam( $_REQUEST,'Region','' );
$listing_city=mosGetParam( $_REQUEST,'City','' );
|
Added SQL code for region and city
Code: |
if($listing_region!=""){
$where[]= " LOWER(b.$listing_region)='$listing_region'";
}
if($listing_city!=""){
$where[]= " LOWER(b.$listing_city)='$listing_city'";
}
|
But don't working. The data comes from database and populate the combo.