/**
  * 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 PlaceOfPosting the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = PlaceOfPosting::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
Ejemplo n.º 2
0
    <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">
        <?php 
echo TbHtml::submitButton($model->isNewRecord ? 'Create' : 'Save', array('color' => TbHtml::BUTTON_COLOR_PRIMARY, 'size' => TbHtml::BUTTON_SIZE_LARGE));
?>
    </div>