Example #1
0
 public static function cityInit()
 {
     $cityActive = array();
     if (oreInstall::isInstalled()) {
         Yii::import('application.modules.apartmentCity.models.ApartmentCity');
         $cityActive = ApartmentCity::getActiveCity();
         if ($cityActive === null) {
             $cityActive = array();
         }
     }
     return $cityActive;
 }
Example #2
0
echo CHtml::label($model->getAttributeLabel('userType'), 'userType');
echo $form->dropDownList($model, 'type', CArray::merge(array(0 => tc('Please select')), User::getTypeList()), array('id' => 'userType'));
?>

<?php 
echo CHtml::label($model->getAttributeLabel('withListings'), 'withListings');
echo $form->dropDownList($model, 'withListings', CArray::merge(array('' => tc('Please select')), array(0 => tc('No'), 1 => tc('Ok'))), array('id' => 'withListings'));
?>

<?php 
if (issetModule('location')) {
    echo CHtml::label($model->getAttributeLabel('countryListing'), 'countryListing');
    echo CHtml::dropDownList('Mailing[countryListing]', isset($this->selectedCountry) ? $this->selectedCountry : '', Country::getCountriesArray(2), array('class' => 'width285 searchField', 'id' => 'countryListing', 'ajax' => array('type' => 'GET', 'url' => $this->createUrl('/location/main/getRegions'), 'data' => 'js:"country="+$("#countryListing").val()+"&type=2"', 'success' => 'function(result){
					$("#regionListing").html(result);
					$("#regionListing").change();
				}')));
    echo CHtml::label($model->getAttributeLabel('regionListing'), 'regionListing');
    echo CHtml::dropDownList('Mailing[regionListing]', isset($this->selectedRegion) ? $this->selectedRegion : '', Region::getRegionsArray(isset($this->selectedCountry) ? $this->selectedCountry : 0, 2), array('class' => 'width285 searchField', 'id' => 'regionListing', 'ajax' => array('type' => 'GET', 'url' => $this->createUrl('/location/main/getCities'), 'data' => 'js:"region="+$("#regionListing").val()+"&type=2"', 'success' => 'function(result){
					$("#cityListing").html(result);
					$("#cityListing").change();
				}')));
}
?>

<?php 
echo CHtml::label($model->getAttributeLabel('cityListing'), 'cityListing');
echo CHtml::dropDownList('Mailing[cityListing]', isset($this->selectedCity) ? $this->selectedCity : '', issetModule('location') ? City::getCitiesArray(isset($this->selectedRegion) ? $this->selectedRegion : 0, 2) : CArray::merge(array(0 => tc('select city')), ApartmentCity::getActiveCity()), array('class' => 'width285 searchField', 'id' => 'cityListing'));
?>

<?php 
$this->endWidget();