<tr> <td> <?php echo $form->labelEx($model, 'employeetypeid'); ?> <?php echo $form->hiddenField($model, 'employeetypeid'); ?> <input type="text" name="employeetypename" id="employeetypename" readonly style="width:75%" value="<?php echo Employeetype::model()->findByPk($model->employeetypeid) !== null ? Employeetype::model()->findByPk($model->employeetypeid)->employeetypename : ''; ?> "> <?php $this->beginWidget('zii.widgets.jui.CJuiDialog', array('id' => 'employeetype_dialog', 'options' => array('title' => Yii::t('app', 'Employee Type'), 'width' => 'auto', 'autoOpen' => false, 'modal' => true))); $employeetype = new Employeetype('searchwstatus'); $employeetype->unsetAttributes(); // clear any default values if (isset($_GET['Employeetype'])) { $employeetype->attributes = $_GET['Employeetype']; } $this->widget('zii.widgets.grid.CGridView', array('id' => 'employeetype-grid', 'dataProvider' => $employeetype->searchwstatus(), 'filter' => $employeetype, 'template' => '{summary}{pager}<br>{items}{pager}{summary}', 'columns' => array(array('header' => '', 'type' => 'raw', 'value' => 'CHtml::Button("V", array("name" => "send_absstatus", "id" => "send_absstatus", "onClick" => "$(\\"#employeetype_dialog\\").dialog(\\"close\\"); $(\\"#employeetypename\\").val(\\"$data->employeetypename\\"); $(\\"#Employee_employeetypeid\\").val(\\"$data->employeetypeid\\");"))'), array('name' => 'employeetypeid', 'visible' => false, 'value' => '$data->levelorgid', 'htmlOptions' => array('width' => '1%')), 'employeetypename'))); $this->endWidget('zii.widgets.jui.CJuiDialog'); echo CHtml::Button('...', array('onclick' => '$("#employeetype_dialog").dialog("open"); return false;')); ?> <?php echo $form->error($model, 'employeetypeid'); ?>
/** * Lists all models. */ public function actionIndex() { parent::actionIndex(); $this->lookupdata(); $model = new Employeetype('search'); $model->unsetAttributes(); // clear any default values if (isset($_GET['Employeetype'])) { $model->attributes = $_GET['Employeetype']; } $this->render('index', array('model' => $model, 'snro' => $this->snro, 'sicksnro' => $this->sicksnro, 'sickstatus' => $this->sickstatus)); }