<?php
require_once('ext/ESnappedAPI.php');
require_once('ext/EasyPaymentLinkAPI.php');

require_once(SITE_LOGICS . 'deposit/logic.php');
require_once(SITE_LOGICS . '/deposit/config.php');

class ControlDeposit extends LogicDeposit {

	/*-------------------------------------------------------------------------
	* @ メンバ変数
	-------------------------------------------------------------------------*/

	/*-------------------------------------------------------------------------
	* @function_name: ロジックのコンストラクタ
	* @parameter	: なし
	* @return		: なし
	-------------------------------------------------------------------------*/
	function __construct() {
		parent::__construct();
	}

	/*-------------------------------------------------------------------------
	* @function_name: コントロールパネルシステム動画データ編集ロジック（各クラス共通）
	* @parameter	: なし
	* @return		: なし
	-------------------------------------------------------------------------*/
	function action() {
		// 変数宣言部
		try {
		    $this -> checkAvailability("site", function(){
		        require_once $this -> getUserHTML('TEMPLATE_MAINTENANCE_MODE_SITE_PATH');
		        exit();
		    });
		    
			// アクション実行
			$this -> logic();
			if($this -> getType() == TYPE_APPLY) {				// CARD決済前の場合何もしない

			} else if($this -> getType() == TYPE_COMPLETE) {	// 画面の表示（完了画面）
				require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_COMPLETE_PATH', $this -> dispHTML()));

			} else if($this -> getType() == TYPE_SEND) {		// 画面の表示（メール送信）
				require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_SEND_PATH', $this -> dispHTML()));

			} else if($this -> getType() == TYPE_PRINT) {		// 画面の表示（印刷画面）
				require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_PRINT_PATH', $this -> dispHTML()));

			} else if($this -> getType() == TYPE_CONFIRM) {		// 画面の表示（管理画面）
				require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_CONFIRM_PATH', $this -> dispHTML()));

			} else if($this -> getType() == TYPE_FAIL) {		// 画面の表示（完了画面）
				require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_COMPLETE_GPS_PATH', $this -> dispHTML()));

			} else if($this -> getType() == TYPE_SUCCESS) {		// 画面の表示（完了画面）
				require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_COMPLETE_GPS_PATH', $this -> dispHTML()));

			} else if($this -> getType() == TYPE_PENDING) {		// 画面の表示（保留画面）
				require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_PENDING_GPS_PATH', $this -> dispHTML()));

			} else if($this -> getType() == CASHFLOW_DEPOSIT_INPUT) {		// 画面の表示（保留画面）
				if (in_array($this -> getUserData(PARAM_USER_ACCOUNT), getVMAllowList())) {
					require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_CASHFLOW_INPUT_PATH', $this -> dispHTML()));
				} else if(VM_MAINTENANCE) {
					require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_CASHFLOW_MAINTENANCE_PATH', $this -> dispHTML()));
				} else {
					require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_CASHFLOW_INPUT_PATH', $this -> dispHTML()));
				}


			} else if($this -> getType() == CASHFLOW_DEPOSIT_CONFIRM) {		// 画面の表示（保留画面）
				require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_CASHFLOW_CONFIRM_PATH', $this -> dispHTML()));

			} else if($this -> getType() == CASHFLOW_DEPOSIT_SUCCESS) {		// 画面の表示（保留画面）
				require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_CASHFLOW_SUCCESS_PATH', $this -> dispHTML()));

			} else if($this -> getType() == CASHFLOW_DEPOSIT_FAILURE) {		// 画面の表示（保留画面）
				require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_CASHFLOW_FAILURE_PATH', $this -> dispHTML()));

			} else if($this -> getType() == CASHFLOW_DEPOSIT_SEND) {		// 画面の表示（保留画面）
				require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_CASHFLOW_SEND_PATH', $this -> dispHTML()));
			} else if($this -> getType() == TYPE_CUP_INPUT){	//CUP信息输入页面
				//if (in_array($this -> getUserData(PARAM_USER_ACCOUNT), getCUPAllowList())) {
					require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_CUP_INPUT_PATH', $this -> dispHTML()));
				// } else if(CUP_MAINTENANCE) {
				// 	require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_CUP_MAINTENANCE_PATH', $this -> dispHTML()));
				// } else {
				// 	require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_CUP_INPUT_PATH', $this -> dispHTML()));
				// }

			} else if($this -> getType() == TYPE_CUP_CONFIRM){
				require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_CUP_CONFIRM_PATH', $this -> dispHTML()));
			} else if($this -> getType() == TYPE_CUP_PAYMENTSUCCESS){	//CUP信息输入页面
				require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_CUP_PAYMENTSUCCESS_PATH', $this -> dispHTML()));
			} else if($this -> getType() == TYPE_CUP_PAYMENTFAILURE){
				require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_CUP_PAYMENTFAILURE_PATH', $this -> dispHTML()));
			} else if($this -> getType() == TYPE_CUP_NOTICE_KYC) {		// 画面の表示（保留画面）
				require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_CUP_NOTICE_KYC_PATH', $this -> dispHTML()));
			} else if($this -> getType() == TYPE_NOTICE_KYC) {		// 画面の表示（保留画面）
				require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_NOTICE_KYC_PATH', $this -> dispHTML()));
			} else if($this -> getType() == VAL_STR_JRF_METHOD) {	// 画面の表示（完了画面）
				require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_JRF_COMPLETE_PATH', $this -> dispHTML()));
			} else if($this -> getType() == VAL_STR_FLAT3_INPUT){	//FLAT3信息输入页面
				require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_FLAT3_INPUT_PATH', $this -> dispHTML()));
			} else if($this -> getType() == VAL_STR_FLAT3_SUCCESS){
				require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_FLAT3_SUCCESS_PATH', $this -> dispHTML()));
			} else if($this -> getType() == VAL_STR_FLAT3_PRINT) {		// 画面の表示（印刷画面）
				require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_FLAT3_PRINT_PATH', $this -> dispHTML()));
			} else if($this -> getType() == VAL_STR_FLAT3_MAILSEND) {		// 画面の表示（印刷画面）
				require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_FLAT3_SEND_PATH', $this -> dispHTML()));
			} else if($this -> getType() == VAL_STR_FLAT3_KYC) {		// 画面の表示（保留画面）
				require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_FLAT3_NOT_UNLIMITED_PATH', $this -> dispHTML()));
			} else if($this -> getType() == TYPE_LBTC_INPUT) { // if type is lbtc_input
                require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_LBTC_INPUT_PATH', $this -> dispHTML()));
            } else if($this -> getType() == TYPE_LBTC_CONFIRM) { // if type is lbtc_input
                require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_LBTC_CONFIRM_PATH', $this -> dispHTML()));
            } else if($this -> getType() == TYPE_LBTC_SUCCESS) { // if type is lbtc_input
                require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_LBTC_SUCCESS_PATH', $this -> dispHTML()));
            } else if($this -> getType() == TYPE_LBTC_FAIL) { // if type is lbtc_input
                require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_LBTC_FAIL_PATH', $this -> dispHTML()));
            } else if($this -> getType() == TYPE_LBTC_NOTICE_KYC) { // if type is lbtc_input
                require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_LBTC_NOTICE_KYC_PATH', $this -> dispHTML()));
            } else if($this -> getType() == TYPE_SEPA_INPUT) { // if type is sepa_input
                require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_SEPA_INPUT_PATH', $this -> dispHTML()));
            } else if($this -> getType() == TYPE_BIT_INPUT) { // if type is bit_input
                require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_BIT_INPUT_PATH', $this -> dispHTML()));
            } else if($this -> getType() == TYPE_BIT_COMPLETE) { // if type is bit_complete
                require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_BIT_COMPLETE_PATH', $this -> dispHTML()));
            } else if($this -> getType() == TYPE_BIT_SUCCESS) { // if type is bit_success
                require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_BIT_SUCCESS_PATH', $this -> dispHTML()));
            } else if($this -> getType() == TYPE_BIT_NOTICE_KYC) { // if type is bit_notice_kyc
                require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_BIT_NOTICE_KYC_PATH', $this -> dispHTML()));
            } else if($this -> getType() == TYPE_CLEARSETTLE_INPUT) { // if type is clearsettle_input
                require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_CLEARSETTLE_INPUT_PATH', $this -> dispHTML()));
            } else if($this -> getType() == TYPE_CLEARSETTLE_CONFIRM) { // if type is clearsettle_confirm
                require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_CLEARSETTLE_CONFIRM_PATH', $this -> dispHTML()));
            } else if($this -> getType() == TYPE_CLEARSETTLE_NOTICE_KYC) { // if type is clearsettle_notice_kyc
                require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_CLEARSETTLE_NOTICE_KYC_PATH', $this -> dispHTML()));
            } else if($this -> getType() == TYPE_CLEARSETTLE_SUCCESS) { // if type is clearsettle_success
                require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_CLEARSETTLE_SUCCESS_PATH', $this -> dispHTML()));
            } else if($this -> getType() == TYPE_CLEARSETTLE_FAIL) { // if type is clearsettle_fail
                require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_CLEARSETTLE_FAIL_PATH', $this -> dispHTML()));
            }else if($this -> getType() == TYPE_LBTJ_INPUT) { // if type is sepa_input
                require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_LBTJ_INPUT_PATH', $this -> dispHTML()));
            }else if($this -> getType() == TYPE_LBTJ_NOTICE_KYC) { // if type is clearsettle_notice_kyc
                require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_LBTJ_NOTICE_KYC_PATH', $this -> dispHTML()));
            }else if($this -> getType() == TYPE_LBTJ_COMPLETE) { // if type is clearsettle_notice_kyc
                require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_LBTJ_UPLOAD_COMPLETE_PATH', $this -> dispHTML()));
            }else if($this -> getType() == TYPE_IBT_INPUT) { // if type is sepa_input
                require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_IBT_INPUT_PATH', $this -> dispHTML()));
            }else if($this -> getType() == TYPE_IBT_CORP) { // if type is clearsettle_notice_kyc
                require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_IBT_CORP_PATH', $this -> dispHTML()));
            }else if($this -> getType() == TYPE_IBT_NOTICE_KYC) { // if type is clearsettle_notice_kyc
                require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_IBT_NOTICE_KYC_PATH', $this -> dispHTML()));
            }else if($this -> getType() == TYPE_H2P_INPUT) { // if type is help2pay input
                require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_H2P_INPUT_PATH', $this -> dispHTML()));
            }else if($this -> getType() == TYPE_H2P_CONFIRM) { // if type is help2pay input
                require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_H2P_CONFIRM_PATH', $this -> dispHTML()));
            }else if($this -> getType() == TYPE_H2P_SEND) { // if type is help2pay input
                require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_H2P_SEND_PATH', $this -> dispHTML()));
            }else if($this -> getType() == TYPE_H2P_STATUS) { // if type is help2pay input
                require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_H2P_STATUS_PATH', $this -> dispHTML()));
            }else if($this -> getType() == TYPE_H2P_FAIL) { // if type is help2pay input
                require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_H2P_FAIL_PATH', $this -> dispHTML()));
            }else if($this -> getType() == TYPE_H2P_NOTICE_KYC) { // if type is help2pay notice kyc
                require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_H2P_NOTICE_KYC_PATH', $this -> dispHTML()));
            }else if($this -> getType() == TYPE_H2P_PENDING) { // if type is help2pay input
                require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_H2P_PENDING_PATH', $this -> dispHTML()));
            }else if($this -> getType() == TYPE_CPS_INPUT) { // if type is help2pay input
                require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_CPS_INPUT_PATH', $this -> dispHTML()));
            }else if($this -> getType() == TYPE_CPS_NOTICE_KYC) { // if type is help2pay input
                require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_CPS_NOTICE_KYC_PATH', $this -> dispHTML()));
            }else if($this -> getType() == TYPE_CPS_CONFIRM) { // if type is help2pay input
                require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_CPS_CONFIRM_PATH', $this -> dispHTML()));
            }else if($this -> getType() == TYPE_CPS_SEND) { // if type is help2pay input
                require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_CPS_SEND_PATH', $this -> dispHTML()));
            } else if($this -> getType() == VAL_STR_LBTF3_INPUT){	//FLAT3信息输入页面
				require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_LBTF3_INPUT_PATH', $this -> dispHTML()));
			} else if($this -> getType() == VAL_STR_LBTF3_SUCCESS){
				require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_LBTF3_SUCCESS_PATH', $this -> dispHTML()));
			} else if($this -> getType() == VAL_STR_LBTF3_PRINT) {		// 画面の表示（印刷画面）
				require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_LBTF3_PRINT_PATH', $this -> dispHTML()));
			} else if($this -> getType() == VAL_STR_LBTF3_MAILSEND) {		// 画面の表示（印刷画面）
				require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_LBTF3_SEND_PATH', $this -> dispHTML()));
			} else if($this -> getType() == VAL_STR_LBTF3_KYC) {		// 画面の表示（保留画面）
				require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_LBTF3_KYC_PATH', $this -> dispHTML()));
			} else if($this -> getType() == VAL_STR_JPV_INPUT){	//FLAT3信息输入页面
				require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_JPV_INPUT_PATH', $this -> dispHTML()));
			} else if($this -> getType() == VAL_STR_JPV_SUCCESS){
				require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_JPV_SUCCESS_PATH', $this -> dispHTML()));
			} else if($this -> getType() == VAL_STR_JPV_PRINT) {		// 画面の表示（印刷画面）
				require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_JPV_PRINT_PATH', $this -> dispHTML()));
			} else if($this -> getType() == VAL_STR_JPV_MAILSEND) {		// 画面の表示（印刷画面）
				require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_JPV_SEND_PATH', $this -> dispHTML()));
			} else if($this -> getType() == VAL_STR_JPV_KYC) {		// 画面の表示（印刷画面）
				require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_JPV_KYC_PATH', $this -> dispHTML()));
			}else if($this -> getType() == TYPE_ZANETA_INPUT) {
                require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_ZANETA_INPUT_PATH', $this -> dispHTML()));
            } else if($this -> getType() == TYPE_ZANETAPAY_DEPOSIT_CONFIRM) {	
				require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_ZANETA_CONFIRM_PATH', $this -> dispHTML()));
			}else if($this -> getType() == TYPE_ZANETAPAY_NOTICE_KYC) {	
				require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_ZANETA_NOTICE_KYC_PATH', $this -> dispHTML()));
			}else if($this -> getType() == TYPE_ZANETAPAY_DEPOSIT_SEND) {	
				require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_ZANETA_SEND_PATH', $this -> dispHTML()));
			}else if($this -> getType() == TYPE_ZANETAPAY_DEPOSIT_SUCCESS) {		// 画面の表示（保留画面）
				require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_ZANETA_SUCCESS_PATH', $this -> dispHTML()));
			} else if($this -> getType() == TYPE_ZANETAPAY_DEPOSIT_FAILURE) {		// 画面の表示（保留画面）
				require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_ZANETA_FAILURE_PATH', $this -> dispHTML()));
			}else if($this -> getType() == TYPE_CCD_INPUT) {	
				require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_CREDIT_APN_INPUT_PATH', $this -> dispHTML()));
			}else if($this -> getType() == TYPE_CCD_CONFIRM) {	
				require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_CREDIT_APN_CONFIRM_PATH', $this -> dispHTML()));
			}else if($this -> getType() == TYPE_CCD_SEND) {
			    require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_CREDIT_APN_SEND_PATH', $this -> dispHTML()));
			}else if($this -> getType() == TYPE_CCD_COMPLETE) {	
				require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_CREDIT_APN_COMPLETE_PATH', $this -> dispHTML()));
			}else if($this -> getType() == TYPE_CCD_FAIL) {
			    require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_CREDIT_APN_FAIL_PATH', $this -> dispHTML()));
			}else if($this -> getType() == TYPE_CCD_SUCCESS) {
			    require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_CREDIT_APN_SUCCESS_PATH', $this -> dispHTML()));
			}else {											// 画面の表示（初期画面）
				require_once($this -> getUserHTML('TEMPLATE_DEPOSIT_INPUT_PATH', $this -> dispHTML()));
			}
		} catch (Exception $e) {
			header('Location: /' . $this ->  getLangage() . '/login');
		}
	}
}
?>
