public function screen_modify() { // データベースを操作します。 $NoticeModel = new NoticeModel(); $noticedata = $NoticeModel->get_notice_data_id('1'); // 現在のお知らせを設定します。 $this->form->setDefaults(['subject' => $noticedata['subject'], 'body' => $noticedata['body']]); if ($this->action == "form") { $this->form->addElement('text', 'subject', '件名', ['size' => 100]); $this->form->addElement('textarea', 'body', '内容', ['rows' => 5, 'cols' => 40]); $this->next_type = 'notice'; $this->next_action = 'complete'; $this->form->addElement('submit', 'submit', '更新する'); $this->file = "notice_form.tpl"; } else { if ($this->action == "complete") { $userdata = $this->form->getSubmitValues(); $userdata['id'] = '1'; $NoticeModel->modify_notice($userdata); $this->message = "お知らせを更新しました。"; $this->file = "message.tpl"; } } $this->title = 'お知らせ画面'; $this->view_display(); }
public function screen_top() { $NoticeModel = new NoticeModel(); $noticedata = $NoticeModel->get_notice_data_id('1'); $this->view->assign('subject', $noticedata['subject']); $this->view->assign('body', $noticedata['body']); $this->view->assign('reg_date', $noticedata['reg_date']); $this->view->assign('last_name', $_SESSION[_MEMBER_AUTHINFO]['last_name']); $this->view->assign('first_name', $_SESSION[_MEMBER_AUTHINFO]['first_name']); $this->title = '会員トップ画面'; $this->file = 'member_top.tpl'; $this->view_display(); }