Example #1
0
 public function screen_applicant_process_close()
 {
     $btn1 = "";
     $btn2 = "";
     $reset = "";
     $this->make_message_form();
     if (empty($this->action)) {
         $MemberModel = new MemberModel();
         $CustomerModel = new CustomerModel();
         $member_data = $MemberModel->get_member_name_info_id($_SESSION['applicant']['member_id']);
         $project_data = $CustomerModel->get_project_title($_SESSION['applicant']['project_id']);
         $subject = "不採用のお知らせ";
         $body = $member_data['last_name'] . " " . $member_data['first_name'] . " 様\n\n";
         $body .= "このたびは下記のお仕事\n\n";
         $body .= "「" . $project_data . "」\n";
         $body .= "http://localhost/index.php?type=detail_project&project_id=" . $_SESSION['applicant']['project_id'] . "\n\n";
         $body .= "にご応募いただきありがとうございました。\n\n";
         $body .= "誠に残念でございますが、\n今回のお仕事は不採用となりました。\n\n";
         $body .= "何卒、ご了承いただけましたら\n幸いでございます。\n\n";
         $body .= $_SESSION[_CUSTOMER_AUTHINFO]['company_name'];
         $this->form->setDefaults(array('subject' => $subject, 'body' => $body));
         $this->form->freeze();
         $this->title = "見送り";
         $this->message = "不採用の通知をお送りして宜しいでしょうか?";
         $this->file = "customer_applicant_message_form.tpl";
         $this->next_type = "applicant_process_close";
         $this->next_action = "complete";
         $btn1 = "OK";
         $btn2 = "戻る";
     } else {
         if ($this->action == "complete" && isset($_POST['submit2']) && $_POST['submit2'] == "戻る") {
             $this->screen_applicant_detail();
             exit;
         } else {
             if ($this->action == "complete" && isset($_POST['submit1']) && $_POST['submit1'] == "OK") {
                 $data = $this->form->getSubmitValues();
                 $MessageModel = new MessageModel();
                 $ActionModel = new ActionModel();
                 $data['action_id'] = $ActionModel->get_action_some_id($_SESSION['applicant']['member_id'], $_SESSION['applicant']['project_id']);
                 $MessageModel->regist_customer_message_two_data($data, $_SESSION['applicant']);
                 $ActionModel = new ActionModel();
                 $history = "close";
                 $ActionModel->regist_action_history($_SESSION['applicant']['project_id'], $history);
                 $this->title = "お見送り完了";
                 $this->message = "不採用の通知の送付が完了しました。";
                 $this->file = "message.tpl";
                 unset($_SESSION['applicant']);
             }
         }
     }
     $this->form->addElement('submit', 'submit1', $btn1);
     $this->form->addElement('submit', 'submit2', $btn2);
     $this->view_display();
 }
Example #2
0
 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;
 }