?> <div class="col-md-6 col-xs-12"> <?php echo CHtml::activeTextField($address, 'street2', array('size' => 60, 'maxlength' => 100, 'class' => 'form-control')); ?> <div id="errorStreet2" class="errorMessage"></div> </div> </div> <div class="form-group"> <?php echo CHtml::activeLabelEx($address, 'country_id', array('class' => $label_class)); ?> <div class="col-md-6 col-xs-12"> <?php $datas = CHtml::listData(ReferenceGeoCountries::model()->byOrder()->findAll(), 'id', 'name'); echo CHtml::activeDropDownList($address, 'country_id', $datas, array('data-placeholder' => at('Please select one...'), 'prompt' => '', 'data-live-search' => 'true', 'class' => 'validate[required] form-control select')); ?> <div id="errorCountry_id" class="errorMessage"></div> </div> </div> <div class="form-group"> <?php echo CHtml::activeLabelEx($address, 'state_id', array('class' => $label_class)); ?> <div class="col-md-6 col-xs-12"> <?php echo CHtml::activeDropDownList($address, 'state_id', CHtml::listData(ReferenceGeoStates::model()->byCountry($address->country_id)->byOrder()->findAll(), 'id', 'name'), array('data-placeholder' => at('Please select one...'), 'prompt' => '', 'data-live-search' => 'true', 'class' => 'validate[required] form-control select')); ?> <div id="errorState_id" class="errorMessage"></div>
?> <div class="col-md-6 col-xs-12"> <?php echo CHtml::activeTextField($employment, 'company_address_street2', array('size' => 60, 'maxlength' => 100, 'class' => 'validate[required] form-control')); ?> <div id="error_company_address_street2" class="errorMessage"></div> </div> </div> <div class="form-group"> <?php echo CHtml::activeLabelEx($employment, 'company_address_country_id', array('class' => $label_class)); ?> <div class="col-md-6 col-xs-12"> <?php echo CHtml::activeDropDownList($employment, 'company_address_country_id', CHtml::listData(ReferenceGeoCountries::model()->byOrder()->findAll(), 'id', 'name'), array('data-placeholder' => at('Please select one...'), 'prompt' => '', 'data-live-search' => 'true', 'class' => 'validate[required] form-control select')); ?> <div id="error_company_address_country_id" class="errorMessage"></div> </div> </div> <div class="form-group"> <?php echo CHtml::activeLabelEx($employment, 'company_address_state_id', array('class' => $label_class)); ?> <div class="col-md-6 col-xs-12"> <?php echo CHtml::activeDropDownList($employment, 'company_address_state_id', CHtml::listData(ReferenceGeoStates::model()->byCountry($employment->company_address_country_id)->byOrder()->findAll(), 'id', 'name'), array('data-placeholder' => at('Please select one...'), 'prompt' => '', 'data-live-search' => 'true', 'class' => 'validate[required] form-control select')); ?> <div id="error_company_address_state_id" class="errorMessage"></div> </div>
</div> <div class="col-md-6"> <div class="panel panel-default"> <div class="panel-heading"> <h3>Birthday</h3> </div> <div class="panel-body"> <div class="form-group"> <?php echo CHtml::activeLabelEx($model, 'birthplace_country_id', array('class' => $label_class)); ?> <div class="col-md-6 col-xs-12"> <?php echo CHtml::activeDropDownList($model, 'birthplace_country_id', CHtml::listData(ReferenceGeoCountries::model()->byOrder()->findAll(), 'id', 'name'), array('data-placeholder' => at('Please select one...'), 'prompt' => '', 'data-live-search' => 'true', 'class' => 'validate[required] form-control select', 'ajax' => array('type' => 'GET', 'url' => array('geography/countries/dynamicStates'), 'data' => array('id' => 'js:this.value'), 'success' => 'function(data){ updateDropdown(this, $("#' . $form_name . '_birthplace_state_id"), data); }'))); ?> <?php echo CHtml::error($model, 'birthplace_country_id'); ?> </div> </div> <div class="form-group"> <?php echo CHtml::activeLabelEx($model, 'birthplace_state_id', array('class' => $label_class)); ?> <div class="col-md-6 col-xs-12"> <?php
/** * Returns the data model based on the primary key given in the GET variable. * If the data model is not found, an HTTP exception will be raised. * @param integer $id the ID of the model to be loaded * @return ReferenceGeoCountries the loaded model * @throws CHttpException */ public function loadModel($id) { $model = ReferenceGeoCountries::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }