示例#1
0
 public function postAction()
 {
     try {
         if (!$this->request->getPost()) {
             throw new Exception('こらっ');
         }
         $schedule = new Schedule();
         $is_able_to_post_impression = $schedule->is_in_time('impre', $this->current_time);
         if ($is_able_to_post_impression) {
             $bms_no = $this->request->getPost('bms_no');
             $impression = new Impression($bms_no);
             $impression->post($this->request->getPost(), $this->current_time, $this->ip, $this->host);
             $bms_info = new BmsInfo();
             $bms_info->update_by_impression($bms_no, $this->request->getPost('point'), $this->current_time);
             header("Location: " . ROOT_URL . "/detail/thanks/{$bms_no}/");
         } else {
             throw new Exception('作品評価期間ではありません');
         }
     } catch (Exception $e) {
         $this->displayErrorView($e->getMessage());
     }
 }