/** * 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 Hoadon the loaded model * @throws CHttpException */ public function loadModel($id) { $model = Hoadon::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
echo $form->labelEx($model, 'sanpham_id'); ?> <?php echo $form->dropDownList($model, 'sanpham_id', Sanpham::model()->getSanphamsName()); ?> <?php echo $form->error($model, 'sanpham_id'); ?> </div> <div class="form-group"> <?php echo $form->labelEx($model, 'hoadon_id'); ?> <?php echo $form->dropDownList($model, 'hoadon_id', Hoadon::model()->getHoadonId()); ?> <?php echo $form->error($model, 'hoadon_id'); ?> </div> <div class="form-group"> <?php echo $form->labelEx($model, 'soluongmua'); ?> <?php echo $form->textField($model, 'soluongmua', array('class' => 'form-control')); ?> <?php echo $form->error($model, 'soluongmua');