/**
  * 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 $id the ID of the model to be loaded
  * @return Desination the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = Desination::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
示例#2
0
    <?php 
$form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array('id' => 'challaning-officer-form', 'enableAjaxValidation' => false));
?>

    <p class="help-block">Fields with <span class="required">*</span> are required.</p>

    <?php 
echo $form->errorSummary($model);
?>

            <?php 
echo $form->textFieldControlGroup($model, 'name', array('span' => 5, 'maxlength' => 145));
?>

            <?php 
echo $form->dropDownListControlGroup($model, 'designation', CHtml::listData(Desination::model()->findAll(array('order' => 'designation ASC')), 'id', 'designation'), array('span' => 5, 'maxlength' => 45));
?>

            <?php 
echo $form->dropDownListControlGroup($model, 'place_of_posting', CHtml::listData(PlaceOfPosting::model()->findAll(array('order' => 'place ASC')), 'id', 'place'), array('span' => 5, 'maxlength' => 45));
?>

            <?php 
echo $form->textFieldControlGroup($model, 'date_of_joining', array('span' => 5, 'data-provide' => 'datepicker'));
?>

            <?php 
echo $form->textAreaControlGroup($model, 'remarks', array('rows' => 6, 'span' => 8));
?>

        <div class="form-actions">