OrdaSoft forum
Welcome, Guest
Please Login or Register.    Lost Password?
RealEstateManager component support
Go to bottom Favoured: 0
TOPIC: Modify fields in module search
#4195
marcosarantesj (User)
Fresh Boarder
Posts: 2
graphgraph
User Offline Click here to see the profile of this user
Modify fields in module search 5 Years, 7 Months ago Karma: 1  
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; ?>:&nbsp;</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; ?>:&nbsp;</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.
 
Logged Logged  
 
Last Edit: 2012/04/28 20:39 By marcosarantesj.
  The administrator has disabled public write access.
      Topics Author Date
    thread link
Modify fields in module search
marcosarantesj 2012/04/28 20:29
    emo
thread linkthread link Re:Modify fields in module search
marcosarantesj 2012/04/29 14:57
    thread link
thread linkthread linkthread link Re:Modify fields in module search
vanderhulst 2012/06/25 17:13
    thread link
thread linkthread linkthread linkthread link Re:Modify fields in module search
admin 2012/06/26 12:37
    thread link
thread linkthread linkthread link Re:Modify fields in module search
rashadrahimov 2012/06/27 14:02
    thread link
thread linkthread link Re:Modify fields in module search
rashadrahimov 2012/06/27 13:52
Go to top
What are you looking for?
Anti-spam question: How many eyes has a typical person?