Beispiel #1
0
 public function actionProfile($id)
 {
     Yii::beginProfile('account_profile');
     $userProfile = UserApi::getUser($id);
     if (!$userProfile) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     $userProfile = UserApi::getUserProfileDetails($id);
     $userAddress = DbUtils::getAddress($userProfile->city_id);
     $userImages = UserPhotosApi::getAllImages($id);
     $agentAddress = "";
     $agentImage = "";
     $agentProfile = AgentProfileApi::getAgentDetails($id);
     if ($agentProfile) {
         $agentAddress = DbUtils::getAddress($agentProfile->city_id);
         $agentImage = AgentProfileApi::getImage($id);
     }
     $builderAddress = "";
     $builderImage = "";
     $builderProfile = BuilderProfileApi::getBuilderDetails($id);
     if ($builderProfile) {
         $builderAddress = DbUtils::getAddress($builderProfile->city_id);
         $builderImage = BuilderProfileApi::getImage($id);
     }
     $specialistAddress = "";
     $specialistImage = "";
     $specialistProfile = SpecialistProfileApi::getSpecialistDetails($id);
     $specialistProjects = "";
     if ($specialistProfile) {
         $specialistAddress = DbUtils::getAddress($specialistProfile->city_id);
         $specialistImage = SpecialistProfileApi::getImage($id);
         $specialistProjects = SpecialistApi::getSpecialistProjects($id);
     }
     $this->render('profile', array('userProfile' => $userProfile, 'userAddress' => $userAddress, 'userImages' => $userImages, 'agentProfile' => $agentProfile, 'agentAddress' => $agentAddress, 'builderProfile' => $builderProfile, 'builderAddress' => $builderAddress, 'specialistProfile' => $specialistProfile, 'specialistAddress' => $specialistAddress, 'specialistProjects' => $specialistProjects, 'agentImage' => $agentImage, 'builderImage' => $builderImage, 'specialistImage' => $specialistImage));
     Yii::endProfile('account_profile');
 }