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();
 }