Esempio n. 1
0
 public function viewAction()
 {
     try {
         $bms_no = $this->request->getParam('0');
         if (!file_exists("db/impression{$bms_no}.sqlite3")) {
             throw new Exception('該当データがありません');
         }
         $bms_info = new BmsInfo();
         $bms_data = $bms_info->get_data($bms_no);
         $impression = new Impression($bms_no);
         $impression_data = $impression->get_data();
         $schedule = new Schedule();
         $is_able_to_register = $schedule->is_in_time('regist', $this->current_time);
         $is_able_to_post_impression = $schedule->is_in_time('impre', $this->current_time);
     } catch (Exception $e) {
         $this->displayErrorView($e->getMessage());
     }
     $this->view->assign('bms_no', $bms_no);
     $this->view->assign('bms_data', $bms_data);
     $this->view->assign('impression_data', $impression_data);
     $this->view->assign('is_able_to_register', $is_able_to_register);
     $this->view->assign('is_able_to_post_impression', $is_able_to_post_impression);
     $this->view->assign('root_url', ROOT_URL);
     $this->view->display('detail.tpl');
 }
Esempio n. 2
0
 public function deleteimpAction()
 {
     try {
         $this->checkLogin();
         $bms_no = $this->request->getPost('bms_no');
         $imp_no = $this->request->getPost('imp_no');
         $impression = new Impression($bms_no);
         $impression_data = $impression->get_data($imp_no);
         $del_point = $impression_data['point'];
         $impression->delete($imp_no);
         $bms_info = new BmsInfo();
         $bms_info->update_by_impression_delete($bms_no, $del_point);
         header("Location: " . ROOT_URL . "/admin/finish/");
     } catch (Exception $e) {
         $this->displayErrorView($e->getMessage());
     }
 }