public function actionPosttest() { $cs = Yii::app()->getClientScript(); $cs->registerCssFile(Yii::app()->theme->baseUrl . '/css/jquery-ui.css?ver=' . time()); $cs->registerCssFile(Yii::app()->theme->baseUrl . '/css/dialog.css?ver=' . time()); //$cs->registerCssFile(Yii::app()->theme->baseUrl.'/css/jquery.countdown.css?ver='.time()); $cs->registerScriptFile(Yii::app()->theme->baseUrl . '/js/jquery.simplemodal-1.4.4.js', CClientScript::POS_END); $cs->registerScriptFile(Yii::app()->theme->baseUrl . '/js/jquery-ui.js'); $cs->registerScriptFile(Yii::app()->theme->baseUrl . '/js/jquery.slimscroll.min.js'); $data = WCourseLecture::MyTest($test_id = NULL, $course_id = NULL, $lecture_id = NULL, 2); //$testLectureOk = WUserTest::getTestByLectureLog(); $arrCo = WCourseTrainee::getListCourseTrainee(); $this->render('posttest', array('data' => $data, 'listcourse' => $arrCo)); }
<?php $data = WCourseLecture::MyTest(NULL, $course_id, NULL, $test_kind); $total = WCourseLecture::getTotalPages(NULL, $course_id, NULL, $test_kind); $page = ceil($total / 10); if (!empty($data)) { ?> <div id="datalistmytest"> <?php foreach ($data as $key => $item) { ?> <div class="dataList_item_test"> <a href="#" class="item_direct"> <?php if (!empty($item["avatar"])) { ?> <img class="img-thumbnail" src="<?php echo Yii::app()->params['url_base'] . '/uploads/avatars/test/' . $item["avatar"]; ?> " /> <?php } else { ?> <img class="img-thumbnail" src="<?php echo Yii::app()->theme->baseUrl; ?> /img/pre-test.gif" /> <?php } ?> </a>