/** * Manages all models. */ public function actionAdmin() { $model = new Religion('search'); $model->unsetAttributes(); // clear any default values if (isset($_GET['Religion'])) { $model->attributes = $_GET['Religion']; } $this->render('admin', array('model' => $model)); }
/** * Lists all models. */ public function actionIndex() { parent::actionIndex(); $model = new Religion('search'); $model->unsetAttributes(); // clear any default values if (isset($_GET['Religion'])) { $model->attributes = $_GET['Religion']; } if (isset($_GET['pageSize'])) { Yii::app()->user->setState('pageSize', (int) $_GET['pageSize']); unset($_GET['pageSize']); // would interfere with pager and repetitive page size change } $this->render('index', array('model' => $model)); }
<td> <div class="row"> <?php echo $form->labelEx($model, 'religionid'); ?> <?php echo $form->hiddenField($model, 'religionid'); ?> <input type="text" name="religion_name" id="religion_name" style="width:75%" readonly value="<?php echo Religion::model()->findByPk($model->religionid) !== null ? Religion::model()->findByPk($model->religionid)->religionname : ''; ?> "> <?php $this->beginWidget('zii.widgets.jui.CJuiDialog', array('id' => 'religion_dialog', 'options' => array('title' => Yii::t('app', 'Religion'), 'width' => 'auto', 'autoOpen' => false, 'modal' => true))); $religion = new Religion('searchwstatus'); $religion->unsetAttributes(); // clear any default values if (isset($_GET['Religion'])) { $religion->attributes = $_GET['Religion']; } $this->widget('zii.widgets.grid.CGridView', array('id' => 'religion-grid', 'dataProvider' => $religion->Searchwstatus(), 'filter' => $religion, 'template' => '{summary}{pager}<br>{items}{pager}{summary}', 'columns' => array(array('header' => '', 'type' => 'raw', 'value' => 'CHtml::Button("V", array("name" => "send_religion", "id" => "send_religion", "onClick" => "$(\\"#religion_dialog\\").dialog(\\"close\\"); $(\\"#religion_name\\").val(\\"$data->religionname\\"); $(\\"#Employee_religionid\\").val(\\"$data->religionid\\");"))'), array('name' => 'religionid', 'visible' => false, 'value' => '$data->religionid', 'htmlOptions' => array('width' => '1%')), 'religionname'))); $this->endWidget('zii.widgets.jui.CJuiDialog'); echo CHtml::Button('...', array('onclick' => '$("#religion_dialog").dialog("open"); return false;')); ?> <?php echo $form->error($model, 'religionid'); ?> </div>