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' => '')));
<?php $this->widget('zii.widgets.grid.CGridView', array( 'dataProvider'=>$model, 'summaryText'=>false, 'enableSorting'=>false, 'enablePagination' => false, 'columns'=>array( array( 'header'=>'SI No', 'class'=>'IndexColumn', ), 'city_name', array( 'name'=>'state_id', 'value'=>'State::model()->findByPk($data->state_id)->state_name', 'filter'=> State::items(), ), array( 'name'=>'country_id', 'value'=>'Country::model()->findByPk($data->country_id)->name', 'filter'=> Country::items(), ), ), )); ?>
echo $form->labelEx($model, 'student_address_p_pin'); ?> <?php echo $form->textField($model, 'student_address_p_pin'); ?> <?php echo $form->error($model, 'student_address_p_pin'); ?> </div> <div class="row"> <?php 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');
?> <?php echo $form->textField($model, 'employee_address_p_pincode'); ?> <span class="status"> </span> <?php echo $form->error($model, 'employee_address_p_pincode'); ?> </div> <div class="row"> <?php echo $form->labelEx($model, 'employee_address_p_state'); ?> <?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>
<div class="operation"> <?php echo CHtml::link('PDF', array('exportToPDFExcel/CityExportToPdf'), array('class' => 'btnyellow', 'target' => '_blank')); echo CHtml::link('Excel', array('exportToPDFExcel/CityExportToExcel'), array('class' => 'btnblue')); ?> </div> <div class="portlet box blue"> <div class="portlet-title"> City </div> <?php echo CHtml::link('Add New +', array('city/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' => 'city-grid', 'dataProvider' => $dataProvider, 'filter' => $model, 'selectionChanged' => "function(id){\n\t\twindow.location='" . Yii::app()->urlManager->createUrl('city/view', array('id' => '')) . "' + \$.fn.yiiGridView.getSelection(id);\n\t}", 'columns' => array(array('header' => 'SI No', 'class' => 'IndexColumn'), 'city_name', array('name' => 'state_id', 'value' => 'State::item($data->state_id)', 'filter' => State::items())), 'pager' => array('class' => 'AjaxList', 'maxButtonCount' => $model->count(), 'header' => ''))); ?> </div>