Esempio n. 1
0
             	<h1><a href="#">' . $profile['company_name'] . '</a></h1>
                 <h4>Office Address : <span>' . $profile['address_line1'] . ', ' . $profile['address_line2'] . ', ' . $address['city'] . ', ' . $address['state'] . ', ' . $address['country'] . '</span> </h4>';
 if ($user_type == "specialist") {
     $specialists = SpecialistTypeApi::getSpecialistTypeByUserId($user->id);
     if ($specialists) {
         $types = null;
         foreach ($specialists as $i => $specialist) {
             if ($i != 0) {
                 $types .= ', ';
             }
             $types .= $specialist->specialist;
         }
         echo '<h4>Specialist in : <span>' . $types . '</span> </h4>';
     }
 } else {
     $properties = PropertyApi::getPropertyTypesByUserId($user->id);
     if ($properties) {
         $types = null;
         foreach ($properties as $i => $property) {
             if ($i != 0) {
                 $types .= ', ';
             }
             $types .= PropertyTypesApi::getPropertyTypeById($property->property_type_id);
         }
         echo '<h4>Dealing in : <span>' . $types . '</span> </h4>';
     } else {
         echo '<h4>Dealing in : <span>Residential Land</span> </h4>';
     }
 }
 echo '<h4 class="left">Description : </h4>
                 <p class="right">' . substr($profile['company_description'], 0, 150) . ' .....
Esempio n. 2
0
 public function actionView($userId)
 {
     Yii::beginProfile('agent_view');
     $agentRatingReadOnly = false;
     $session = Yii::app()->session;
     $agent = AgentProfileApi::getAgentDetails($userId);
     if (!$agent) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     $agentInfo = UserApi::getUserProfileDetails($agent->user_id);
     $agentAddress = DbUtils::getAddress($agent->city_id);
     $agentPropertyTypeIds = PropertyApi::getPropertyTypesByUserId($agent->user_id);
     $agentPropertyTypes = "";
     if ($agentPropertyTypeIds) {
         foreach ($agentPropertyTypeIds as $agentPropertyTypeId) {
             $agentPropertyTypes[$agentPropertyTypeId->property_type_id] = PropertyTypesApi::getPropertyTypeById($agentPropertyTypeId->property_type_id);
         }
     }
     $agentProperties = PropertyApi::getPropertiesOfUser($agent->user_id, Yii::app()->params['dashboardResultsPerPage']);
     $agentLocations = UserAgentLocationsApi::getLocations($agent->id);
     $agentPropertyLocations = "";
     if ($agentLocations) {
         foreach ($agentLocations as $agentLocation) {
             $agentPropertyLocations[] = DbUtils::getAddress($agentLocation->city_id);
         }
     }
     $agentRatingReadOnly = AgentRatingApi::isRated($agent->id, Yii::app()->user->id);
     $agentRating = AgentRatingApi::getRating($agent->id);
     if (!$agentRatingReadOnly) {
         if ($agent->user_id == Yii::app()->user->id) {
             $agentRatingReadOnly = true;
         } else {
             $agentRatingReadOnly = false;
         }
     } else {
         $agentRatingReadOnly = true;
     }
     $this->render('view', array('agent' => $agent, 'agentInfo' => $agentInfo, 'agentAddress' => $agentAddress, 'agentPropertyTypes' => $agentPropertyTypes, 'agentPropertyLocations' => $agentPropertyLocations, 'agentProperties' => $agentProperties, 'agentRatingReadOnly' => $agentRatingReadOnly, 'agentRating' => $agentRating));
     Yii::endProfile('agent_view');
 }