OrdaSoft forum
Welcome, Guest
Please Login or Register.    Lost Password?
RealEstateManager component support
Go to bottom Favoured: 0
TOPIC: Modify fields in module search
marcosarantesj (Visitor)
Posts: 0
graphgraph
User Offline
Modify fields in module search 10 Years, 5 Months ago
Karma: 0  
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 .
The administrator has disabled public write access.
marcosarantesj (Visitor)
Posts: 0
graphgraph
User Offline
Re:Modify fields in module search 10 Years, 5 Months ago
Karma: 0  
I resolve the problem. Below the correction. The last code of post only.
Code:


Added SQL code for region and city
Code:

if($listing_region!=""){
        $where[]= " LOWER(b.hregion)='$listing_region'";
    }
if($listing_city!=""){
        $where[]= " LOWER(b.hcity)='$listing_city'";
    }


Now work.
Logged Logged
The administrator has disabled public write access.
vanderhulst (User)
Fresh Boarder
Posts: 6
graphgraph
User Offline Click here to see the profile of this user
Re:Modify fields in module search 10 Years, 3 Months ago
Karma: 1  
Hi there,

I understand that you made a dropdown menu that show's the cities which it will get from the database?
If this is true can you be more specific which files you edit and how?

Hope you can help me out
Logged Logged
The administrator has disabled public write access.
admin (Admin)
Admin
Posts: 7802
graph
User Offline Click here to see the profile of this user
Re:Modify fields in module search 10 Years, 3 Months ago
Karma: 94  
Hello,

I am sorry for edit that you need know PHP, and edit code as proposed "marcosarantesj".

If you not good know PHP - you may do may errors. Because any way you will need recheck all.

And first - always do backup.

Thanks,
Ordasoft team
Logged Logged
The administrator has disabled public write access.
rashadrahimov (User)
Fresh Boarder
Posts: 2
graphgraph
User Offline Click here to see the profile of this user
Re:Modify fields in module search 10 Years, 3 Months ago
Karma: 0  
Hello, I buyed pro search module. But unfortunately pro version also haven't drop down region or city. so what will be at search module without region fields?
Logged Logged
The administrator has disabled public write access.
rashadrahimov (User)
Fresh Boarder
Posts: 2
graphgraph
User Offline Click here to see the profile of this user
Re:Modify fields in module search 10 Years, 3 Months ago
Karma: 0  
MArco can u send to me modified files? if i knew pro version also haven't drop down fields for the region and city i never buyed that module
Logged Logged
The administrator has disabled public write access.
Go to top