public function screen_delete() { // データベースを操作します。 $MemberModel = new MemberModel(); if ($this->action == "confirm") { if ($this->is_system) { $_SESSION[_MEMBER_AUTHINFO] = $MemberModel->get_member_data_id($_GET['id']); $this->message = "[削除する]をクリックすると "; $this->message .= htmlspecialchars($_SESSION[_MEMBER_AUTHINFO]['last_name'], ENT_QUOTES); $this->message .= htmlspecialchars($_SESSION[_MEMBER_AUTHINFO]['first_name'], ENT_QUOTES); $this->message .= "さん の会員情報を削除します。"; $this->form->addElement('submit', 'submit', "削除する"); } else { $this->message = "[退会する]をクリックすると会員情報を削除して退会します。"; $this->form->addElement('submit', 'submit', "退会する"); } $this->next_type = 'delete'; $this->next_action = 'complete'; $this->title = '削除確認画面'; $this->file = 'delete_form.tpl'; } else { if ($this->action == "complete") { $MemberModel->delete_member($_SESSION[_MEMBER_AUTHINFO]['id']); if ($this->is_system) { unset($_SESSION[_MEMBER_AUTHINFO]); } else { $this->auth->logout(); } $this->message = "会員情報を削除しました。"; $this->title = '削除完了画面'; $this->file = 'message.tpl'; } } $this->view_display(); }
public function screen_delete() { $btn = ""; $MemberModel = new MemberModel(); if (isset($_POST['system_delete']) && ($_POST['system_delete'] = 'on')) { $this->action = "confirm"; } if ($this->action == "confirm") { if ($this->is_system) { $this->title = "会員情報削除"; $this->message = "[削除]ボタンをクリックすると<br><br>"; $this->message .= "会員番号 <font color='red'>"; $this->message .= htmlspecialchars($_SESSION[_MEMBER_AUTHINFO]['id'], ENT_QUOTES); $this->message .= "</font>番<br><br><font color='red'>"; $this->message .= htmlspecialchars($_SESSION[_MEMBER_AUTHINFO]['last_name'], ENT_QUOTES); $this->message .= htmlspecialchars($_SESSION[_MEMBER_AUTHINFO]['first_name'], ENT_QUOTES); $this->message .= "</font>さん<br><br>の情報を削除します。"; $btn = "削除"; } else { $this->title = "退会画面"; $this->message = "下記、退会ボタンをクリックすると<br><br>すべての情報が削除され<br><br>"; $this->message .= "退会となります。"; $btn = "退会"; } $this->file = "member_delete.tpl"; $this->next_type = "delete"; $this->next_action = "complete"; } else { if ($this->action == "complete") { $MemberModel->delete_member($_SESSION[_MEMBER_AUTHINFO]['id']); if ($this->is_system) { $this->title = "削除完了"; $this->message = "会員情報を削除しました"; $this->URL = "system.php?type=member_list"; $this->URL .= $this->add_pageID(); $this->file = "message.tpl"; } else { $this->title = "退会完了"; $this->message = "また宜しければご利用ください"; $this->auth->logout(); $this->file = "member_delete.tpl"; } } } $this->form->addElement('submit', 'submit1', $btn); $this->view_display(); }