public function actionSimilar($id) { Yii::beginProfile('requirements_view'); $session = Yii::app()->session; $requirement = RequirementApi::getRequirementById($id); if (!$requirement) { throw new CHttpException(404, 'The requested page does not exist.'); } $userDetails = UserApi::getUserProfileDetails($requirement->user_id); $data['i_want_to'] = $requirement->i_want_to; $data['min_price'] = $requirement->min_price; $data['max_price'] = $requirement->max_price; $propertytypes = RequirementPropertyTypesApi::getPropertyTypesByRequirementId($requirement->id); $propertytypeids = null; if ($propertytypes) { foreach ($propertytypes as $propertytype) { $propertytypeids[] = $propertytype->property_type_id; } } $data['property_type_id'] = $propertytypeids; $amenity_ids = RequirementAmenitiesApi::getAmenitiesByRequirementId($requirement->id); $amenityids = null; if ($amenity_ids) { foreach ($amenity_ids as $amenity_id) { $amenityids[] = $amenity_id->amenity_id; } } $data['PropertyAmenities'] = $amenityids; $cityids = RequirementCitiesApi::getCitiesByRequirementId($requirement->id); $city = null; if ($cityids) { foreach ($cityids as $cityid) { $city[] = $cityid->city_id; } } $data['city_id'] = $city; $bedrooms = RequirementBedroomsApi::getBedroomsByRequirementId($requirement->id); $beds = null; if ($bedrooms) { foreach ($bedrooms as $bedroom) { $beds[] = $bedroom->bedrooms; } } $data['bedrooms'] = $beds; $criteria = PropertyApi::getCriteriaObjectForRequirement($data); $count = Property::model()->count($criteria); $pages = new CPagination($count); $pages->pageSize = Yii::app()->params['resultsPerPage']; $pages->applyLimit($criteria); $properties = PropertyApi::searchMyPropertyWithCriteria($criteria); $this->render('similar', array('requirement' => $requirement, 'userDetails' => $userDetails, 'properties' => $properties, 'pages' => $pages, 'propertiesCount' => $count)); Yii::endProfile('requirements_view'); }
public function actionUpdate() { $userId = Yii::app()->user->id; $profilesModel = UserApi::getUserProfileDetails($userId); //$credentialsModel=UserApi::getUserCredentials($userId); $this->performAjaxValidation(array($profilesModel)); if (isset($_POST['ajax']) && $_POST['ajax'] === 'update-form') { echo CActiveForm::validate(array($profilesModel)); Yii::app()->end(); } if (isset($_POST['UserProfiles'])) { // save here $profilesModel = UserApi::populateProfilesModel($_POST['UserProfiles'], 'update'); $profResult = $profilesModel->validate(array('first_name', 'last_name', 'gender', 'address_line1', 'address_line2', 'country_id', 'state_id', 'city_id', 'zip', 'mobile', 'telephone', 'agree, verifyCode')); if ($profResult) { $result = true; $models = UserApi::updateUser($profilesModel, $userId); if ($models) { Yii::app()->user->setFlash('success', "Your Account Has been Updated"); $this->redirect('/dashboard'); } } } $this->render('update', array('profilesModel' => $profilesModel)); }
public function actionView($id) { Yii::beginProfile('property_view'); $session = Yii::app()->session; $property = PropertyApi::getPropertyById($id); if (!$property) { throw new CHttpException(404, 'The requested page does not exist.'); } if (!$property->furnished) { $property->furnished = '-'; } if (!$property->floor_number) { $property->floor_number = '-'; } if (!$property->total_floors) { $property->total_floors = '-'; } if (!$property->facing) { $property->facing = '-'; } $recentlyViewed = UserApi::getUserProfileDetails($property->recently_viewed); $propertyAgentInfo = AgentProfileApi::getAgentDetails($property->user_id); $propertyUser = ""; $propertyAgent = ""; $propertyBuilder = ""; $propertyBuilderInfo = ""; $propertySpecialist = ""; $propertySpecialistInfo = ""; $propertyRating = ""; $propertyRating = PropertyRatingApi::getRating($id); if ($propertyAgentInfo) { $propertyAgent = UserApi::getUserProfileDetails($propertyAgentInfo->user_id); } else { $propertyBuilderInfo = BuilderProfileApi::getBuilderDetails($property->user_id); if ($propertyBuilderInfo) { $propertyBuilder = UserApi::getUserProfileDetails($propertyBuilderInfo->user_id); } else { $propertySpecialistInfo = SpecialistProfileApi::getSpecialistDetails($property->user_id); if ($propertySpecialistInfo) { $propertySpecialist = UserApi::getUserProfileDetails($propertySpecialistInfo->user_id); } else { $propertyUser = UserApi::getUser($property->user_id); } } } $propertySimilar = PropertyApi::getSimilarProperties($property, 3, $id); $propertySimilarAddress = ""; $propertySimilarUser = ""; if ($propertySimilar) { foreach ($propertySimilar as $similar) { $propertySimilarAddress[$similar->id] = PropertyApi::getLocation($similar->id); $propertySimilarUser[$similar->id] = UserApi::getUserProfileDetails($similar->user_id); } } $recentlyViewedIds[] = ''; $recentlyViewedIds_total = $session['properties']; if ($recentlyViewedIds_total) { $re_array = array_reverse($recentlyViewedIds_total); $i = 0; foreach ($re_array as $re) { $recentlyViewedIds = $re; $i++; if ($i > 2) { break; } } } $property_ids[] = $recentlyViewedIds; $property_ids[] = $id; $session['properties'] = array_unique($property_ids); $propertyRecentlyViewed = ""; $propertyRecentlyViewedAddress = ""; $propertyRecentlyViewedUser = ""; if ($recentlyViewedIds) { foreach ($recentlyViewedIds as $recent) { $modelProperty = PropertyApi::getPropertyById($recent); if ($modelProperty) { $propertyRecentlyViewed[] = $modelProperty; $propertyRecentlyViewedAddress[] = PropertyApi::getLocation($recent); $propertyRecentlyViewedUser[] = UserApi::getUserProfileDetails($modelProperty->user_id); } } } $propertyImages = PropertyImagesApi::getAllImages($property->id); $propertyType = PropertyTypesApi::getPropertyTypeById($property->property_type_id); $transactionType = PropertyTransactionTypesApi::getTransactionTypeById($property->transaction_type_id); $ownershipType = OwnershipTypesApi::getOwnershipTypeById($property->ownership_type_id); $propertyAge = PropertyAgeOfConstructionApi::getpropertyAgeById($property->age_of_construction); $propertyAmenities = PropertyAmenitiesApi::getAmenitiesForProperty($property->id); $propertyAddress = PropertyApi::getLocation($property->id); $propertyRating = PropertyRatingApi::getRating($property->id); $propertyWishlist = PropertyWishlistApi::getWishlistUserOnProperty($property->id, Yii::app()->user->id); $this->render('view', array('property' => $property, 'recentlyViewed' => $recentlyViewed, 'propertyAgentInfo' => $propertyAgentInfo, 'propertyBuilderInfo' => $propertyBuilderInfo, 'propertySpecialistInfo' => $propertySpecialistInfo, 'propertyUser' => $propertyUser, 'propertyAgent' => $propertyAgent, 'propertyBuilder' => $propertyBuilder, 'propertySpecialist' => $propertySpecialist, 'propertySimilar' => $propertySimilar, 'propertySimilarAddress' => $propertySimilarAddress, 'propertySimilarUser' => $propertySimilarUser, 'propertyRecentlyViewed' => $propertyRecentlyViewed, 'propertyRecentlyViewedAddress' => $propertyRecentlyViewedAddress, 'propertyRecentlyViewedUser' => $propertyRecentlyViewedUser, 'propertyImages' => $propertyImages, 'propertyType' => $propertyType, 'propertyAddress' => $propertyAddress, 'transactionType' => $transactionType, 'ownershipType' => $ownershipType, 'propertyAge' => $propertyAge, 'propertyAmenities' => $propertyAmenities, 'propertyRating' => $propertyRating, 'propertyWishlist' => $propertyWishlist)); Yii::endProfile('property_view'); }
?> <br /> <?php if ($projectViews) { ?> <span>Views :</span><?php echo $projectViews->views; ?> <br /><?php } if ($project->recently_viewed) { ?> <span>Recently Viewed By :</span> <?php $name = UserApi::getUserProfileDetails($projectViews->recently_viewed); echo $name->first_name, " ", $name->last_name; ?> <br /><?php } ?> </div> <?php if ($projectAgentInfo) { ?> <div class="white_wrap"> <h2>Agent Information</h2> <div style="padding: 10px;"> <p><b><?php echo $projectAgentInfo->company_name; ?>
public function actionView($id) { Yii::beginProfile('project_view'); $session = Yii::app()->session; $project = ProjectApi::getProjectById($id); if (!$project) { throw new CHttpException(404, 'The requested page does not exist.'); } $recentlyViewed = UserApi::getUserProfileDetails($project->recently_viewed); $projectAgentInfo = AgentProfileApi::getAgentDetails($project->user_id); $projectUser = ""; $projectAgent = ""; $projectBuilder = ""; $projectBuilderInfo = ""; $projectSpecialist = ""; $projectSpecialistInfo = ""; $projectRating = ''; if ($projectAgentInfo) { $projectAgent = UserApi::getUserProfileDetails($projectAgentInfo->user_id); } else { $projectBuilderInfo = BuilderProfileApi::getBuilderDetails($project->user_id); if ($projectBuilderInfo) { $projectBuilder = UserApi::getUserProfileDetails($projectBuilderInfo->user_id); } else { $projectSpecialistInfo = SpecialistProfileApi::getSpecialistDetails($project->user_id); if ($projectSpecialistInfo) { $projectSpecialist = UserApi::getUserProfileDetails($projectSpecialistInfo->user_id); } else { $projectUser = UserApi::getUser($project->user_id); } } } $projectSimilar = ProjectApi::getSimilarProjects($project, 3); $projectSimilarAddress = ""; $projectSimilarUser = ""; if ($projectSimilar) { foreach ($projectSimilar as $similar) { $projectSimilarAddress[$similar->id] = ProjectApi::getLocation($similar->id); $projectSimilarUser[$similar->id] = UserApi::getUserProfileDetails($similar->user_id); } } $recentlyViewedIds = $session['projects']; $project_ids = $recentlyViewedIds; $project_ids[] = $id; $session['projects'] = array_unique($project_ids); $projectRecentlyViewed = ""; $projectRecentlyViewedAddress = ""; $projectRecentlyViewedUser = ""; if ($recentlyViewedIds) { foreach ($recentlyViewedIds as $recent) { $modelProject = ProjectApi::getProjectById($recent); $projectRecentlyViewed[] = $modelProject; $projectRecentlyViewedAddress[] = ProjectApi::getLocation($recent); $projectRecentlyViewedUser[] = UserApi::getUserProfileDetails($modelProject->user_id); } } $projectImages = ProjectImagesApi::getAllImages($project->id); $projectType = ProjectTypesApi::getProjectTypeById($project->project_type_id); $ownershipType = OwnershipTypesApi::getOwnershipTypeById($project->ownership_type_id); $projectAmenities = ProjectAmenitiesApi::getAmenitiesForProject($project->id); $projectAddress = ProjectApi::getLocation($project->id); $projectProperties = ProjectPropertiesApi::getPropertiesModel($project->id); $projectWishlist = ProjectWishlistApi::getWishlistUserOnProject($project->id, Yii::app()->user->id); $projectRating = ProjectRatingApi::getRating($project->id); $projectViews = ProjectApi::getViews($project->id); ProjectApi::setViews($project->id); $this->render('view', array('project' => $project, 'recentlyViewed' => $recentlyViewed, 'projectAgentInfo' => $projectAgentInfo, 'projectBuilderInfo' => $projectBuilderInfo, 'projectSpecialistInfo' => $projectSpecialistInfo, 'projectUser' => $projectUser, 'projectAgent' => $projectAgent, 'projectBuilder' => $projectBuilder, 'projectSpecialist' => $projectSpecialist, 'projectSimilar' => $projectSimilar, 'projectSimilarAddress' => $projectSimilarAddress, 'projectSimilarUser' => $projectSimilarUser, 'projectRecentlyViewed' => $projectRecentlyViewed, 'projectRecentlyViewedAddress' => $projectRecentlyViewedAddress, 'projectRecentlyViewedUser' => $projectRecentlyViewedUser, 'projectImages' => $projectImages, 'projectType' => $projectType, 'projectAddress' => $projectAddress, 'ownershipType' => $ownershipType, 'projectAmenities' => $projectAmenities, 'projectProperties' => $projectProperties, 'projectRating' => $projectRating, 'projectWishlist' => $projectWishlist, 'projectViews' => $projectViews)); Yii::endProfile('project_view'); }
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'); }
public function actionView($userId) { Yii::beginProfile('builder_view'); $builderRatingReadOnly = false; $session = Yii::app()->session; $builder = BuilderProfileApi::getBuilderDetails($userId); if (!$builder) { throw new CHttpException(404, 'The requested page does not exist.'); } $builderInfo = UserApi::getUserProfileDetails($builder->user_id); $builderAddress = DbUtils::getAddress($builder->city_id); $builderProjectTypeIds = ProjectApi::getProjectTypesByUserId($builder->user_id); $builderProjectTypes = ""; if ($builderProjectTypeIds) { foreach ($builderProjectTypeIds as $builderProjectTypeId) { $builderProjectTypes[$builderProjectTypeId->project_type_id] = ProjectTypesApi::getProjectTypeById($builderProjectTypeId->project_type_id); } } $builderProjects = ProjectApi::getProjectsOfUser($builder->user_id, Yii::app()->params['dashboardResultsPerPage']); $builderLocations = UserBuilderLocationsApi::getLocations($builder->id); $builderProjectLocations = ""; if ($builderLocations) { foreach ($builderLocations as $builderLocation) { $builderProjectLocations[] = DbUtils::getAddress($builderLocation->city_id); } } $builderRatingReadOnly = BuilderRatingApi::isRated($builder->id, Yii::app()->user->id); $builderRating = BuilderRatingApi::getRating($builder->id); if (!$builderRatingReadOnly) { if ($builder->user_id == Yii::app()->user->id) { $builderRatingReadOnly = true; } else { $builderRatingReadOnly = false; } } else { $builderRatingReadOnly = true; } $this->render('view', array('builder' => $builder, 'builderInfo' => $builderInfo, 'builderAddress' => $builderAddress, 'builderProjectTypes' => $builderProjectTypes, 'builderProjectLocations' => $builderProjectLocations, 'builderProjects' => $builderProjects, 'builderRatingReadOnly' => $builderRatingReadOnly, 'builderRating' => $builderRating)); Yii::endProfile('builder_view'); }
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="right cols2"> <div id="property_search_results"> <h1 class="property_search_results_top"><?php echo count($users) . ' ' . $user_type; ?> (s) Found <span class="right"></span> </h1> <div id="user-results"> <?php foreach ($users as $user) { // echo $user->id; // echo '<br/>'; // continue; if (isset($images[$user->id])) { $image = $images[$user->id]; } $userProfile = UserApi::getUserProfileDetails($user->id); $profile = null; if ($user_type == "agent") { $profile = AgentProfileApi::getAgentDetails($user->id); // echo $profile->id; } elseif ($user_type == "builder") { $profile = BuilderProfileApi::getBuilderDetails($user->id); //echo '<pre>';var_dump($profile->company_name);die(); } elseif ($user_type == "specialist") { $profile = SpecialistProfileApi::getSpecialistDetails($user->id); } ?> <div class="post agent" style="cursor:pointer;" onClick="window.open('<?php echo Yii::app()->createAbsoluteUrl('/' . $user_type . '/' . $user->id); ?> ')">
public function actionView($id) { Yii::beginProfile('jukebox_view'); if (isset($_GET['attributeidC'])) { JukeboxAnswersApi::undoCorrectAnswer($_GET['attributeidC']); } if (isset($_GET['attributeidW'])) { JukeboxAnswersApi::undoWrongAnswer($_GET['attributeidW']); } $jukeboxQuestion = ''; $userProfile = ''; $geoCity = ''; $jukeboxAnswers = ''; $userdata = ''; $jukeboxRating = ''; $juckboxRatingEnable = false; $modelJukeboxQuestions = new JukeboxQuestions(); $jukeboxNewAnswers = new JukeboxAnswers(); $jukeboxQuestion = JukeboxQuestionsApi::getJukeboxQuestionById($id); $userProfile = UserApi::getUserProfileDetails($jukeboxQuestion->user_id); $juckboxRatingReadOnly = JukeboxRatingApi::checkUserRating($jukeboxQuestion->id, Yii::app()->user->id); if ($userProfile) { if (!$juckboxRatingReadOnly) { if ($userProfile->id == Yii::app()->user->id) { $juckboxRatingReadOnly = true; } else { $juckboxRatingReadOnly = false; } } else { $juckboxRatingReadOnly = true; } } if ($jukeboxQuestion) { if (isset($_POST['submit'])) { $model = new JukeboxAnswers(); $model->attributes = $_POST['JukeboxAnswers']; $data = JukeboxAnswersApi::addJukeboxAnswer(Yii::app()->user->id, $jukeboxQuestion->id, $model); if ($data) { $emailData = array(); $user = UserApi::getUserById(Yii::app()->user->id); $user ? $emailData["user"] = $user->id : null; $emailData["answer"] = $data->id; EmailApi::sendEmail($user->email_id, "ACTIVITY.JUKEBOX.RESPONSE", $emailData); } } $geoCity = GeoCityApi::getCitynameByID($userProfile->city_id); $jukeboxAnswers = JukeboxAnswersApi::getJukeboxAnswers($jukeboxQuestion->id); if ($jukeboxAnswers) { foreach ($jukeboxAnswers as $answers) { $jukeboxAnswersID[] = $answers->user_id; } $criteria = new CDbCriteria(); $criteria->addInCondition('user_id', $jukeboxAnswersID); $users = UserProfiles::model()->findAll($criteria); $user_data = ''; foreach ($users as $user) { $userdata[$user->user_id] = $user->first_name; } } $jukeboxRating = JukeboxRatingApi::getRating($jukeboxQuestion->id); } else { $jukeboxQuestion->question = "No Questions have been posted by user"; $jukeboxQuestion->description = ''; $jukeboxQuestion->id = ''; } $this->render('view', array('modelJukeboxQuestions' => $modelJukeboxQuestions, 'jukeboxNewAnswers' => $jukeboxNewAnswers, 'jukeboxQuestion' => $jukeboxQuestion, 'userProfile' => $userProfile, 'geoCity' => $geoCity, 'jukeboxAnswers' => $jukeboxAnswers, 'userdata' => $userdata, 'jukeboxRating' => $jukeboxRating, 'juckboxRatingReadOnly' => $juckboxRatingReadOnly)); Yii::endProfile('jukebox_view'); }
<?php $this->breadcrumbs = array('Users' => array('index'), $model->id); $this->menu = array(array('label' => 'List Users', 'url' => array('index')), array('label' => 'Create User', 'url' => array('create')), array('label' => 'Update User', 'url' => array('update', 'id' => $model->id)), array('label' => 'Delete User', 'url' => '#', 'linkOptions' => array('submit' => array('delete', 'id' => $model->id), 'confirm' => 'Are you sure you want to delete this item?')), array('label' => 'Manage Users', 'url' => array('admin'))); ?> <h1>View User #<?php echo $model->id; ?> </h1> <hr/> <h4>Account Information</h4> <?php $this->widget('zii.widgets.CDetailView', array('data' => $model, 'attributes' => array('id', 'email_id', 'status', 'verified_by', 'warnings', 'registered_ip', 'last_login_ip', 'last_login_time'))); ?> <br/><hr/> <h4>Profile Information</h4> <?php $profile = UserApi::getUserProfileDetails($model->id); $this->widget('zii.widgets.CDetailView', array('data' => $profile, 'attributes' => array('first_name', 'last_name', 'gender', 'address_line1', 'address_line2', 'city.city', 'state.state', 'zip', 'country.country', 'mobile', 'telephone'))); ?> <br/><hr/><br/> <?php $this->widget('application.modules.auditTrail.widgets.portlets.ShowAuditTrail', array('model' => $model)); ?> <br/><hr/><br/> <?php $this->widget('application.modules.auditTrail.widgets.portlets.ShowAuditTrail', array('model' => $profile));
<?php if ($questions) { ?> <div class="right cols2"> <?php echo '<div id="property_search_results"> <h1 class="property_search_results_top">' . $jukeboxCount . ' Questions Found <span class="right"></span> </h1> '; foreach ($questions as $question) { $userdetails = UserApi::getUserProfileDetails($question->user_id); $answers = count(JukeboxAnswersApi::getJukeboxAnswers($question->id)); ?> <div class="post jukebox" style="cursor:pointer;" onClick="location.href='<?php echo Yii::app()->createAbsoluteUrl('/jukebox/' . $question->id); ?> '"> <div> <h1><?php echo $question->question; ?> </h1> <p><?php echo $question->description; ?> </p> <div class="left bedrooms width_auto">Posted in <span><?php echo $question->category->category; ?>