示例#1
0
 /**
  * Manages all models.
  */
 public function actionIndex()
 {
     if (isset($_GET['ID'])) {
         $_SESSION['course_id'] = $_GET['ID'];
     } else {
         $_SESSION['course_id'] = 1;
     }
     $course = Course::getCourseById($_SESSION['course_id']);
     $model = new Semester('search');
     $model->unsetAttributes();
     // clear any default values
     if (!empty($course)) {
         $model->ID_Course = $course->Name;
     }
     if (isset($_GET['Semester'])) {
         $model->attributes = $_GET['Semester'];
     }
     $this->render('admin', array('model' => $model));
 }
示例#2
0
 /**
  * Manages all models.
  */
 public function actionAdmin()
 {
     $model = new Semester('search');
     $model->unsetAttributes();
     // clear any default values
     if (isset($_GET['Semester'])) {
         $model->attributes = $_GET['Semester'];
     }
     $this->render('admin', array('model' => $model));
 }