assign("mode", $mode); ## file ## $file_name = $_SERVER['PHP_SELF']; $smarty->assign("file_name", $file_name); ## クラス読み込み include(_CLASS_PATH."HomeLoanExamination.class.php"); $o_loan_examination = new HomeLoanExamination($o_db, _DOCUMENT_ROOT_LOCAL, $o_common, $mode); ## 都道府県情報 include(_PROPERTIES_PATH."prefecture.inc"); ## 専用情報 include(_PROPERTIES_PATH."home_loan_examination.inc"); $act = $_REQUEST["act"]; $smarty->assign("act", $act); switch($act){ case "return5":##FORM5に戻った場合 $data5 = $_SESSION["home_loan_form"]["data5"]; $smarty->assign("data5", $data5); ##FORM5ページ $smarty->display("jyutaku_lorn/form5.tpl"); break; exit; case "return4":##FORM4に戻った場合 $data4 = $_SESSION["home_loan_form"]["data4"]; $smarty->assign("data4", $data4); ##form5のデータがある場合 if($_REQUEST["data5"] != ""){ $_SESSION["home_loan_form"]["data5"] = $_REQUEST["data5"]; } ##FORM4ページ $smarty->display("jyutaku_lorn/form4.tpl"); break; exit; case "return3":##FORM3に戻った場合 $data3 = $_SESSION["home_loan_form"]["data3"]; $smarty->assign("data3", $data3); ##form4のデータがある場合 if($_REQUEST["data4"] != ""){ $_SESSION["home_loan_form"]["data4"] = $_REQUEST["data4"]; } ##FORM3ページ $smarty->display("jyutaku_lorn/form3.tpl"); break; exit; case "return2":##FORM2に戻った場合 $data2 = $_SESSION["home_loan_form"]["data2"]; $smarty->assign("data2", $data2); ##form3のデータがある場合 if($_REQUEST["data3"] != ""){ $_SESSION["home_loan_form"]["data3"] = $_REQUEST["data3"]; } ##FORM2ページ $smarty->display("jyutaku_lorn/form2.tpl"); break; exit; case "return1":##FORM1に戻った場合 $data1 = $_SESSION["home_loan_form"]["data"]; $smarty->assign("data", $data1); #echo "1
"; #print_r($_SESSION["home_loan_form"]["data"]); ##form2のデータがある場合 if($_REQUEST["data2"] != ""){ $_SESSION["home_loan_form"]["data2"] = $_REQUEST["data2"]; } ##FORM1ページ $smarty->display("jyutaku_lorn/form.tpl"); break; exit; case "complete": ##form1データ $data1 = $_SESSION["home_loan_form"]["data"]; $smarty->assign("data", $data1); ##FORM2データ $data2 = $_SESSION["home_loan_form"]["data2"]; $smarty->assign("data2", $data2); ##FORM3データ $data3 = $_SESSION["home_loan_form"]["data3"]; $smarty->assign("data3", $data3); ##FORM4データ $data4 = $_SESSION["home_loan_form"]["data4"]; $smarty->assign("data4", $data4); ##FORM5データ $data5 = $_SESSION["home_loan_form"]["data5"]; $smarty->assign("data5", $data5); ## 更新による登録をブロック if($_SESSION["home_loan_form_log"][$_REQUEST["date"]] != ""){ unset ($_SESSION["home_loan_form"]["agreement"]); header("Location: ./agreement.php"); exit; }else if(! $_SESSION["home_loan_form"]["data"]){ unset ($_SESSION["home_loan_form"]["agreement"]); header("Location: ./agreement.php"); }else{ $_SESSION["home_loan_form_log"][$_REQUEST["date"]] = 1; } ##DB保存部分## ## ID生成 $flg = 0; ##while文で廻してflg == 1 になったらwhile文から抜け出して while($flg == 0){ $id = $o_common->MakeRandom(); $sql = "select * from tbl_home_loan_examination_personal where id='".$id."'"; $tmp = $o_db->FetchOne($sql); if($tmp["id"] == ""){ $flg = 1; }else{ $flg = 0; } } ##form1データの保存## //入居予定家族(続柄)連結 if($data1["relationship"]){ $data1["relationship"] = implode("||", $data1["relationship"]); } //入居予定家族(続柄)連結 if($data1["family_age"]){ $data1["family_age"] = implode("||", $data1["family_age"]); } $o_loan_examination->AddPersonal($data1, $id); ##form2データの保存## $o_loan_examination->AddJunkyard($data2, $id); ##form3データの保存## #print_r($data3); //借入内容連結 if($data3["lender_txt"]){ $data3["lender_txt"] = implode("||", $data3["lender_txt"]); } if($data3["lender_select"]){ $data3["lender_select"] = implode("||", $data3["lender_select"]); } if($data3["funds_applications"]){ $data3["funds_applications"] = implode("||", $data3["funds_applications"]); } if($data3["contract_era_name"]){ $data3["contract_era_name"] = implode("||", $data3["contract_era_name"]); } if($data3["contract_y"]){ $data3["contract_y"] = implode("||", $data3["contract_y"]); } if($data3["contract_m"]){ $data3["contract_m"] = implode("||", $data3["contract_m"]); } if($data3["first_money"]){ $data3["first_money"] = implode("||", $data3["first_money"]); } if($data3["amount_repaid"]){ $data3["amount_repaid"] = implode("||", $data3["amount_repaid"]); } if($data3["outstanding_borrowings"]){ $data3["outstanding_borrowings"] = implode("||", $data3["outstanding_borrowings"]); } if($data3["pre_pay_off"]){ $data3["pre_pay_off"] = implode("||", $data3["pre_pay_off"]); } $o_loan_examination->AddBorrowing($data3, $id); ##form4データの保存## $o_loan_examination->AddPlanning($data4, $id); ##form5データの保存## $o_loan_examination->AddCollateral($data5, $id); session_unset(); ##確認ページ $smarty->display("jyutaku_lorn/complete.tpl"); break; exit; case "confirm": $data5 = $_REQUEST["data5"]; $o_loan_examination->FormDataAdjust($data5); // FORM4のデータをsession保存 $_SESSION["home_loan_form"]["data5"] = $data5; ##form1データ $data1 = $_SESSION["home_loan_form"]["data"]; $smarty->assign("data", $data1); ##FORM2データ $data2 = $_SESSION["home_loan_form"]["data2"]; $smarty->assign("data2", $data2); ##FORM3データ $data3 = $_SESSION["home_loan_form"]["data3"]; $smarty->assign("data3", $data3); ##FORM4データ $data4 = $_SESSION["home_loan_form"]["data4"]; $smarty->assign("data4", $data4); ##FORM5データ $data5 = $_SESSION["home_loan_form"]["data5"]; $smarty->assign("data5", $data5); /* $data1["relationship"] = implode("||", $data1["relationship"]); echo $data1["relationship"]."
"; $data3["funds_applications"] = implode("||", $data3["funds_applications"]); echo $data3["funds_applications"]; $pieces = explode("||", $data3["funds_applications"]); print_r($pieces); */ ##確認ページ $smarty->display("jyutaku_lorn/confirm.tpl"); break; exit; case "form5": $data4 = $_REQUEST["data4"]; $o_loan_examination->FormDataAdjust($data4); // FORM4のデータをsession保存 $_SESSION["home_loan_form"]["data4"] = $data4; //FORM5のセッションデータをSmartyに埋め込み $data5 = $_SESSION["home_loan_form"]["data5"]; $smarty->assign("data5", $data5); ##FORM5ページ $smarty->display("jyutaku_lorn/form5.tpl"); break; exit; case "form4": $data3 = $_REQUEST["data3"]; $o_loan_examination->FormDataAdjust($data3); // FORM3のデータをsession保存 $_SESSION["home_loan_form"]["data3"] = $data3; //FORM4のセッションデータをSmartyに埋め込み $data4 = $_SESSION["home_loan_form"]["data4"]; if($data4["procurement_funds_w"] == ""){ $data4["procurement_funds_w"] = $data3["hope_borrowing"]; $data4["procurement_funds_z"] = $data3["hope_borrowing"]; } $smarty->assign("data4", $data4); ##FORM4ページ $smarty->display("jyutaku_lorn/form4.tpl"); break; exit; case "form3": $data2 = $_REQUEST["data2"]; $o_loan_examination->FormDataAdjust($data2); // FORM2のデータをsession保存 $_SESSION["home_loan_form"]["data2"] = $data2; //FORM3のセッションデータをSmartyに埋め込み $data3 = $_SESSION["home_loan_form"]["data3"]; $smarty->assign("data3", $data3); ##FORM3ページ $smarty->display("jyutaku_lorn/form3.tpl"); break; exit; case "form2": $data1 = $_REQUEST["data"]; $o_loan_examination->FormDataAdjust($data1);; // FORM1のデータをsession保存 $_SESSION["home_loan_form"]["data"] = $data1; //FORM2のセッションデータをSmartyに埋め込み $data2 = $_SESSION["home_loan_form"]["data2"]; $smarty->assign("data2", $data2); ##FORM2ページ $smarty->display("jyutaku_lorn/form2.tpl"); break; exit; case "form1": default: //コンプリート時に削除する。 if( //strpos($_SERVER['HTTP_REFERER'],'/campaign/jyutaku_lorn/agreement.php') === false && $_SESSION["home_loan_form"]["agreement"] != "ok" ){ header("Location: ./agreement.php"); exit; } #unset($_SESSION["home_loan_form"]["datas"]); #unset($_SESSION["home_loan_form"]["datas2"]); #unset($_SESSION["home_loan_form"]["datas3"]); #unset($_SESSION["home_loan_form"]["datas4"]); #unset($_SESSION["home_loan_form"]["datas5"]); $smarty->display("jyutaku_lorn/form.tpl"); } ?>