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'); }
private function showIndexPage($schedule) { $master = new Master(); $info_message = $master->get_info(); $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); $bms_info = new BmsInfo(); $bms_data = $bms_info->get_data(); $this->view->assign('info_message', $info_message); $this->view->assign('bms_data', $bms_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('index.tpl'); }
public function reviseAction() { try { if (!$this->request->getPost()) { throw new Exception('こらっ'); } if ($this->request->getPost('password') == null) { throw new Exception('パスワードを入れてください。'); } $bms_info = new BmsInfo(); $bms_data = $bms_info->get_data($this->request->getPost('bms_no')); if (!(crypt($this->request->getPost('password'), $bms_data['password']) === $bms_data['password'])) { throw new Exception('パスワードが一致しません'); } $bms_info->revise($this->request->getPost(), $this->current_time, $this->ip, $this->host); header("Location: " . ROOT_URL . "/revise/thanks/"); } catch (Exception $e) { $this->displayErrorView($e->getMessage()); } }
public function viewresultAction() { $this->checkLogin(); function cmp($a, $b) { if ($a['point'] == $b['point']) { return $a['imp'] < $b['imp'] ? -1 : 1; } return $a['point'] > $b['point'] ? -1 : 1; } try { $bms_info = new BmsInfo(); $bms_data = $bms_info->get_data(); usort($bms_data, 'cmp'); } catch (Exception $e) { $this->displayErrorView($e->getMessage()); } $this->view->assign('bms_data', $bms_data); $this->view->assign('root_url', ROOT_URL); $this->view->display('admin/admin_result.tpl'); }