Sunday, 25 June 2017

73.group

  1 2
    4 3
    1 2
    ans
    1 2
    4 3
         $countPropertyRequirementVillaData  = count($propertyRequirementVillaData);

   $roomappartmenthouselocationselect = $propertyRequirementTable->select()
                    ->setIntegrityCheck(false)
                    ->from(array('property_req'=>'engine4_property_requirement',))
                    ->joinLeft(array('state'=>'engine4_state_list',),'state.state_id=property_req.state_id',array('state'))                                
                    ->joinLeft(array('city'=>'engine4_city_list',),'city.city_id=property_req.city_id',array('city'))
                    ->where('property_req.tenant_id = ?', $data['user_id'])
                    ->where('(property_req.housing_type = ?', 'House' )
->orWhere('property_req.housing_type = ?', 'Apartment')
->orWhere('property_req.housing_type = ?)', 'Room')
->group(array('city.city_id'))
;

72.count in select query

$select   =   $table->select()
                        ->setIntegrityCheck(false)
                        ->from(array('user'=>'engine4_users',))
                        ->columns(array('count_property' => new Zend_Db_Expr('COUNT(user.user_id)')))                      
                        ->joinLeft(array('search_field'=>'engine4_user_fields_search'),'search_field.item_id=user.user_id',null)                                            
                        ->joinLeft(array('plist'=>'engine4_property_list',),'plist.property_owner_id=user.user_id')                                
                        ->where('user.search=?' , 1)
                        ->where('search_field.profile_type =?' , '4')
                        ->group('user.user_id');

71.in array

eg.1
if(in_array($data['user_id'],$user_ids)){

}
eg.2
$array = array('kitchen', 'bedroom', 'living_room', 'dining_room');

if (in_array('kitchen', $array)) {
    echo 'this array contains kitchen';
}

eg3
<?php
$people = array("Peter", "Joe", "Glenn", "Cleveland");

if (in_array("Glenn", $people))
  {
  echo "Match found";
  }
else
  {
  echo "Match not found";
  }
?>

70.array push

eg.
<?php $locationofroom=[];
if(!empty($propertyRequirementVillaData))
{
foreach ($propertyRequirementVillaData as $row)
{
$Roomtotalbhk = $Roomtotalbhk.$row['no_of_rooms'].'BHK'.',';
$Roomlocation=$Roomlocation.$row['state'].','.$row['city'].',';
if(!in_array($Roomlocation,$locationofroom)){
array_push($locationofroom,$Roomlocation);
   }
}
    }
   
   
    ?>

69.social engine for loop

    <?php
     for($i=0;$i<=count($result['Appartmentlocation']);$i++)
     echo $result['Appartmentlocation'][$i];
     endforeach;

 ?>

68.pre tag

echo '<pre>'; print_r($tenantResultData); exit;

67.feed pages in social engine

app/modu/activity/widget/feed/intex.tpl
 acticity/views/scripts/_activityText