Esempio n. 1
0
?>
    <?php 
echo $form->error($model, 'positionid');
?>
		</td>
	</tr>
	<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')));
 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param integer the ID of the model to be loaded
  */
 public function loadModel($id)
 {
     $model = Employeetype::model()->findByPk((int) $id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }