本文整理汇总了PHP中DbUtils::getAddress方法的典型用法代码示例。如果您正苦于以下问题:PHP DbUtils::getAddress方法的具体用法?PHP DbUtils::getAddress怎么用?PHP DbUtils::getAddress使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DbUtils
的用法示例。
在下文中一共展示了DbUtils::getAddress方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionProfile
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');
}
示例2: elseif
$profile = AgentProfileApi::getAgentDetails($user->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" 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;
示例3: actionView
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');
}
示例4: actionView
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');
}
示例5: actionView
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');
}
示例6: actionView
public function actionView($id)
{
Yii::beginProfile('view_profile');
//$session = Yii::app()->session;
$wheelsImages = array();
$wheelImages = array();
$lastRide = array();
$user = UserApi::getUserById($id);
if (!$user) {
throw new CHttpException(404, 'The requested page does not exist.');
}
$userAge = UserApi::getAge($user->dob);
$userAddress = "";
if ($user->city_id) {
$userAddress = DbUtils::getAddress($user->city_id);
}
$imageUserId = array($id);
$image = ImagesApi::getPrimaryImageForUsers($imageUserId);
if ($image) {
$userImage = $image[$id];
} else {
$userImage = ImageUtils::getDefaultImage('user');
}
$userWheelDefault = ImageUtils::getDefaultImage('wheel');
$userRides = RidesApi::getCountOfUserRides($id);
$userEcoMiles = RidesApi::getEcoMilesDrivenByUser($id);
$userWheel = WheelApi::getWheelsCount($id);
$userPalsCount = UserPalsApi::getPalsCount($id);
$entityId = EntityApi::getIdByType("user");
$driverRating = round(FeedbackApi::getRating($id, $entityId, 'DRIVER'));
$passengerRating = round(FeedbackApi::getRating($id, $entityId, 'PASSENGER'));
$userPals = UserPalsApi::getAllPals($id);
$userPalDefaultImage = ImageUtils::getDefaultImage('user');
$lastRide = RidesApi::getLastRide($id);
$lastRideWheel = WheelApi::getWheelById($lastRide[0]['wheel_id']);
$userWheels = WheelApi::getWheelsByUserId($id);
$favoriteWheel = WheelApi::getFavouriteWheel($id);
$userFeedback = FeedbackApi::getAllFeedback($id, $entityId);
$favWheelDetail = "";
$wheelMake = "";
$wheelModel = "";
$wheelColor = "";
$wheelRides = "";
$wheelEcoMiles = "";
$wheelPals = "";
$wheelPalCnt = "";
if ($favoriteWheel) {
$favWheelDetail = WheelApi::getWheelById($favoriteWheel[0]["wheel_id"]);
$wheelMake = MakeApi::getMakeById($favWheelDetail->make_id);
$wheelModel = ModelApi::getModelById($favWheelDetail->model_id);
$wheelColor = ColorApi::getColorById($favWheelDetail->color_id);
$wheelRides = RidesApi::getCountOfWheelRides($favWheelDetail->id);
$wheelImage = ImagesApi::getPrimaryImageForWheels(array($favoriteWheel[0]["wheel_id"]));
if (!$wheelImage) {
$wheelImage = $userWheelDefault;
}
$wheelEcoMiles = RidesApi::getEcoMilesDrivenByWheel($favWheelDetail->id);
$wheelPals = WheelApi::getNoOfPalsMetByWheelId($favWheelDetail->id);
$wheelPalCnt = $wheelPals[0]['palcnt'];
}
$i = 0;
if ($userFeedback) {
foreach ($userFeedback as $feedback) {
$fromUserProfile = UserApi::getUserById($feedback->from_user_id);
$fromUserIds[$i] = $feedback->from_user_id;
$userName = UserApi::getNameByUserId($fromUserProfile->id);
$userFeedbackDetails[$i++] = array('from_id' => $feedback->from_user_id, 'userName' => $userName, 'feedback' => $feedback->feedback);
}
}
$i = 0;
$j = 0;
$userPalList = "";
$palScrollLabel = "";
$mergeArray = array_merge($userPals, $fromUserIds);
$userIdList = array_unique($mergeArray);
$userImages = ImagesApi::getPrimaryImageForUsers($userIdList);
$imageArrayIndex = array_keys($userImages);
$imageArrayIndexSize = count($imageArrayIndex);
//var_dump($userPals);
// var_dump($fromUserIds);die();
if ($userPals) {
foreach ($userPals as $userPal) {
$userPalList[$i++] = userapi::getUserById($userPal);
}
}
if ($userIdList) {
foreach ($userIdList as $userId) {
for ($j = 0; $j < $imageArrayIndexSize; $j++) {
$palsImages[$userId] = '';
if ($imageArrayIndex[$j] == $userId) {
$palsImages[$userId] = $userImages[$userId];
break;
}
}
if ($palsImages[$userId] == '') {
$palsImages[$userId] = $userPalDefaultImage;
}
}
}
if ($userWheels) {
//.........这里部分代码省略.........