/** * 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 WQuestionCatLib the loaded model * @throws CHttpException */ public function loadModel($id) { $model = WQuestionCatLib::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
?> </center> </div> </center> </div> <?php } ?> <div class="type_question" style="width: 100%; margin-bottom: 10px"> <label for="WQuestion_question_type_update" class="col-sm-2 control-label required"><?php echo Yii::t('web/home', 'Category Question'); ?> </label> <div class="col-xs-6 col-sm-4"> <?php echo CHtml::dropDownList('question_cat_id', 'id', CHtml::listData(WQuestionCatLib::model()->findAll(), 'id', 'question_cat'), array('prompt' => '--' . Yii::t('web/home', 'Chọn Nhóm') . '--', 'class' => 'form-control', 'style' => 'width:180px;', "id" => "question_cat_id_update", "options" => array($data["question_cat_id"] => array("selected" => true)))); ?> </div> </div> <div class="type_question" style="width: 100%;"> <label for="WQuestion_question_type_update" class="col-sm-2 control-label required"><?php echo Yii::t('web/home', 'Loại câu hỏi'); ?> </label> <div class="col-xs-6 col-sm-4"> <select id="WQuestion_question_type_update" name="question_type" onchange="return OnChangeQuestionType(this)" style="width:140px;" class="form-control"> <option value="1" <?php echo $data["question_type"] == 1 ? "selected='selected'" : ""; ?> ><?php echo Yii::t('web/home', 'One answer');
</div> </div> <div class="primary_container"> <div class="primary_container_test" style="box-shadow: 0px 0px 0px; border: 0px; "> <div class="container_test" style="padding-top: 0px"> <div class="box_test"> <div class="form-group"> <div class="col-sm-10"> <div class="questiontest" style="margin-top: 0px;"> <div class="content_question"> <form id="formQuestion"> <div class="type_question" style="width: 100%; margin-bottom: 10px"> <label for="WQuestion_question_type" class="col-sm-2 control-label required">Chuyên đề</label> <div class="col-xs-6 col-sm-4"> <?php echo CHtml::dropDownList('question_cat_id', 'id', CHtml::listData(WQuestionCatLib::model()->findAll(), 'id', 'question_cat'), array('prompt' => '--' . Yii::t('web/home', 'Chọn chuyên đề') . '--', 'class' => 'form-control', 'style' => 'width:250px;')); ?> </div> </div> <div class="type_question" style="width: 100%;"> <label for="WQuestion_question_type" class="col-sm-2 control-label required"><?php echo Yii::t('web/home', 'Loại câu hỏi'); ?> </label> <div class="col-xs-6 col-sm-4"> <select id="WQuestion_question_type" name="question_type" onchange="return OnChangeQuestionType(this)" style="width:140px;" class="form-control"> <option value="1"><?php echo Yii::t('web/home', 'One answer'); ?> </option> <option value="4"><?php
public static function DeleteQuestionLibCat($page_id) { $model = WQuestionCatLib::model()->find("id=" . $page_id); if ($model->delete()) { return TRUE; } return FALSE; }