public function actionAdmin() { $model = new Imirenge('search'); $model->unsetAttributes(); if (isset($_GET['Imirenge'])) { $model->setAttributes($_GET['Imirenge']); } $this->render('admin', array('model' => $model)); }
<div class="row"> <?php echo $form->label($model, 'iddistrict'); ?> <?php echo $form->textField($model, 'iddistrict'); ?> </div> <div class="row"> <?php echo $form->label($model, 'idumurenge'); ?> <?php echo $form->dropDownList($model, 'idumurenge', GxHtml::listDataEx(Imirenge::model()->findAllAttributes(null, true)), array('prompt' => Yii::t('app', 'All'))); ?> </div> <div class="row"> <?php echo $form->label($model, 'akagali'); ?> <?php echo $form->textField($model, 'akagali', array('maxlength' => 20)); ?> </div> <div class="row"> <?php echo $form->label($model, 'umudugudu'); ?>
public function actionCitydata() { //check if isAjaxRequest and the needed GET params are set ECascadeDropDown::checkValidRequest(); //load the cities for the current province id (=ECascadeDropDown::submittedKeyValue()) $data = Imirenge::model()->findAll('iddistrict=:iddistrict', array(':iddistrict' => ECascadeDropDown::submittedKeyValue())); //Convert the data by using //CHtml::listData, prepare the JSON-Response and Yii::app()->end ECascadeDropDown::renderListData($data, 'id', 'umurenge'); }
<?php $this->breadcrumbs = array(Imirenge::label(2), Yii::t('app', 'Index')); $this->beginWidget('zii.widgets.CPortlet', array('htmlOptions' => array('class' => ''))); $this->widget('bootstrap.widgets.TbMenu', array('type' => 'pills', 'items' => array(array('label' => 'Create', 'icon' => 'icon-plus', 'url' => Yii::app()->controller->createUrl('create'), 'linkOptions' => array()), array('label' => 'List', 'icon' => 'icon-th-list', 'url' => Yii::app()->controller->createUrl('index'), 'active' => true, 'linkOptions' => array()), array('label' => 'Manage', 'icon' => 'icon-search', 'url' => Yii::app()->controller->createUrl('admin'), 'linkOptions' => array('class' => 'search-button')), array('label' => 'Export to PDF', 'icon' => 'icon-download', 'url' => Yii::app()->controller->createUrl('GeneratePdf'), 'linkOptions' => array('target' => '_blank'), 'visible' => true), array('label' => 'Export to Excel', 'icon' => 'icon-download', 'url' => Yii::app()->controller->createUrl('GenerateExcel'), 'linkOptions' => array('target' => '_blank'), 'visible' => true)))); $this->endWidget(); ?> <h3><?php echo GxHtml::encode(Imirenge::label(2)); ?> </h3> <?php $this->widget('zii.widgets.CListView', array('dataProvider' => $dataProvider, 'itemView' => '_view'));
<?php $uturere = CHtml::listData(IguDistrict::model()->findAll(array('order' => 'district')), 'id', 'district'); echo CHtml::activeDropDownList($model, 'iddistrict', $uturere, array('id' => 'id_district', 'prompt' => 'Hitamo Akarere')); ?> <?php echo $form->error($model, 'iddistrict'); ?> </div><!-- row --> </td> <td> <div class="row"> <?php echo $form->labelEx($model, 'idumurenge'); ?> <?php $imirenge = CHtml::listData(Imirenge::model()->findAll('iddistrict=:iddistrict', array(':iddistrict' => $model->iddistrict)), 'id', 'umurenge'); echo CHtml::activeDropDownList($model, 'idumurenge', $imirenge, array('id' => 'id_umurenge', 'prompt' => 'Hitamo Umurenge')); ECascadeDropDown::master('id_district')->setDependent('id_umurenge', array('dependentLoadingLabel' => 'Loading Imirenge ...'), 'site/citydata'); ?> <?php echo $form->error($model, 'idumurenge'); ?> </div><!-- row --> </td> </tr> <tr> <td> <div class="row"> <?php echo $form->labelEx($model, 'akagali');