public function system_get_detail_message_messsage_id($message_id) { try { $sql = " SELECT * FROM message \n WHERE\n id = :message_id \n limit 1 "; $stmh = $this->pdo->prepare($sql); $stmh->bindValue(':message_id', $message_id, PDO::PARAM_INT); $stmh->execute(); $i = 0; $data = array(); $MemberModel = new MemberModel(); $CustomerModel = new CustomerModel(); $ActionModel = new ActionModel(); $data = $stmh->fetch(PDO::FETCH_ASSOC); $action_data = $ActionModel->get_action_id($data['action_id']); $customer_data = $CustomerModel->get_customer_authinfo_id($data['company_id']); $member_data = $MemberModel->get_member_base_info_id($data['member_id']); $project_data = $CustomerModel->get_project_title($data['project_id']); $data['action_reg_date'] = $action_data['reg_date']; $data['company_name'] = $customer_data['company_name']; $data['member_name'] = $member_data['last_name'] . ' ' . $member_data['first_name']; $data['title'] = $project_data; $data['body'] = htmlspecialchars($data['body'], ENT_QUOTES); $data['body'] = nl2br($data['body']); $i++; } catch (PDOException $Exception) { print "エラー" . $Exception->getMessage(); } return $data; }
public function screen_company($auth = "") { $btn1 = ""; $btn2 = ""; if ($this->action == "view" && $this->is_system) { $CustomerModel = new CustomerModel(); $_SESSION[_CUSTOMER_AUTHINFO] = $CustomerModel->get_customer_authinfo_id($_GET['id']); } $setDefaults = array('company_name' => $_SESSION[_CUSTOMER_AUTHINFO]['company_name'], 'mail' => $_SESSION[_CUSTOMER_AUTHINFO]['mail'], 'tel' => $_SESSION[_CUSTOMER_AUTHINFO]['tel'], 'address' => $_SESSION[_CUSTOMER_AUTHINFO]['address'], 'appeal' => $_SESSION[_CUSTOMER_AUTHINFO]['appeal'], 'last_name' => $_SESSION[_CUSTOMER_AUTHINFO]['last_name'], 'first_name' => $_SESSION[_CUSTOMER_AUTHINFO]['first_name']); $this->form->setDefaults($setDefaults); $this->make_customer_modify_company(); if ($this->action == "view" && $this->is_system) { $this->form->freeze(); $this->title = "情報詳細"; $this->message = ""; $this->file = "customer_modify_company.tpl"; $this->next_type = "modify_or_delete_customer"; $this->next_action = "form"; $btn1 = "更新"; $btn2 = "削除"; } // 入力値が適切でなく かつ $this->actionがviewでない if (!$this->form->validate() && $this->action != "view") { $this->action = "form"; } if ($this->action == "form") { if ($this->is_system) { $this->title = "顧客情報更新"; } else { $this->title = "自社情報編集ページ"; } $this->file = "customer_modify_company.tpl"; $this->next_type = "company"; $this->next_action = "confirm"; $btn1 = "確認"; $btn2 = ""; } else { if ($this->action == "confirm" && $_POST['submit1'] && $_POST['submit1'] == "確認") { $this->form->freeze(); if ($this->is_system) { $this->title = "顧客情報更新"; } else { $this->title = "自社情報編集ページ"; } $this->message = "下記で宜しいですか?"; $this->file = "customer_modify_company.tpl"; $this->next_type = "company"; $this->next_action = "complete"; $btn1 = "更新"; $btn2 = "戻る"; } else { if ($this->action == "complete" && isset($_POST['submit2']) && $_POST['submit2'] == "戻る") { if ($this->is_system) { $this->title = "顧客情報更新"; } else { $this->title = "自社情報編集ページ"; } $this->file = "customer_modify_company.tpl"; $this->next_type = "company"; $this->next_action = "confirm"; $btn1 = "確認"; $btn2 = ""; } else { if ($this->action == "complete" && isset($_POST['submit1']) && $_POST['submit1'] == "更新") { $data = $this->form->getSubmitValues(); $data['id'] = $_SESSION[_CUSTOMER_AUTHINFO]['id']; $CustomerModel = new CustomerModel(); $CustomerModel->modify_customer_company($data); if ($this->is_system) { $this->title = "更新完了"; $this->message = "顧客情報の更新が完了しました"; $this->URL = "system.php?type=customer_list"; $this->URL .= $this->add_pageID(); $this->file = "message.tpl"; } else { $this->auth->auth_customer_ok($data); header("Location:http://localhost/customer.php?flag=company"); exit; } } } } } $this->form->addElement('submit', 'submit1', $btn1); $this->form->addElement('submit', 'submit2', $btn2); $this->form->addElement('reset', 'reset', ""); $this->view_display(); }
public function screen_detail_project() { $this->title = "お仕事の詳細"; $this->message = "下記に応募しますか?"; $project_id = ""; $member_id = ""; if (isset($_REQUEST['project_id'])) { $project_id = $_REQUEST['project_id']; } if (isset($_SESSION[_MEMBER_AUTHINFO]['id'])) { $member_id = $_SESSION[_MEMBER_AUTHINFO]['id']; } $CustomerModel = new CustomerModel(); $data = $CustomerModel->get_project($project_id, $member_id); $data2 = $CustomerModel->get_customer_authinfo_id($data['company_id']); $this->view->assign('data', $data); $this->view->assign('data2', $data2); $this->file = "index_detail_project.tpl"; $this->view_display(); }