/** * 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 = BuyProduct::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
$this->renderPartial('/default/left_side'); ?> </td> <td valign="top"> <div class="cont_right"> <h1><?php echo Yii::t('store', 'View Student Details'); ?> </h1> <div class="formCon"> <div class="formConInner"> <?php echo Yii::t('store', '<strong>Select Student ID</strong>') . ' '; echo CHtml::dropDownList('Book ID', isset($_REQUEST['id']) ? $_REQUEST['id'] : '', CHtml::listData(BuyProduct::model()->findAll(array('group' => 'student_id')), 'student_id', 'student_id'), array('prompt' => 'select', 'onchange' => "javascript:productlist();", 'id' => 'student_id')); if (isset($_REQUEST['id'])) { $product = BuyProduct::model()->findAll('student_id=:t2', array(':t2' => $_REQUEST['id'])); $student = Students::model()->findByAttributes(array('id' => $_REQUEST['id'])); if ($product != NULL) { ?> </div> </div> <div class="pdtab_Con" style="padding:0px;"> <table width="100%" cellpadding="0" cellspacing="0" border="0" > <tr class="pdtab-h"> <td align="center"><?php echo Yii::t('store', 'Student Name'); ?> </td> <td align="center"><?php echo Yii::t('store', 'Product Name'); ?>