dwh/upload_loan_ajax.php

111 lines
3.2 KiB
PHP
Raw Normal View History

2023-10-02 10:26:17 +00:00
<?PHP
include_once("session_checker.php");
include_once 'class/PregReplaceCallbackClass.php';
include_once 'init/initialisation_parameter.php';
include_once 'headerFile.php';
$_SESSION['TEMPLATE_ARRAY_ADDR'] = &$upload_treasury_template_array;
$templObj = new PregReplaceCallbackClass('');
$templObj->SetTemplateArray('TEMPLATE_ARRAY_ADDR');
$ora_obj = new ORAConnectionClass('init/ORA_INIT.php');
$ora_res = $ora_obj->ORA_PConnect();
if (!$ora_res){
echo "<BR>Error : " . htmlspecialchars($ora_obj->last_error_msg) . "<br>";
exit();
}
initAjaxParamTemplate();
if ($_REQUEST['action'] == 'initForm') {
$result = prepare();
} else {
$result = -1;
}
echo $result;
unset($_SESSION['TEMPLATE_ARRAY_ADDR']);
if ($ora_obj->conn) {
$ora_obj->ORA_Close();
#echo "connection closed.<br>";
}
function initAjaxParamTemplate() {
$upload_treasury_template_array['CONTAINER'] = <<< params
<table width="100%" cellpadding="2" cellspacing="1" border="0" style="layout:auto">
<span id="PARAM"><<PARAM>></span>
<span id="LIST"><<LIST>></span>
</table>
params;
$upload_treasury_template_array['NEWUPLOAD'] = <<< params
<tr>
<td align=left class="orangetitle" nowrap>SYPASS - FTP KWU DAN LOAN 2000</td>
</tr>
<tr>
<td align=left>
<form name="uploadLoanForm" method="POST">
<input type="hidden" name="action" value="uploadFile">
<table width="65%" cellpadding="2" cellspacing="1" border="0" style="layout:auto" class="font11">
<tr>
<td colspan=3>
Mentransfer data KWU dan Loan 2000 dari <<KWU_SOURCE>><BR>Ke Server Data Warehouse <<KWU_TARGET>>
</td>
</tr>
<tr>
<td colspan="2" style="color:red;font-weight:bold;font-size:11px"><<MESSAGE>></td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="button" name="btnProsesFTP" class="font11" value="PROSES" onclick="javascript:prosesFTP();return false;" style="text-align:center">&nbsp;
<br><span id="actionDisp"></span>
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
params;
$_SESSION['TEMPLATE_ARRAY_ADDR'] = &$upload_treasury_template_array;
}
function prepare(){
$templObj = new PregReplaceCallbackClass('');
$templObj->SetTemplateArray('TEMPLATE_ARRAY_ADDR');
$message = 'Pastikan Koneksi FTP ke Server KWU dan Loan 2000 serta Data Warehouse aktif';
$variable_array['PARAM'] = showUploadForm($message);
$_SESSION['ARRAY_ADDR_VAR'] = &$variable_array;
$templObj->SetFormatName('CONTAINER');
$list = $templObj->PregReplaceCallback();
return $list;
}
function showUploadForm($message=null){
$templObj = new PregReplaceCallbackClass('');
$templObj->SetTemplateArray('TEMPLATE_ARRAY_ADDR');
$kwu_source_arr = explode('^', KWU_SOURCE);
$kwu_source = $kwu_source_arr[0];
$kwu_target_arr = explode('^', KWU_TARGET);
$kwu_target = $kwu_target_arr[0];
$_SESSION['ARRAY_ADDR_VAR'] = &$variable_array;
$templObj->SetFormatName('NEWUPLOAD');
$variable_array['MESSAGE'] = $message;
$variable_array['KWU_SOURCE'] = $kwu_source;
$variable_array['KWU_TARGET'] = $kwu_target;
$variable_array['DISABLE_UPLOAD'] = 'disabled';
$result = $templObj->PregReplaceCallback();
return $result;
}
?>