/** * 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 WLectureCat the loaded model * @throws CHttpException */ public function loadModel($id) { $model = WLectureCat::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
public static function DeleteLectureCat($page_id) { $model = WLectureCat::model()->find("id=" . $page_id); if ($model->delete()) { return TRUE; } return FALSE; }
?> <br/> <span class="font11"><?php echo $form->error($model, 'lecture_name'); ?> </span> </td> </tr> <tr> <td valign="top"><?php echo Yii::t('web/home', 'Category'); ?> </td> <td valign="top"> <?php echo $form->dropDownList($model, 'lecture_cat_id', CHtml::listData(WLectureCat::model()->findAll(), 'id', 'cat_name'), array('prompt' => '--Select Category--', 'class' => 'form-control', 'style' => 'width:180px;')); ?> </td> </tr> <tr> <td valign=""><?php echo Yii::t('web/home', 'Kind of lecture'); ?> </td> <td valign="top"> <div class="radio fl" style="margin: 10px 25px;"> <label> <input type="radio" name="WLecture[lecture_type]" <?php echo (!empty($model->lecture_type) and $model->lecture_type == 1) ? 'checked="checked"' : ''; ?> onclick="return showBoxVOD(this);" id="optionsRadios1" value="1" checked> <?php