Beispiel #1
0
 public function actionFocus($id)
 {
     $model = new StudentTeacher();
     $model->student_id = $this->_user['studentId'];
     $model->teacher_id = $id;
     $model->save();
     $this->redirect($this->createUrl('/teacher/view', array('id' => $id)));
 }
Beispiel #2
0
 public function actionFocus($id)
 {
     //echo "$id";
     //print_r($this->_user);
     $model = new StudentTeacher();
     $model->student_id = $this->_user['studentId'];
     $model->teacher_id = $id;
     $model->save();
     $this->redirect('index');
     //print_r($model );
     //exit;
 }
Beispiel #3
0
 public function actionReview()
 {
     $message = false;
     $lesson = Lesson::model()->findByPk($_GET['id']);
     $model = StudentTeacher::model()->findByAttributes(array('student_id' => $this->_user['studentId'], 'teacher_id' => $lesson['teacher_id']));
     if (!count($model)) {
         $model = new StudentTeacher();
     }
     if (isset($_POST['StudentTeacher'])) {
         $model->attributes = $_POST['StudentTeacher'];
         $model->student_id = $this->_user['studentId'];
         $model->teacher_id = $lesson['teacher_id'];
         if ($model->save()) {
             $message = true;
         }
     }
     $this->render('review', array('lesson' => $lesson, 'message' => $message, 'model' => $model));
 }