/** * 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 NtpLaboratoryRequest the loaded model * @throws CHttpException */ public function loadModel($id) { $model = NtpLaboratoryRequest::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
public static function getReasonsForExamination() { $reasons = ZHtml::enumItem(NtpLaboratoryRequest::model(), 'reason_for_examination'); $reasons[''] = ''; asort($reasons); return $reasons; }
<?php echo $form->label($model, 'submission_date', array('class' => 'control-label col-sm-4')); ?> <div class="col-sm-8"> <?php echo $form->dateField($model, 'submission_date', array('class' => 'form-control')); ?> </div> </div> <div class="form-group"> <?php echo $form->label($model, 'reason_for_examination', array('class' => 'control-label col-sm-4')); ?> <div class="col-sm-8"> <?php echo $form->dropDownList($model, 'reason_for_examination', NtpLaboratoryRequest::getReasonsForExamination(), array('class' => 'form-control')); ?> </div> </div> <div class="form-group"> <div class="col-lg-offset-4 col-lg-8"> <?php echo CHtml::submitButton('Search', array('class' => 'btn btn-success')); ?> </div> </div> <?php $this->endWidget();