Beispiel #1
0
 public function actionAddpoint($id)
 {
     $student = Students::model()->findByPk($id);
     $bonus = new Points();
     if (isset($_REQUEST['Points'])) {
         $data = $_REQUEST['Points'];
         $bonus->student = $data['student'];
         $bonus->earned = $data['earned'];
         $bonus->comment = $data['comment'];
         $bonus->by = $data['by'];
         if ($bonus->save()) {
             Yii::app()->notify->add("Бонус добавлен");
         } else {
             Yii::app()->notify->addErrors($bonus->getErrors());
         }
     }
     $this->render('addpoint', array('student' => $student, "point" => $bonus));
 }