public function run() { $image = ImageUtils::getDefaultImage('properties'); $ids = array(); foreach ($this->properties as $property) { $ids[] = $property->id; } $images = PropertyImagesApi::getPrimaryImageForProperties($ids); $this->render('propertylist', array('properties' => $this->properties, 'images' => $images, 'ids' => $ids, 'image' => $image)); }
protected function renderContent() { $propertySpotlight = PropertyApi::getFeaturedProperties(10, $this->location); $propertyImages = ''; if ($propertySpotlight) { foreach ($propertySpotlight as $property) { $propertyIds[] = $property->id; } $propertyImages = PropertyImagesApi::getPrimaryImageForProperties($propertyIds); } $this->render('propertyspotlight', array('propertySpotlight' => $propertySpotlight, 'propertyImages' => $propertyImages)); }
public function run() { $images = null; $image = ImageUtils::getDefaultImage('properties'); $ids = array(); if ($this->properties) { foreach ($this->properties as $property) { $ids[] = $property->id; } $images = PropertyImagesApi::getPrimaryImageForProperties($ids); } $this->render('propertySearchResults', array('pages' => $this->pages, 'modelProperty' => $this->modelProperty, 'modelCity' => $this->modelCity, 'propertyAmenities' => $this->propertyAmenities, 'properties' => $this->properties, 'images' => $images, 'ids' => $ids, 'image' => $image, 'propertiesCount' => $this->propertiesCount, 'wishlistRemove' => $this->wishlistRemove)); }
public function actionIndex() { $userId = Yii::app()->user->id; $projectImages = ''; $propertyImages = ''; $projectCount = ''; $propertyCount = ''; $propertyTypes = ''; $propertyLocations = ''; $propertyid = ''; $projectLocations = ''; $projectOwnerships = ''; $projectTypes = ''; $users = ''; $userIds[] = ''; $myJukeBox = ''; $jukeBoxcategoryName = ''; $jukecount = '0'; $propertyWishList = ''; $propertyName = ''; $projectWishlist = ''; $projectName = ''; $propertywishlistcount = 0; $inbox = PmbApi::getInbox($userId); $userName = UserApi::getUserProfileDetails($userId); if ($inbox) { foreach ($inbox as $messages) { $userIds[] = $messages->from_user_id; } $users = DbUtils::getDbValues(new UserProfiles(), 'user_id', $userIds, 'first_name'); } $properties = PropertyApi::getPropertiesOfUser($userId, Yii::app()->params['dashboardResultsPerPage']); $countUnread = PmbApi::getUnreadInboxCount($userId); $propertyCount = PropertyApi::getAllPropertiesCount($userId); $locations = ''; if ($properties) { foreach ($properties as $location) { $locations[] = $location->city_id; } $propertyLocations = DbUtils::getDbValues(new GeoCity(), 'id', $locations, 'city'); } if ($properties) { foreach ($properties as $property) { $propertyTypes[] = $property->property_type_id; $propertyid[] = $property->id; } $propertyImages = PropertyImagesApi::getPrimaryImageForProperties($propertyid); $propertyTypes = DbUtils::getDbValues(new PropertyTypes(), 'id', $propertyTypes, 'property_type'); } $projects = ProjectApi::getProjectsOfUser($userId, Yii::app()->params['dashboardResultsPerPage']); if ($projects) { foreach ($projects as $project) { $projectLocationIds[] = $project->city_id; $projectTypeIds[] = $project->project_type_id; $projectOwnershipIds[] = $project->ownership_type_id; $projectIds[] = $project->id; } $projectImages = ProjectImagesApi::getPrimaryImageForProjects($projectIds); $projectLocations = DbUtils::getDbValues(new GeoCity(), 'id', $projectLocationIds, 'city'); $projectTypes = DbUtils::getDbValues(new ProjectTypes(), 'id', $projectTypeIds, 'project_type'); $projectOwnerships = DbUtils::getDbValues(new CategoryOwnershipTypes(), 'id', $projectOwnershipIds, 'ownership_type'); } $projectCount = ProjectApi::getProjectsofUserCount($userId); $isProfile['agent'] = AgentProfileApi::isAgent($userId); $isProfile['builder'] = BuilderProfileApi::isBuilder($userId); $isProfile['specialist'] = SpecialistProfileApi::isSpecialist($userId); //MyJuckbox $myJukeBox = JukeboxQuestionsApi::getAllJukeboxQuestionsOfUser($userId, Yii::app()->params['dashboardResultsPerPage']); if ($myJukeBox) { foreach ($myJukeBox as $jukeBox) { $categoryIdArray[] = $jukeBox->category_id; } $jukeBoxcategoryName = DbUtils::getDbValues(new JukeboxCategory(), 'id', $categoryIdArray, 'category'); $jukecount = count($myJukeBox); } //my wishlists $propertyWishList = PropertyWishlistApi::getWishlist($userId, Yii::app()->params['dashboardResultsPerPage']); if ($propertyWishList) { foreach ($propertyWishList as $propertyWish) { $propertyWishlistArray[] = $propertyWish->property_id; } $propertyName = DbUtils::getDbValues(new Property(), 'id', $propertyWishlistArray, 'property_name'); } $propertywishlistcount = PropertyWishlistApi::getWishlistCount($userId); $totalWishlistCount = $propertywishlistcount; //+$projectwishlistcount; //requirements $requirements = RequirementApi::getRequirementByUserId($userId, Yii::app()->params['dashboardResultsPerPage']); if ($requirements) { $requirementscount = count($requirements); } else { $requirementscount = 0; } $this->render('index', array('inbox' => $inbox, 'users' => $users, 'properties' => $properties, 'countUnread' => $countUnread, 'propertyLocations' => $propertyLocations, 'propertyTypes' => $propertyTypes, 'projects' => $projects, 'projectLocations' => $projectLocations, 'projectTypes' => $projectTypes, 'projectOwnerships' => $projectOwnerships, 'propertyCount' => $propertyCount, 'projectCount' => $projectCount, 'propertyid' => $propertyid, 'propertyImages' => $propertyImages, 'projectImages' => $projectImages, 'isProfile' => $isProfile, 'myJukeBox' => $myJukeBox, 'jukeBoxcategoryName' => $jukeBoxcategoryName, 'jukecount' => $jukecount, 'propertyWishList' => $propertyWishList, 'propertyName' => $propertyName, 'projectName' => $projectName, 'totalWishlistCount' => $totalWishlistCount, 'requirements' => $requirements, 'requirementscount' => $requirementscount, 'userName' => $userName)); }
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'); }
<?php $this->breadcrumbs = array('Property Images' => array('index'), $model->id); $this->menu = array(array('label' => 'List PropertyImages', 'url' => array('index')), array('label' => 'Create PropertyImages', 'url' => array('create')), array('label' => 'Update PropertyImages', 'url' => array('update', 'id' => $model->id)), array('label' => 'Delete PropertyImages', 'url' => '#', 'linkOptions' => array('submit' => array('delete', 'id' => $model->id), 'confirm' => 'Are you sure you want to delete this item?')), array('label' => 'Manage PropertyImages', 'url' => array('admin'))); ?> <h1>View PropertyImages #<?php echo $model->id; ?> </h1> <?php $this->widget('zii.widgets.CDetailView', array('data' => $model, 'attributes' => array('id', array('name' => 'property_id', 'value' => PropertyApi::getNameByPropertyId($model->property_id)), array('name' => 'image', 'type' => 'raw', 'value' => '<img src="' . PropertyImagesApi::getImageByUrl($model->property_id, $model->image) . '" />'))));
<?php $this->breadcrumbs = array('Properties' => array('index'), 'View'); $this->menu = array(array('label' => 'List Property', 'url' => array('index')), array('label' => 'Create Property', 'url' => array('create')), array('label' => 'Update Property', 'url' => array('update', 'id' => $model->id)), array('label' => 'Delete Property', 'url' => '#', 'linkOptions' => array('submit' => array('delete', 'id' => $model->id), 'confirm' => 'Are you sure you want to delete this item?')), array('label' => 'Manage Property', 'url' => array('admin'))); if ($model->projectProperties) { $this->menu[] = array('label' => 'Back to Project', 'url' => Yii::app()->request->urlReferrer); } ?> <h1>View Property</h1> <?php $this->widget('zii.widgets.CDetailView', array('data' => $model, 'attributes' => array('id', array('label' => 'User Name', 'type' => 'raw', 'value' => CHtml::link(CHtml::encode(UserApi::getNameByUserId($model->user_id)), array('/store/user/view', 'id' => $model->user_id))), 'i_want_to', 'property_name', 'description', 'features', 'featured', 'jackpot_investment', 'instant_home', 'propertyType.property_type', 'transactionType.transaction_type', 'locality.locality', 'address', 'bathrooms', 'bedrooms', 'furnished', 'age_of_construction', 'ownershipType.ownership_type', 'covered_area', 'land_area', 'total_price', 'per_unit_price', 'area_type', 'display_price', 'price_negotiable', 'available_from', 'available_units', 'facing', 'floor_number', 'total_floors', 'landmarks', 'tax_fees', 'terms_and_conditions'))); $images = PropertyImagesApi::getAllImages($model->id); $propertyAmenities = $model->propertyAmenities; $amenities = null; foreach ($propertyAmenities as $i => $propertyAmenity) { if ($i != 0) { $amenities .= ", "; } $amenities .= $propertyAmenity->amenity->amenity; } ?> <table id="yw0" class="detail-view"> <tbody> <tr class="even"> <th>Average Rating</th> <td><?php echo PropertyRatingApi::getRating($model->id); ?> </td>
public function getLink() { return '<img src="' . PropertyImagesApi::getImageByUrl($this->property_id, $this->image) . '" />'; // return PropertyImagesApi::getImageByUrl($this->property_id,$this->image); }