コード例 #1
0
ファイル: CityController.php プロジェクト: romeo14/wallfeet
 public function actionGetMultiList()
 {
     $state_id = $_POST['GeoState']['state'];
     $model = new RequirementCities();
     $list = array();
     if ($state_id) {
         $list = CHtml::listData(GeoCity::model()->findAll('state_id=:state_id', array(':state_id' => $state_id)), 'id', 'city');
         $this->renderPartial('getMultiList', array('list' => $list, 'requirementCities' => $model));
     }
 }
コード例 #2
0
ファイル: GeoController.php プロジェクト: porem/yupe-ext
 public function actionCityAjax($term)
 {
     $c = new CDbCriteria();
     $c->addCondition("(t.name like :name)");
     $c->params = array(':name' => $term . "%");
     $c->limit = 10;
     $x = array();
     if ($city = GeoCity::model()->with(array('country'))->findAll($c)) {
         foreach ($city as $u) {
             $label = $u->combinedName;
             array_push($x, array('label' => $label, 'value' => $label, 'id' => $u->id));
         }
     }
     echo json_encode($x);
 }
コード例 #3
0
ファイル: DbUtils.php プロジェクト: romeo14/pow
 public static function getAddressByLocalityId($localityId)
 {
     $address[] = "";
     $locality = GeoLocality::model()->findByPk($localityId);
     if ($locality) {
         $address['locality'] = $locality->locality;
         $city = GeoCity::model()->findByPk($locality->city_id);
         $address['city'] = $city->city;
         $state = GeoState::model()->findByPk($city->state_id);
         $address['state'] = $state->state;
         $country = GeoCountry::model()->findByPk($state->country_id);
         $address['country'] = $country->country;
         return $address;
     } else {
         return false;
     }
 }
コード例 #4
0
ファイル: MapController.php プロジェクト: romeo14/wallfeet
 public function actionRender($name, $request, $modelname)
 {
     if (isset($_POST["{$request}"]['city_id'])) {
         $model = new $modelname();
         $city_id = $_POST["{$request}"]['city_id'];
         $city = GeoCity::model()->findByPk($_POST["{$request}"]['city_id']);
         if ($city) {
             $cityName = $city->city;
             $stateName = $city->state->state;
             $countryName = $city->state->country->country;
             $data['city'] = $cityName;
             $data['state'] = $stateName;
             $data['country'] = $countryName;
         } else {
             return;
         }
     } else {
         return;
     }
     $list = GeoLocalityApi::getList($city_id);
     $this->renderPartial('render', array('data' => $data, 'name' => $name, 'model' => $model, 'list' => $list));
 }
コード例 #5
0
ファイル: ProjectApi.php プロジェクト: romeo14/wallfeet
 public static function getLocation($projectId)
 {
     $project = Projects::model()->findByPk($projectId);
     $address[] = "";
     if ($project) {
         $locality = isset($_POST['GeoLocality']['locality_id']) ? $_POST['GeoLocality']['locality_id'] : '';
         if ($locality) {
             $locality = GeoLocality::model()->findByPk($project->locality_id);
             $address['locality'] = $locality ? $locality->locality : "";
             $city = GeoCity::model()->findByPk($locality->city_id);
             $address['city'] = $city->city;
             $state = GeoState::model()->findByPk($city->state_id);
             $address['state'] = $state->state;
             $country = GeoCountry::model()->findByPk($state->country_id);
             $address['country'] = $country->country;
             return $address;
         }
     } else {
         return false;
     }
 }
コード例 #6
0
ファイル: topMenu.php プロジェクト: romeo14/wallfeet
		return false;
	}	
}
</script>
<?php 
$modelProperty = new Property();
$modelCity = new GeoCity();
$modelState = new GeoState();
$modelProfile = new UserProfiles();
$modelRequirement = new Requirement();
$specializations = new Specializations();
$stateCache = new CDbCacheDependency('SELECT MAX(updated_time) FROM geo_state');
$stateList = CHtml::listData(GeoState::model()->cache(1000, $stateCache)->findAll(), 'id', 'state');
$propertyTypeList = CHtml::listData(PropertyTypes::model()->with('category')->findAll(), 'id', 'property_type', 'category.category');
$cityCache = new CDbCacheDependency('SELECT MAX(updated_time) FROM geo_city');
$cityList = CHtml::listData(GeoCity::model()->with('state')->cache(1000, $cityCache)->findAll(), 'id', 'city', 'state.state');
$specializationList = Specializations::model()->findAll();
if ($this->beginCache('topmenu', array('duration' => 0))) {
    ?>
<div id="menu-part">
  <div  id="menu">
    <ul>
      <li class="home-icon"><a href="<?php 
    echo Yii::app()->homeUrl;
    ?>
">
      <img src="<?php 
    echo Yii::app()->theme->baseUrl;
    ?>
/images/icon-home.png" alt="" /></a></li>
      <li id="menubox_search"><a  class="drop" onclick="js:menuDrop('menubox_search')">Search</a>
コード例 #7
0
ファイル: register.php プロジェクト: romeo14/wallfeet
?>
</li>
			<li class="error_message"><?php 
echo $form->error($profilesModel, 'state_id');
?>
</li>
			</ul>
			<div id="city_content" class="pad10">
			<ul>
			<li><span><?php 
echo $form->label($profilesModel, 'city_id');
?>
<span class="required">*</span></span></li>
			<li>
			<?php 
echo $form->dropdownList($profilesModel, 'city_id', CHtml::listData(GeoCity::model()->findAll('state_id=:state_id', array(':state_id' => $profilesModel->state_id)), 'id', 'city'), array('empty' => 'Select'));
?>
			</li>
			<li class="error_message"><?php 
echo $form->error($profilesModel, 'city_id');
?>
</li>
			</ul>
			</div>
			</div>
		</div>
				<div class="right hints">		
            		<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam scelerisque gravida mattis. Vestibulum ut vehicula odio.</p>
            	</div>
			</fieldset>
			<fieldset>
コード例 #8
0
?>
</li>
			<li class="error_message"><?php 
echo $form->error($modelState, 'id');
?>
</li>
			</ul>
			<div id="city_content" class="pad10">
			<ul>
			<li><span><?php 
echo $form->label($modelCity, 'id');
?>
</span></li>
			<li>
			<?php 
echo $form->dropdownList($modelCity, 'id', CHtml::listData(GeoCity::model()->findAll('state_id=:state_id', array(':state_id' => $modelState->id)), 'id', 'city'), array('empty' => 'All'));
?>
			</li>
			<li class="error_message"><?php 
echo $form->error($modelCity, 'id');
?>
</li>
			</ul>
			</div>
			</div>
			
		<table width="92%" border="0" cellpadding="0" cellspacing="0" align="center">
			<tr>
			<td><label>Locality</label> <br />
			<div id="locality_content" class="dis_inline">
				<?php 
コード例 #9
0
 public function actionUpdate($id, $imageId = '')
 {
     //		var_dump($_GET);die();
     Yii::beginProfile('property_update');
     $model = Property::model()->findByPk($id);
     if (!$model) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     $jackpot = $model->jackpot_investment;
     $instant = $model->instant_home;
     $currentImages = PropertyImagesApi::getAllImages($model->id);
     $localitymodel = GeoLocality::model()->find('id=:id', array(':id' => $model->locality_id));
     $locality = $localitymodel->locality;
     if ($imageId && is_array($currentImages)) {
         $imageResult = false;
         if (array_key_exists($imageId, $currentImages)) {
             $imageResult = PropertyImagesApi::deleteImageByPk($imageId);
         }
         $this->renderPartial('_imageDeleted', array('result' => $imageResult));
         Yii::app()->end();
     }
     if ($model->user_id != Yii::app()->user->id) {
         throw new CHttpException(503, 'Unauthorized.');
     }
     // Open session object
     $session = new CHttpSession();
     $session->open();
     $userId = Yii::app()->user->id;
     $model->country = 'india';
     $modelCity = new GeoCity();
     $propertyAmenities = new PropertyAmenities();
     $propertyImages = new PropertyImages();
     $amenities = PropertyAmenitiesApi::getAmenitiesIdForProperty($id);
     $localityNew = false;
     if ($model->latitude && $model->longitude) {
         $locationPosition = array($model->latitude, $model->longitude);
     } else {
         $locationPosition = array(20.59368, 78.96288);
     }
     $localityList = GeoLocalityApi::getAllNameList();
     $this->performAjaxValidation($model);
     //$this->performAjaxValidation($profilesModel);
     if (isset($_POST['ajax']) && $_POST['ajax'] === 'property-form') {
         echo CActiveForm::validate($model);
         //echo CActiveForm::validate($profilesModel);
         Yii::app()->end();
     }
     if (isset($_POST['submit'])) {
         $amenity_id = array();
         $model->attributes = $_POST['Property'];
         $amenity_id = array();
         if (isset($_POST['PropertyAmenitiesHouse']) && isset($_POST['PropertyAmenitiesExternal'])) {
             $amenity_id = array_merge($_POST['PropertyAmenitiesHouse'], $_POST['PropertyAmenitiesExternal']);
         } elseif (isset($_POST['PropertyAmenitiesHouse'])) {
             $amenity_id = $_POST['PropertyAmenitiesHouse'];
         } elseif (isset($_POST['PropertyAmenitiesExternal'])) {
             $amenity_id = $_POST['PropertyAmenitiesExternal'];
         }
         //			var_dump($amenity_id);die();
         $model->user_id = $userId;
         $valid = true;
         $data = $_POST['Property'];
         if (isset($model->city_id)) {
             $cityModel = GeoCity::model()->findByPk($model->city_id);
             if ($cityModel) {
                 $model->state_id = $cityModel->state_id;
                 $data['state_id'] = $cityModel->state_id;
                 if (isset($model->locality)) {
                     $criteria = new CDbCriteria();
                     $criteria->condition = 'city_id=:city_id && locality=:locality';
                     $criteria->params = array(':city_id' => $cityModel->id, ':locality' => $model->locality);
                     $localityModel = GeoLocality::model()->find($criteria);
                     $locality = $model->locality;
                     if ($localityModel) {
                         $model->locality_id = $localityModel->id;
                     } else {
                         $localityModel = new GeoLocality();
                         $localityModel->locality = $model->locality;
                         $localityModel->city_id = $model->city_id;
                         $localityModel->save();
                         $model->locality_id = $localityModel->id;
                         $localityNew = $localityModel;
                     }
                     $data['locality_id'] = $localityModel->id;
                 }
             }
         }
         $valid = $valid && $model->validate();
         if ($model->latitude != '' && $model->longitude != '') {
             $locationPosition = array($model->latitude, $model->longitude);
         }
         if (!isset($data['property_type_id'])) {
             $data['property_type_id'] = $model->property_type_id;
         }
         if ($valid) {
             $data['property_name'] = PropertyTypesApi::getPropertyTypeById($data['property_type_id']);
             if ($data['jackpot_investment'] != $jackpot) {
                 $data['jackpot_investment'] = 2;
             }
             if ($data['instant_home'] != $instant) {
                 $data['instant_home'] = 2;
             }
             if (isset($model->video_url)) {
                 $video = explode('&', $model->video_url);
                 $videocode = explode('=', $video[0]);
                 if (isset($videocode[1])) {
                     $data['video_url'] = $videocode[1];
                 }
             }
             $property = PropertyApi::updatePropertyById($model->id, $data);
             if (!$property->hasErrors()) {
                 if (count($amenity_id) > 0) {
                     PropertyAmenitiesApi::deleteAllAmenitiesForProperty($property->id);
                     $amenities = PropertyAmenitiesApi::addAmenitiesForProperty($property->id, $amenity_id);
                 }
                 $images = $session['PropertyImages'];
                 if (is_array($images)) {
                     foreach ($images as $count => $image) {
                         $valid = $valid && PropertyImagesApi::addImage($property->id, $image) === true;
                     }
                 }
                 if ($valid) {
                     unset($session['PropertyImages']);
                     Yii::app()->user->setFlash('success', 'Great! You have succesfully updated your property.');
                     $this->redirect('/property/' . $property->id);
                 } else {
                     if ($localityNew && !$localityNew->isNewRecord) {
                         $localityNew->delete();
                     }
                     unset($session['PropertyImages']);
                     $propertyUpdateUrl = Yii::app()->createUrl('/property/update/' . $property->id . '');
                     Yii::app()->user->setFlash('error', 'Oops! We faced a problem and hence could not update your property.Please <a href=' . $propertyUpdateUrl . '>retry </a>');
                 }
             }
         } else {
             if ($localityNew && !$localityNew->isNewRecord) {
                 $localityNew->delete();
             }
             unset($session['PropertyImages']);
             //	var_dump($model->getErrors());
             Yii::app()->user->setFlash('error', 'There was an error while updating the property.');
         }
     }
     $this->render('update', array('model' => $model, 'propertyAmenities' => $propertyAmenities, 'propertyImages' => $propertyImages, 'amenities' => $amenities, 'currentImages' => $currentImages, 'locationPosition' => $locationPosition, 'localityList' => $localityList, 'locality' => $locality));
     Yii::endProfile('property_update');
 }
コード例 #10
0
ファイル: GeoCityApi.php プロジェクト: romeo14/wallfeet
 public static function getTopPrioritiesInternational($excludeCityId = '', $count = '', $metroOnly = true)
 {
     $dependencyState = new CDbCacheDependency('SELECT MAX(updated_time) FROM geo_state');
     $india = GeoCountryApi::getCountryByName('india');
     if ($india) {
         $stateModels = GeoState::model()->cache(1000, $dependencyState)->findAll('country_id!=:countryId', array(':countryId' => $india->id));
         if (empty($stateModels)) {
             return false;
         }
         foreach ($stateModels as $state) {
             $states[] = $state->id;
         }
         $criteria = new CDbCriteria();
         $criteria->addInCondition('state_id', $states);
         if ($metroOnly) {
             $criteria->addCondition('metro=1');
         }
         if ($count) {
             $criteria->limit = $count;
         }
         if ($excludeCityId) {
             //$criteria->addCondition('id=!id',array(':id'=>$excludeCityId));
             $criteria->addCondition("id!={$excludeCityId}");
         }
         $criteria->order = 'priority ASC';
         $dependencyCity = new CDbCacheDependency('SELECT MAX(updated_time) FROM geo_city');
         $cities = GeoCity::model()->cache(1000, $dependencyCity)->findAll($criteria);
         if (!empty($cities)) {
             return $cities;
         } else {
             return false;
         }
     }
 }
コード例 #11
0
ファイル: emi.php プロジェクト: romeo14/wallfeet
    <ul class="margin">
      <li><span><?php 
echo $form->label($loan, 'name');
?>
</span>
      <?php 
echo $form->textField($loan, 'name', array('class' => 'selectbox1'));
echo $form->error($loan, 'name');
?>
      </li>
      <li><span><?php 
echo $form->label($loan, 'city');
?>
</span>
      <?php 
echo $form->dropDownList($loan, 'city', CHtml::listData(GeoCity::model()->findAll(), 'id', 'city', 'state.state'), array('empty' => 'Select', 'class' => 'selectbox1'));
echo $form->error($loan, 'city');
?>
      
      </li>
       <li><span><?php 
echo $form->label($loan, 'mobile');
?>
</span>
      <?php 
echo $form->textField($loan, 'mobile', array('class' => 'selectbox1'));
echo $form->error($loan, 'mobile');
?>
      
      </li>
      <li><span><?php 
コード例 #12
0
ファイル: miniSearch.php プロジェクト: romeo14/wallfeet
		<input type="hidden" name="minbuysearch" value="MinBuySearch">
		<input type="hidden" name="Property[i_want_to]" value="Sell">
		<input type="hidden" name="without_budget" value="1" checked="checked">
		<input type="hidden" name="minisearch">
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
	
	<tr>		
		<td width="210px" align="right"><label>Property type</label> 
			<?php 
echo $form->dropDownList($properties, 'property_type_id', CHtml::listData(PropertyTypes::model()->findAll(), 'id', 'property_type'), array('class' => 'selectbox1', 'empty' => 'All', 'id' => 'buy_property'));
?>
</select></td>
		
		<td width="200px" align="right">
<label>City&nbsp</label><?php 
echo $form->dropdownList($modelCity, 'city', CHtml::listData(GeoCity::model()->with('state')->findAll(), 'id', 'city', 'state.state'), array('class' => 'selectbox1', 'id' => 'Property_city_id_buy', 'empty' => 'Select', 'OnChange' => 'javascript:changelocality(this.value);'));
?>

	</tr>
	<tr>
		<td width="210px" align="right">
<label>Budget</label> 
		 <select name="budget_min" class="selectbox2" id="buy_budget_min" valtype="budget_min" onchange="javascript:validateMin('buy_budget_min','buy_budget_max');">
			<option value="">Min</option>
		
				<option value="1" class="">Below 5 Lacs</option>
				<option value="500000" class="">5 Lacs</option>
				<option value="1000000" class="">10 Lacs</option>
				<option value="1500000" class="">15 Lacs</option>
				<option value="2000000" class="">20 Lacs</option>
				<option value="2500000" class="">25 Lacs</option>
コード例 #13
0
 public function actionSort()
 {
     if (isset($_POST['items']) && is_array($_POST['items'])) {
         $i = 0;
         foreach ($_POST['items'] as $item) {
             $city = GeoCity::model()->findByPk($item);
             $city->priority = $i;
             $city->save();
             $i++;
         }
     }
 }
コード例 #14
0
ファイル: update.php プロジェクト: romeo14/wallfeet
echo $form->error($model, 'property_type_id');
?>
</li>
</ul>


</fieldset>

<fieldset><legend>Property Address</legend>
<div id="city_content">
<ul>
	<li><span><?php 
echo $form->labelEx($model, 'city_id');
?>
</span> <?php 
echo $form->dropdownList($model, 'city_id', CHtml::listData(GeoCity::model()->findAll(), 'id', 'city', 'state.state'), array('empty' => 'Select', 'id' => 'geo_city', 'class' => 'select-box-signup', 'ajax' => array('type' => 'POST', 'url' => CController::createUrl('/location/map/render/name/Property/request/Property'), 'update' => '#property-hidden', 'data' => 'js:jQuery(this).serialize()')));
?>
</li>
	<li class="error_message"><?php 
echo $form->error($model, 'city_id');
?>
</li>
</ul>
</div>
<ul>
	<li><span><?php 
echo $form->labelEx($model, 'locality_id');
?>
</span>
	<div id="locality_content" class="dis_inline">	
	<?php 
コード例 #15
0
			<td>Keyword(s)<input type="text" name="keyword" class="txt-box1" value="<?php 
echo isset($_POST['keyword']) ? $_POST['keyword'] : '';
?>
" /></td>
		</tr>
		</table>
		</div>
	</li>
	<li>
		<h3>Location</h3>	
		<div class="acc-section">
		<table width="92%" border="0" cellpadding="0" cellspacing="0" align="center">
		<tr>
			<td><label>City</label> 
				<?php 
echo $form->dropdownList($modelProject, 'city_id', CHtml::listData(GeoCity::model()->findAll(), 'id', 'city'), array('empty' => 'All', 'id' => 'geo_city', 'ajax' => array('type' => 'POST', 'url' => CController::createUrl('/location/locality/getList'), 'update' => '#locality_content', 'data' => 'js:jQuery(this).serialize()')));
$city = isset($_POST['Projects']['city_id']) ? $_POST['Projects']['city_id'] : '';
?>
            </td>
		</tr>
		<tr>
			<td><label>Locality</label>
			<div id="locality_content" class="dis_inline">
				<?php 
echo $form->dropdownList($modelProject, 'locality_id', CHtml::listData(GeoLocality::model()->findAll('city_id=:city_id', array(':city_id' => $city)), 'id', 'locality'), array('empty' => 'All', 'id' => 'geo_locality'));
?>
			</div>
			</td>
		</tr>
		</table>
		</div>
コード例 #16
0
ファイル: geo_profile.php プロジェクト: sepaker/yupe
   <?php 
$city_id = Yii::app()->getRequest()->getParam("GeoProfile[geo_city_id]") ?: ($model->geo_city_id ?: NULL);
if (!$city_id) {
    $guessed_city = Yii::app()->getModule("geo")->guessCity();
}
if ($city_id && ($city = GeoCity::model()->with('country')->findByPk($city_id))) {
    $city = $city->combinedName;
} else {
    $city = "";
}
?>
    <div class="list">
        <div class="name"><?php 
echo Yii::t('default', 'City:');
?>
</div>
        <div class="form">
    <?php 
$form->widget('zii.widgets.jui.CJuiAutoComplete', array('name' => 'GeoProfile[geo_city]', 'value' => $city, 'sourceUrl' => $this->createUrl('/geo/geo/cityAjax'), 'htmlOptions' => array('class' => 'span5'), 'options' => array('showAnim' => 'fold', 'select' => 'js: function(event, ui) {
             $("#GeoProfile_geo_city_id").val(ui.item.id);
            }')));
echo CHtml::hiddenField('GeoProfile[geo_city_id]', $city_id);
if (!$city_id && $guessed_city) {
    echo "<br /><small>" . Yii::t('default', 'We think, you are from') . " <a href='#' onClick='\$(\"#GeoProfile_geo_city_id\").val(" . $guessed_city->id . ");\$(\"#GeoProfile_geo_city\").val(\$(this).text());return false;'>" . $guessed_city->combinedName . "</a><br />. " . Yii::t('default', 'Click on link to choose the city.') . "</small>";
}
?>

        </div>
        <div class="accession"></div>
    </div>
コード例 #17
0
ファイル: AgentController.php プロジェクト: romeo14/wallfeet
 public function actionaddMoreCity()
 {
     $cityid = '';
     $cityList = CHtml::listData(GeoCity::model()->findAll(), 'id', 'city', 'state.state');
     echo '<ul ><li><span>&nbsp</span>' . CHtml::dropdownList('city_id[]', $cityid, $cityList, array('empty' => 'Select', 'class' => 'slctbox med')) . '</li></ul><div id="city_content_more"></div>';
 }
コード例 #18
0
ファイル: GeoCityApi.php プロジェクト: romeo14/pow
 public static function getCitynameByID($cityID)
 {
     $model = GeoCity::model()->findByPk($cityID);
     return $model;
 }
コード例 #19
0
ファイル: PropertyApi.php プロジェクト: romeo14/wallfeet
 public static function getLocationForSession($sessionProperty)
 {
     $locality = GeoLocality::model()->findByPk($sessionProperty['locality_id']);
     $address['locality'] = $locality ? $locality->locality : "";
     $city = GeoCity::model()->findByPk($sessionProperty['city_id']);
     $address['city'] = $city->city;
     $state = GeoState::model()->findByPk($city->state_id);
     $address['state'] = $state->state;
     $country = GeoCountry::model()->findByPk($state->country_id);
     $address['country'] = $country->country;
     return $address;
 }
コード例 #20
0
ファイル: GeoModule.php プロジェクト: porem/yupe-ext
 public function guessCity()
 {
     $city = false;
     if ($info = $this->sxInfo) {
         $city = GeoCity::model()->findByAttributes(array("name" => $info['city']));
     }
     return $city;
 }
コード例 #21
0
ファイル: create.php プロジェクト: romeo14/wallfeet
	<li>
			<span>State<span class="required">*</span></span>
			<?php 
echo $form->dropdownList($model, 'state_id', CHtml::listData(GeoState::model()->findAll('country_id=:country_id', array(':country_id' => $model->country_id)), 'id', 'state'), array('empty' => 'All', 'class' => 'slctbox', 'ajax' => array('type' => 'POST', 'url' => CController::createUrl('/location/city/getList/page/agent'), 'update' => '#city_content', 'data' => 'js:jQuery(this).serialize()')));
?>
	</li>
	<li class="error_message"><?php 
echo $form->error($model, 'state_id');
?>
</li>
</ul>
<div id="city_content">
<ul>
	<li><span>City<span class="required">*</span></span>
		<?php 
echo $form->dropdownList($model, 'city_id', CHtml::listData(GeoCity::model()->findAll('state_id=:state_id', array(':state_id' => $model->state_id)), 'id', 'city'), array('empty' => 'All', 'class' => 'slctbox'));
$city = isset($_POST['GeoCity']['city_id']) ? $_POST['GeoCity']['city_id'] : '';
?>
	</li>
	<li class="error_message"><?php 
echo $form->error($model, 'city_id');
?>
</li>
</ul>
</div>
</div>
<ul>
	<li><span><?php 
echo 'Address Line 1';
?>
<span class="required">*</span></span>
コード例 #22
0
ファイル: _createForm.php プロジェクト: romeo14/wallfeet
echo $form->labelEx($profilesModel, 'address_line2');
?>
        <?php 
echo $form->textArea($profilesModel, 'address_line2', array('rows' => 6, 'cols' => 50));
?>
        <?php 
echo $form->error($profilesModel, 'address_line2');
?>
    </div>

    <div class="row">
        <?php 
echo $form->labelEx($profilesModel, 'city');
?>
        <?php 
echo $form->dropDownList($profilesModel, 'city', CHtml::listData(GeoCity::model()->findAll(), 'id', 'city'), array('empty' => 'Select'));
?>
        
        <?php 
echo $form->error($profilesModel, 'city');
?>
    </div>

    <div class="row">
        <?php 
echo $form->labelEx($profilesModel, 'state');
?>
 <?php 
echo $form->dropDownList($profilesModel, 'city', CHtml::listData(GeoState::model()->findAll(), 'id', 'state'), array('empty' => 'Select'));
?>
        <?php 
コード例 #23
0
ファイル: post.php プロジェクト: romeo14/wallfeet
        $cityid = $location;
        $cityList = CHtml::listData(GeoCity::model()->findAll(), 'id', 'city', 'state.state');
        echo CHtml::dropdownList('city_id[]', $cityid, $cityList, array('empty' => 'Select', 'class' => 'slctbox med'));
        echo '</li>';
    }
    echo '<li>';
    echo CHtml::ajaxLink('Add More', array('Agent/addMoreCity'), array('replace' => '#city_content_more'));
    echo '</li></ul><div id="city_content_more"></div>';
} else {
    ?>
<ul>
<li>
	<span>City<span class="required">*</span></span> 		
			<?php 
    $cityid = '';
    $cityList = CHtml::listData(GeoCity::model()->findAll(), 'id', 'city', 'state.state');
    // echo $form->dropdownList($locationCity,'city_id',$cityList,array('empty'=>'Select'));
    echo CHtml::dropdownList('city_id[]', $cityid, $cityList, array('empty' => 'Select', 'class' => 'slctbox med'));
    ?>
			
		
		</li>
	<li>&nbsp<?php 
    echo CHtml::ajaxLink('Add More', array('Agent/addMoreCity'), array('replace' => '#city_content_more'));
    ?>
</li>
</ul>
<div id="city_content_more"></div>
<?php 
}
?>
コード例 #24
0
ファイル: UserApi.php プロジェクト: romeo14/pow
 public static function getLocation($cityId)
 {
     $userModel = UserProfiles::model()->find('city_id=:cityId', array(':cityId' => $cityId));
     $address[] = "";
     if ($userModel) {
         $city = GeoCity::model()->findByPk($userModel->city_id);
         $address['city'] = $city ? $city->city : "";
         $state = GeoState::model()->findByPk($city->state_id);
         $address['state'] = $state->state;
         $country = GeoCountry::model()->findByPk($state->country_id);
         $address['country'] = $country->country;
         return $address;
     } else {
         return false;
     }
 }
コード例 #25
0
ファイル: post.php プロジェクト: romeo14/wallfeet
	<li class="error_message"><?php 
echo $form->error($model, 'state_id');
?>
</li>
</ul>



<div id="city_content">
<ul>
	<li><span><?php 
echo $form->labelEx($model, 'city_id');
?>
</span>
		<?php 
echo $form->dropdownList($model, 'city_id', CHtml::listData(GeoCity::model()->findAll('state_id=:state_id', array(':state_id' => $model->state_id)), 'id', 'city'), array('empty' => 'All', 'class' => 'slctbox', 'ajax' => array('type' => 'POST', 'url' => CController::createUrl('/location/locality/getList/page/project'), 'update' => '#locality_content', 'data' => 'js:jQuery(this).serialize()')));
?>
	</li>
	<li class="error_message"><?php 
echo $form->error($model, 'city_id');
?>
</li>
</ul>

<div id="locality_content">




<ul>
	<li><span><?php 
コード例 #26
0
ファイル: geo_profile.php プロジェクト: porem/yupe-ext
<?php

// @TODO пустой оператор ?: не доступен на php 5.1
$city_id = Yii::app()->request->getParam("GeoProfile[geo_city_id]") ?: ($model->geo_city_id ?: NULL);
if (!$city_id) {
    $guessed_city = Yii::app()->getModule("geo")->guessCity();
}
$city = $city_id && ($city = GeoCity::model()->with('country')->findByPk($city_id)) ? $city->combinedName : '';
?>
<div class="list">
    <div class="name">Город:</div>
    <div class="form">
    <?php 
$form->widget('zii.widgets.jui.CJuiAutoComplete', array('name' => 'GeoProfile[geo_city]', 'value' => $city, 'sourceUrl' => $this->createUrl('/geo/geo/cityAjax'), 'htmlOptions' => array('class' => 'span5'), 'options' => array('showAnim' => 'fold', 'select' => 'js: function(event, ui) {
                    $("#GeoProfile_geo_city_id").val(ui.item.id);
                 }')));
echo CHtml::hiddenField('GeoProfile[geo_city_id]', $city_id);
if (!$city_id && $guessed_city) {
    echo "<br /><small>Мы думаем, что вы из города <a href='#' onClick='\$(\"#GeoProfile_geo_city_id\").val(" . $guessed_city->id . ");\$(\"#GeoProfile_geo_city\").val(\$(this).text());return false;'>" . $guessed_city->combinedName . "</a>\n                  <br />. Кликните по ссылке, чтобы выбрать этот город.</small>";
}
?>
    </div>
    <div class="accession">&nbsp;</div>
</div>