public function actionView($userId)
 {
     Yii::beginProfile('specialist_view');
     $session = Yii::app()->session;
     $specialist = SpecialistProfileApi::getSpecialistDetails($userId);
     if (!$specialist) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     $specialistInfo = UserApi::getUserProfileDetails($specialist->user_id);
     $specialistAddress = DbUtils::getAddress($specialist->city_id);
     $specialistTypes = SpecialistTypeApi::getSpecialistTypeByUserId($specialist->user_id);
     $specialistProjects = SpecialistApi::getSpecialistProjectsByUserId($specialist->user_id);
     $specialistRatingReadOnly = SpecialistRatingApi::isRated($specialist->id, Yii::app()->user->id);
     $specialistRating = SpecialistRatingApi::getRating($specialist->user_id);
     $specialistLocations = UserSpecialistLocationsApi::getLocations($specialist->id);
     $specialistPropertyLocations = "";
     if ($specialistLocations) {
         foreach ($specialistLocations as $specialistLocation) {
             $specialistPropertyLocations[] = DbUtils::getAddress($specialistLocation->city_id);
         }
     }
     if (!$specialistRatingReadOnly) {
         if ($specialist->user_id == Yii::app()->user->id) {
             $specialistRatingReadOnly = true;
         } else {
             $specialistRatingReadOnly = false;
         }
     } else {
         $specialistRatingReadOnly = true;
     }
     $this->render('view', array('specialist' => $specialist, 'specialistInfo' => $specialistInfo, 'specialistAddress' => $specialistAddress, 'specialistTypes' => $specialistTypes, 'specialistProjects' => $specialistProjects, 'specialistRatingReadOnly' => $specialistRatingReadOnly, 'specialistRating' => $specialistRating, 'specialistPropertyLocations' => $specialistPropertyLocations));
     Yii::endProfile('specialist_view');
 }
			<div class="post" style="cursor:pointer;" onClick="location.href='<?php 
        echo Yii::app()->createAbsoluteUrl('/profile/' . $profile->id);
        ?>
'">
            <?php 
        echo '<div class="left">';
        echo '<img src="' . $image . '" width="124" alt="" />';
        $address = DbUtils::getAddress($profile['city_id']);
        echo '<br />
                    
                    </div>
                    <div class="right" style="width:533px;">
                    	<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) {
Beispiel #3
0
 public function renderContent()
 {
     $results = SpecialistTypeApi::getSpecialistTypeByUserId();
     $this->render('specialistsType', array('results' => $results));
 }