?> <?php echo $form->textField($model, 'address_line2', array('size' => 66, 'maxlength' => 50, 'style' => 'width:500px;')); ?> <span class="status"> </span> <?php echo $form->error($model, 'address_line2'); ?> </div> <div class="row"> <div class="row-left"> <?php echo $form->labelEx($model, 'country'); ?> <?php echo $form->dropDownList($model, 'country', Country::items(), array('prompt' => 'Select Country', 'ajax' => array('type' => 'POST', 'url' => CController::createUrl('Organization/UpdateStates'), 'update' => '#Organization_state'))); ?> <span class="status"> </span> <?php echo $form->error($model, 'country'); ?> </div> <div class="row-right"> <?php echo $form->labelEx($model, 'state'); ?> <?php if (isset($model->state)) { echo $form->dropDownList($model, 'state', CHtml::listData(State::model()->findAll(array('condition' => 'country_id=' . $model->country)), 'state_id', 'state_name'), array('prompt' => 'Select State', 'ajax' => array('type' => 'POST', 'url' => CController::createUrl('Organization/UpdateCities'), 'update' => '#Organization_city')));
<span class="status"> </span> <?php echo $form->error($address, 'student_address_p_line2'); ?> </div> <div class="row"> <div class="row-left"> <?php echo $form->labelEx($address, 'student_address_p_country'); ?> <?php //echo $form->dropDownList($address,'student_address_p_country',Country::items(), array('empty' => '-----------Select---------','tabindex'=>9)); echo $form->dropDownList($address, 'student_address_p_country', Country::items(), array('prompt' => '-----------Select---------', 'tabindex' => 9, 'ajax' => array('type' => 'POST', 'url' => CController::createUrl('StudentTransaction/getItemName3'), 'dataType' => 'json', 'success' => 'function(data) { $("#StudentAddress_student_address_p_state").html(data.state); $("#StudentAddress_student_address_p_city").html(data.city); }'))); ?> <span class="status"> </span> <?php echo $form->error($address, 'student_address_p_country'); ?> </div> <div class="row-right"> <?php echo $form->labelEx($address, 'student_address_p_state');
echo $form->textField($address, 'student_address_p_line2', array('size' => 59, 'maxlength' => 100, 'tabindex' => 8)); ?> <span class="status"> </span> <?php echo $form->error($address, 'student_address_p_line2'); ?> </div> <div class="row"> <div class="row-right"> <?php echo $form->labelEx($address, 'student_address_p_country'); ?> <?php echo $form->dropDownList($address, 'student_address_p_country', Country::items(), array('prompt' => '-----------Select-----------', 'tabindex' => 9, 'ajax' => array('type' => 'POST', 'url' => CController::createUrl('dependent/UpdateStudPStates'), 'update' => '#StudentAddress_student_address_p_state'))); ?> <span class="status"> </span> <?php echo $form->error($address, 'student_address_p_country'); ?> </div> <div class="row-left"> <?php echo $form->labelEx($address, 'student_address_p_state'); ?> <?php if (isset($address->student_address_p_state)) { echo $form->dropDownList($address, 'student_address_p_state', CHtml::listData(State::model()->findAll(array('condition' => 'country_id=' . $address->student_address_p_country)), 'state_id', 'state_name'), array('prompt' => '-----------Select-----------', 'tabindex' => 10, 'ajax' => array('type' => 'POST', 'url' => CController::createUrl('dependent/UpdateStudPCities'), 'update' => '#StudentAddress_student_address_p_city'))); } else {
?> <?php echo $form->textField($model, 'state_name', array('size' => 22, 'maxlength' => 60)); ?> <span class="status"> </span> </div> <div class="row"> <?php echo $form->labelEx($model, 'country_id'); ?> <?php //echo $form->textField($model,'country_id',array('size'=>30,'maxlength'=>30)); ?> <?php echo $form->dropDownList($model, 'country_id', Country::items(), array('empty' => 'Select Country')); ?> <span class="status"> </span> <?php echo $form->error($model, 'country_id'); ?> </div> <div class="row buttons"> <?php echo CHtml::submitButton($model->isNewRecord ? 'Add' : 'Save', array('class' => 'submit')); ?> </div> <?php $this->endWidget();
<div class="row"> <?php echo $form->labelEx($model,'address_line1'); ?> <?php echo $form->textField($model,'address_line1',array('size'=>66,'maxlength'=>50,'style'=>'width:550px')); ?><span class="status"> </span> <?php echo $form->error($model,'address_line1'); ?> </div> <div class="row"> <?php echo $form->labelEx($model,'address_line2'); ?> <?php echo $form->textField($model,'address_line2',array('size'=>66,'maxlength'=>50,'style'=>'width:550px')); ?><span class="status"> </span> <?php echo $form->error($model,'address_line2'); ?> </div> <div class="row"> <div class="row-left"> <?php echo $form->labelEx($model,'country'); ?> <?php echo $form->dropDownList($model,'country', Country::items(), array( 'prompt' => 'Select Country', 'ajax' => array( 'type'=>'POST', 'url'=>CController::createUrl('Organization/UpdateStates'), 'update'=>'#Organization_state', //selector to update )));?><span class="status"> </span> <?php echo $form->error($model,'country'); ?> </div> <div class="row-right"> <?php echo $form->labelEx($model,'state'); ?> <?php if(isset($model->state)) echo $form->dropDownList($model,'state', CHtml::listData(State::model()->findAll(array('condition'=>'country_id='.$model->country)), 'state_id', 'state_name'),
$form = $this->beginWidget('CActiveForm', array('id' => 'city-form', 'enableAjaxValidation' => true, 'clientOptions' => array('validateOnSubmit' => true))); ?> <p class="note">Fields with <span class="required">*</span> are required.</p> <?php //echo $form->errorSummary($model); ?> <div class="row"> <?php echo $form->labelEx($model, 'country_id'); ?> <?php echo $form->dropDownList($model, 'country_id', Country::items(), array('prompt' => 'Select Country', 'ajax' => array('type' => 'POST', 'url' => CController::createUrl('dependent/getstatecity'), 'update' => '#City_state_id'), 'tabindex' => 21)); ?> <span class="status"> </span> <?php echo $form->error($model, 'country_id'); ?> </div> <div class="row"> <?php echo $form->labelEx($model, 'state_id'); ?> <?php if (isset($model->state_id)) { echo $form->dropDownList($model, 'state_id', CHtml::listData(State::model()->findAll(array('condition' => 'state_id=' . $model->state_id)), 'state_id', 'state_name')); } else { echo $form->dropDownList($model, 'state_id', array('empty' => 'Select State'));
echo $form->textField($address, 'employee_address_c_line2', array('size' => 59, 'maxlength' => 100, 'tabindex' => 2)); ?> <span class="status"> </span> <?php echo $form->error($address, 'employee_address_c_line2'); ?> </div> <div class="row"> <div class="row-right"> <?php echo $form->labelEx($address, 'employee_address_c_country'); ?> <?php echo $form->dropDownList($address, 'employee_address_c_country', Country::items(), array('prompt' => '-----------Select-----------', 'tabindex' => 3, 'ajax' => array('type' => 'POST', 'url' => CController::createUrl('dependent/UpdateEmpCStates'), 'update' => '#EmployeeAddress_employee_address_c_state'))); ?> <span class="status"> </span> <?php echo $form->error($address, 'employee_address_c_country'); ?> </div> <div class="row-left"> <?php echo $form->labelEx($address, 'employee_address_c_state'); ?> <?php if (isset($address->employee_address_c_state)) { echo $form->dropDownList($address, 'employee_address_c_state', CHtml::listData(State::model()->findAll(array('condition' => 'country_id=' . $address->employee_address_c_country)), 'state_id', 'state_name'), array('prompt' => '-----------Select-----------', 'tabindex' => 4, 'ajax' => array('type' => 'POST', 'url' => CController::createUrl('dependent/UpdateEmpCCities'), 'update' => '#EmployeeAddress_employee_address_c_city'))); } else {
<?php $form=$this->beginWidget('CActiveForm', array( 'id'=>'city-form', 'enableAjaxValidation'=>true, 'clientOptions'=>array('validateOnSubmit'=>true), )); ?> <p class="note">Fields with <span class="required">*</span> are required.</p> <?php //echo $form->errorSummary($model); ?> <div class="row"> <?php echo $form->labelEx($model,'country_id'); ?> <?php echo $form->dropDownList($model,'country_id', Country :: items(), array( 'prompt' => 'Select Country', 'ajax' => array( 'type'=>'POST', 'url'=>CController::createUrl('dependent/getstatecity'), 'update'=>'#City_state_id', //selector to update ),'tabindex'=>21)); ?><span class="status"> </span> <?php echo $form->error($model,'country_id'); ?> </div> <div class="row"> <?php echo $form->labelEx($model,'state_id'); ?>
<?php $this->widget('zii.widgets.grid.CGridView', array( 'id'=>'state-grid', 'dataProvider'=>$dataProvider, 'filter'=>$model, 'selectionChanged'=>"function(id){ window.location='" . Yii::app()->urlManager->createUrl('state/view', array('id'=>'')) . "' + $.fn.yiiGridView.getSelection(id); }", 'columns'=>array( array( 'header'=>'SI No', 'class'=>'IndexColumn', ), 'state_name', array( 'name'=>'country_id', 'value'=>'Country::model()->findByPk($data->country_id)->name', 'filter'=>Country::items(), ), array( 'class'=>'MyCButtonColumn', ), ), 'pager'=>array( 'class'=>'AjaxList', 'maxButtonCount'=>$model->count(), 'header'=>'' ), )); ?></div>
?> <?php echo $form->dropDownList($model, 'employee_address_p_state', State::items()); ?> <span class="status"> </span> <?php echo $form->error($model, 'employee_address_p_state'); ?> </div> <div class="row"> <?php echo $form->labelEx($model, 'employee_address_p_country'); ?> <?php echo $form->dropDownList($model, 'employee_address_p_country', Country::items()); ?> <span class="status"> </span> <?php echo $form->error($model, 'employee_address_p_country'); ?> </div> <div class="row"> <?php echo $form->labelEx($model, 'employee_address_phone'); ?> <?php echo $form->textField($model, 'employee_address_phone'); ?> <span class="status"> </span>
Yii::app()->clientScript->registerScript('search', "\n\$('.search-button').click(function(){\n\t\$('.search-form').toggle();\n\treturn false;\n});\n\$('.search-form form').submit(function(){\n\t\$.fn.yiiGridView.update('city-grid', {\n\t\tdata: \$(this).serialize()\n\t});\n\treturn false;\n});\n"); ?> <h1>Manage Cities</h1> <!--<p> You may optionally enter a comparison operator (<b><</b>, <b><=</b>, <b>></b>, <b>>=</b>, <b><></b> or <b>=</b>) at the beginning of each of your search values to specify how the comparison should be done. </p>--> <?php //echo CHtml::link('Advanced Search','#',array('class'=>'search-button')); ?> <div class="search-form" style="display:none"> <?php $this->renderPartial('_search', array('model' => $model)); ?> </div><!-- search-form --> <?php $dataProvider = $model->search(); if (Yii::app()->user->getState("pageSize", @$_GET["pageSize"])) { $pageSize = Yii::app()->user->getState("pageSize", @$_GET["pageSize"]); } else { $pageSize = Yii::app()->params['pageSize']; } $dataProvider->getPagination()->setPageSize($pageSize); ?> <?php $this->widget('zii.widgets.grid.CGridView', array('id' => 'city-grid', 'dataProvider' => $dataProvider, 'filter' => $model, 'columns' => array(array('header' => 'SI No', 'class' => 'IndexColumn'), 'city_name', array('name' => 'state_id', 'value' => 'State::item($data->state_id)', 'filter' => State::items()), array('name' => 'country_id', 'value' => 'Country::item($data->country_id)', 'filter' => Country::items()), array('class' => 'MyCButtonColumn')), 'pager' => array('class' => 'AjaxList', 'maxButtonCount' => $model->count(), 'header' => '')));
echo $form->labelEx($model, 'student_address_p_state'); ?> <?php echo $form->dropDownList($model, 'student_address_p_state', State::items()); ?> <?php echo $form->error($model, 'student_address_p_state'); ?> </div> <div class="row"> <?php echo $form->labelEx($model, 'student_address_p_country'); ?> <?php echo $form->dropDownList($model, 'student_address_p_country', Country::items()); ?> <?php echo $form->error($model, 'student_address_p_country'); ?> </div> <div class="row"> <?php echo $form->labelEx($model, 'student_address_phone'); ?> <?php echo $form->textField($model, 'student_address_phone'); ?> <?php echo $form->error($model, 'student_address_phone');
<?php echo $form->labelEx($address,'student_address_p_line1'); ?> <?php echo $form->textField($address,'student_address_p_line1',array('size'=>60,'style'=>'width:auto')); ?><span class="status"> </span> <?php echo $form->error($address,'student_address_p_line1'); ?> </div> <div class="row"> <?php echo $form->labelEx($address,'student_address_p_line2'); ?> <?php echo $form->textField($address,'student_address_p_line2',array('size'=>60,'style'=>'width:auto')); ?><span class="status"> </span> <?php echo $form->error($address,'student_address_p_line2'); ?> </div> <div class="row"> <div class="row-right"> <?php echo $form->labelEx($address,'student_address_p_country'); ?> <?php echo $form->dropDownList($address,'student_address_p_country',Country::items(), array( 'prompt' => 'Select Country', 'ajax' => array( 'type'=>'POST', 'url'=>CController::createUrl('dependent/UpdateStudPStates'), 'update'=>'#StudentAddress_student_address_p_state', //selector to update ))); ?><span class="status"> </span> <?php echo $form->error($address,'student_address_p_country'); ?> </div> <div class="row-left"> <?php echo $form->labelEx($address,'student_address_p_state'); ?> <?php if(!empty($address->student_address_p_state) && !empty($address->student_address_p_country)) echo $form->dropDownList($address,'student_address_p_state', CHtml::listData(State::model()->findAll(array('condition'=>'country_id='.$address->student_address_p_country)), 'state_id', 'state_name'),
<?php //echo $form->error($address,'employee_address_p_taluka'); ?> </div> <div class="row-right"> <?php //echo $form->labelEx($address,'employee_address_p_district'); ?> <?php //echo $form->textField($address,'employee_address_p_district',array('size'=>13)); ?><span class="status"> </span> <?php //echo $form->error($address,'employee_address_p_district'); ?> </div> </div--> <div class="row"> <div class="row-right"> <?php echo $form->labelEx($address,'employee_address_p_country'); ?> <?php echo $form->dropDownList($address,'employee_address_p_country' ,Country::items(), array( 'prompt' => 'Select Country', 'ajax' => array( 'type'=>'POST', 'url'=>CController::createUrl('dependent/UpdateEmpPStates'), 'update'=>'#EmployeeAddress_employee_address_p_state', //selector to update ))); ?><span class="status"> </span> <?php echo $form->error($address,'employee_address_p_country'); ?> </div> <div class="row-left"> <?php echo $form->labelEx($address,'employee_address_p_state'); ?> <?php
'id'=>'state-form', 'enableAjaxValidation'=>true, 'clientOptions'=>array('validateOnSubmit'=>true), )); ?> <p class="note">Fields with <span class="required">*</span> are required.</p> <?php //echo $form->errorSummary($model); ?> <div class="row"> <?php echo $form->labelEx($model,'state_name'); ?> <?php echo $form->textField($model,'state_name',array('size'=>22,'maxlength'=>60)); ?> <span class="status"> </span><?php echo $form->error($model,'state_name'); ?> </div> <div class="row"> <?php echo $form->labelEx($model,'country_id'); ?> <?php //echo $form->textField($model,'country_id',array('size'=>30,'maxlength'=>30)); ?> <?php echo $form->dropDownList($model,'country_id', Country::items(), array('empty' => 'Select Country')); ?><span class="status"> </span> <?php echo $form->error($model,'country_id'); ?> </div> </div><!-- form --> <div class="row buttons"> <?php echo CHtml::submitButton($model->isNewRecord ? 'Add' : 'Save',array('class'=>'submit')); ?> <?php echo CHtml::link('Cancel', array('admin'), array('class'=>'btnCan')); ?> </div> <?php $this->endWidget(); ?> </div>
<?php echo CHtml::link('PDF', array('exportToPDFExcel/StateExportToPdf'), array('class' => 'btnyellow', 'target' => '_blank')); echo CHtml::link('Excel', array('exportToPDFExcel/StateExportToExcel'), array('class' => 'btnblue')); ?> </div> <div class="portlet box blue"> <div class="portlet-title"> States </div> <?php echo CHtml::link('Add New +', array('state/create'), array('class' => 'btn green')); ?> <?php $dataProvider = $model->search(); if (Yii::app()->user->getState("pageSize", @$_GET["pageSize"])) { $pageSize = Yii::app()->user->getState("pageSize", @$_GET["pageSize"]); } else { $pageSize = Yii::app()->params['pageSize']; } $dataProvider->getPagination()->setPageSize($pageSize); ?> <?php $this->widget('zii.widgets.grid.CGridView', array('id' => 'state-grid', 'dataProvider' => $dataProvider, 'filter' => $model, 'selectionChanged' => "function(id){\n\t\twindow.location='" . Yii::app()->urlManager->createUrl('state/view', array('id' => '')) . "' + \$.fn.yiiGridView.getSelection(id);\n\t}", 'columns' => array(array('header' => 'SI No', 'class' => 'IndexColumn'), 'state_name', array('name' => 'country_id', 'value' => 'Country::item($data->country_id)', 'filter' => Country::items())), 'pager' => array('class' => 'AjaxList', 'maxButtonCount' => $model->count(), 'header' => ''))); ?> </div>