/**
  * 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 = Levelorg::model()->findByPk((int) $id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
Пример #2
0
?>
		</td>
		<td>
		<?php 
echo $form->labelEx($model, 'levelorgid');
?>
    <?php 
echo $form->hiddenField($model, 'levelorgid');
?>
    <input type="text" name="levelorgname" id="levelorgname" readonly style="width:75%" value="<?php 
echo Position::model()->findByPk($model->levelorgid) !== null ? Position::model()->findByPk($model->levelorgid)->levelorgname : '';
?>
">
    <?php 
$this->beginWidget('zii.widgets.jui.CJuiDialog', array('id' => 'levelorg_dialog', 'options' => array('title' => Yii::t('app', 'Level Organization'), 'width' => 'auto', 'autoOpen' => false, 'modal' => true)));
$levelorg = new Levelorg('searchwstatus');
$levelorg->unsetAttributes();
// clear any default values
if (isset($_GET['Levelorg'])) {
    $levelorg->attributes = $_GET['Levelorg'];
}
$this->widget('zii.widgets.grid.CGridView', array('id' => 'levelorg-grid', 'dataProvider' => $levelorg->searchwstatus(), 'filter' => $levelorg, '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" => "$(\\"#levelorg_dialog\\").dialog(\\"close\\"); $(\\"#levelorgname\\").val(\\"$data->levelorgname\\"); 
		  $(\\"#Employee_levelorgid\\").val(\\"$data->levelorgid\\");"))'), array('name' => 'levelorgid', 'visible' => false, 'value' => '$data->levelorgid', 'htmlOptions' => array('width' => '1%')), 'levelorgname')));
$this->endWidget('zii.widgets.jui.CJuiDialog');
echo CHtml::Button('...', array('onclick' => '$("#levelorg_dialog").dialog("open"); return false;'));
?>
    <?php 
echo $form->error($model, 'positionid');