rekonDepag.jsp 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546
  1. <%@ include file="../common/header.jsp"%>
  2. <script type="text/javascript" src="./js/jquery/jquery-1.4.2.min.js"></script>
  3. <script type="text/javascript">
  4. var errorhandler = function(xhr, textStatus, error){
  5. // do something on error case
  6. };
  7. $(document).ready(function() {
  8. $("#downloadSyariah").attr("disabled", true);
  9. $("#rekon").attr("disabled", true);
  10. var errorhandler = function(xhr, textStatus, error){
  11. $("#alertContainer").html("error ocurredx");
  12. };
  13. $("#viewRekonData").click(function() {
  14. $("#viewRekonData").attr("disabled", true);
  15. $.post(
  16. "rekonDepag.do" ,
  17. {
  18. action: 'viewRekonInfo',
  19. fileDate: $('#fileDate').val(),
  20. folder: 'REKON/PRINT/SYARIAH',
  21. rekonAction: 'HAJ_DEPAG_ACTION_FTP',
  22. rekonAction2: 'HAJ_SYARIAH_ACTION_FTP',
  23. rekonAction3: 'HAJ_PRINT_ACTION'
  24. } ,
  25. function(data){
  26. var downloadedFiles = data["downloadedFiles"];
  27. $("#downloadedListTable > tbody").find("tr").remove();
  28. if (downloadedFiles != "NOT_EXISTS") {
  29. for (var i=0; i < downloadedFiles.length; i++) {
  30. var downloadedFile = downloadedFiles[i];
  31. var downloadLink = "?rekonDepag.do?action=download&file=";
  32. downloadLink = '<a href="rekonDepag.do?action=download&file='+ downloadedFile.fileName +'&folder=' + downloadedFile.directory + '">' + downloadedFile.fileName + '</a>';
  33. $("#downloadedListTable > tbody").append('<tr class="tr1"><td>' + downloadLink + '</td><td>' + downloadedFile.fileSize + '</td><td>' + downloadedFile.created + '</td><td></td></tr>');
  34. }
  35. if(downloadedFile.fileSize == 0) {
  36. $("#downloadSyariah").attr("disabled", true);
  37. } else {
  38. $("#downloadSyariah").attr("disabled", false);
  39. }
  40. $("#downloadAlert").html("Success get download files");
  41. } else {
  42. $("#downloadAlert").html("Generate file not exist");
  43. }
  44. var downloadedSyariahFiles = data["downloadedSyariahFiles"];
  45. $("#downloadedSyariahListTable > tbody").find("tr").remove();
  46. if (downloadedSyariahFiles != "NOT_EXISTS") {
  47. for (var i=0; i < downloadedSyariahFiles.length; i++) {
  48. var downloadedSyariah = downloadedSyariahFiles[i];
  49. var downloadLink = "?rekonDepag.do?action=download&file=";
  50. downloadLink = '<a href="rekonDepag.do?action=download&file='+ downloadedSyariah.fileName +'&folder=' + downloadedSyariah.directory + '">' + downloadedSyariah.fileName + '</a>';
  51. $("#downloadedSyariahListTable > tbody").append('<tr class="tr1"><td>' + downloadLink + '</td><td>' + downloadedSyariah.fileSize + '</td><td>' + downloadedSyariah.created + '</td><td></td></tr>');
  52. }
  53. if(downloadedSyariah.fileSize == 0) {
  54. $("#rekon").attr("disabled", true);
  55. } else {
  56. $("#rekon").attr("disabled", false);
  57. }
  58. $("#syariahAlert").html("Success get download syariah files");
  59. } else {
  60. $("#syariahAlert").html("Syariah files not exists");
  61. }
  62. var rekonFiles = data["rekonFiles"];
  63. $("#rekonListTable > tbody").find("tr").remove();
  64. if (rekonFiles != "NOT_EXISTS") {
  65. for (var i=0; i < rekonFiles.length; i++) {
  66. var downloadedFile = rekonFiles[i];
  67. var downloadLink = "?rekonDepag.do?action=download&file=";
  68. downloadLink = '<a href="rekonDepag.do?action=download&file='+ downloadedFile.fileName +'&folder=' + downloadedFile.directory + '">' + downloadedFile.fileName + '</a>';
  69. $("#rekonListTable > tbody").append('<tr class="tr1"><td>' + downloadLink + '</td><td>' + downloadedFile.fileSize + '</td><td>' + downloadedFile.created + '</td><td></td></tr>');
  70. }
  71. $("#rekonAlert").html("Success get rekon files");
  72. } else {
  73. $("#rekonAlert").html("Rekon files not exist");
  74. }
  75. $("#downloadAlert").fadeIn();
  76. $("#downloadAlert").delay(<bean:message key="rekon.jquery.delay"/>).fadeOut(<bean:message key="rekon.jquery.fadeout"/>);
  77. $("#syariahAlert").fadeIn();
  78. $("#syariahAlert").delay(<bean:message key="rekon.jquery.delay"/>).fadeOut(<bean:message key="rekon.jquery.fadeout"/>);
  79. $("#rekonAlert").fadeIn();
  80. $("#rekonAlert").delay(<bean:message key="rekon.jquery.delay"/>).fadeOut(<bean:message key="rekon.jquery.fadeout"/>);
  81. $("#viewRekonData").attr("disabled", false);
  82. }, "json"
  83. );
  84. });
  85. $("#download").click(function() {
  86. //DOWNLOAD CLICKED
  87. $("#download").attr("disabled", true);
  88. $('#step').val("HAJ_DEPAG_PROC")
  89. $.ajax({
  90. url: 'rekonDepag.do',
  91. data: {
  92. action: 'downloadDepag',
  93. fileDate: $('#fileDate').val(),
  94. chanel: $('#biller').val(),
  95. step: 'HAJ_DEPAG_PROC',
  96. rekonAction: 'HAJ_DEPAG_ACTION_FTP'
  97. },
  98. type: 'post',
  99. success: function(response){
  100. if (response.length > 0) {
  101. $("#downloadedListTable > tbody").find("tr").remove();
  102. for (var i=0; i < response.length; i++) {
  103. var downloadedFile = response[i];
  104. var downloadLink = "?rekonDepag.do?action=download&file=";
  105. downloadLink = '<a href="rekonDepag.do?action=download&file='+ downloadedFile.fileName +'&folder=' + downloadedFile.directory + '">' + downloadedFile.fileName + '</a>';
  106. $("#downloadedListTable > tbody").append('<tr class="tr1"><td>' + downloadLink + '</td><td>' + downloadedFile.fileSize + '</td><td>' + downloadedFile.created + '</td><td></td></tr>');
  107. }
  108. if(downloadedFile.fileSize == 0) {
  109. $("#download").attr("disabled", false);
  110. $("#downloadSyariah").attr("disabled", true);
  111. }else{
  112. $("#download").attr("disabled", true);
  113. $("#downloadSyariah").attr("disabled", false);
  114. }
  115. $("#downloadAlert").html("Success download files");
  116. } else {
  117. $("#downloadAlert").html("Download files not exist");
  118. $("#download").attr("disabled", false);
  119. $("#downloadSyariah").attr("disabled", true);
  120. }
  121. $("#downloadAlert").fadeIn();
  122. $("#downloadAlert").delay(<bean:message key="rekon.jquery.delay"/>).fadeOut(<bean:message key="rekon.jquery.fadeout"/>);
  123. },
  124. error: errorhandler,
  125. dataType: 'json'
  126. });
  127. });
  128. $("#downloadSyariah").click(function() {
  129. //DOWNLOAD SYARIAH CLICKED
  130. $("#downloadSyariah").attr("disabled", true);
  131. $('#step').val("HAJ_SYARIAH_PROC")
  132. $.ajax({
  133. url: 'rekonDepag.do',
  134. data: {
  135. action: 'downloadSyariah',
  136. fileDate: $('#fileDate').val(),
  137. chanel: $('#biller').val(),
  138. step: 'HAJ_SYARIAH_PROC',
  139. rekonAction: 'HAJ_SYARIAH_ACTION_FTP'
  140. },
  141. type: 'post',
  142. success: function(response){
  143. if (response.length > 0) {
  144. $("#downloadedSyariahListTable > tbody").find("tr").remove();
  145. for (var i=0; i < response.length; i++) {
  146. var downloadedFile = response[i];
  147. var downloadLink = "?rekonDepag.do?action=download&file=";
  148. downloadLink = '<a href="rekonDepag.do?action=download&file='+ downloadedFile.fileName +'&folder=' + downloadedFile.directory + '">' + downloadedFile.fileName + '</a>';
  149. $("#downloadedSyariahListTable > tbody").append('<tr class="tr1"><td>' + downloadLink + '</td><td>' + downloadedFile.fileSize + '</td><td>' + downloadedFile.created + '</td><td></td></tr>');
  150. }
  151. if(downloadedFile.fileSize == 0) {
  152. $("#downloadSyariah").attr("disabled", false);
  153. $("#rekon").attr("disabled", true);
  154. } else {
  155. $("#downloadSyariah").attr("disabled", true);
  156. $("#rekon").attr("disabled", false);
  157. }
  158. $("#syariahAlert").html("Success download files");
  159. } else {
  160. $("#syariahAlert").html("Download files not exist");
  161. $("#downloadSyariah").attr("disabled", false);
  162. $("#rekon").attr("disabled", true);
  163. }
  164. $("#syariahAlert").fadeIn();
  165. $("#syariahAlert").delay(<bean:message key="rekon.jquery.delay"/>).fadeOut(<bean:message key="rekon.jquery.fadeout"/>);
  166. },
  167. error: errorhandler,
  168. dataType: 'json'
  169. });
  170. });
  171. $("#rekon").click(function() {
  172. //DOWNLOAD SYARIAH CLICKED
  173. $("#rekon").attr("disabled", true);
  174. $('#step').val("HAJ_COMPARE_PROC")
  175. $('#step2').val("HAJ_PRINT_PROC")
  176. $.ajax({
  177. url: 'rekonDepag.do',
  178. data: {
  179. action: 'rekonSyariah',
  180. fileDate: $('#fileDate').val(),
  181. chanel: $('#biller').val(),
  182. step: 'HAJ_COMPARE_PROC',
  183. step2: 'HAJ_PRINT_PROC',
  184. rekonAction: 'HAJ_PRINT_ACTION'
  185. },
  186. type: 'post',
  187. success: function(response){
  188. if (response.length > 0) {
  189. $("#rekonListTable > tbody").find("tr").remove();
  190. for (var i=0; i < response.length; i++) {
  191. var downloadedFile = response[i];
  192. var downloadLink = "?rekonDepag.do?action=download&file=";
  193. downloadLink = '<a href="rekonDepag.do?action=download&file='+ downloadedFile.fileName +'&folder=' + downloadedFile.directory + '">' + downloadedFile.fileName + '</a>';
  194. $("#rekonListTable > tbody").append('<tr class="tr1"><td>' + downloadLink + '</td><td>' + downloadedFile.fileSize + '</td><td>' + downloadedFile.created + '</td><td></td></tr>');
  195. }
  196. $("#rekonAlert").html("Success download files");
  197. } else {
  198. $("#rekonAlert").html("Download files not exist");
  199. }
  200. $("#rekonAlert").fadeIn();
  201. $("#rekonAlert").delay(<bean:message key="rekon.jquery.delay"/>).fadeOut(<bean:message key="rekon.jquery.fadeout"/>);
  202. $("#rekon").attr("disabled", false);
  203. },
  204. error: errorhandler,
  205. dataType: 'json'
  206. });
  207. });
  208. });
  209. function page(start, count){
  210. document.forms.appSetting.start.value=start;
  211. document.forms.appSetting.count.value=count;
  212. document.forms.appSetting.action.value="list";
  213. document.forms.appSetting.submit();
  214. }
  215. function doChangePage(count){
  216. document.forms.appSetting.start.value= (document.forms.appSetting.startx.value-1)*20;
  217. if(document.forms.appSetting.start.value=="NaN") document.forms.appSetting.start.value = 0;
  218. document.forms.appSetting.count.value=count;
  219. document.forms.appSetting.action.value="list";
  220. document.forms.appSetting.submit();
  221. //doDisable(document.forms.appSetting, "button");
  222. }
  223. function fillIndex(val){
  224. document.forms.appSetting.startx.value = val.value;
  225. }
  226. function doCreate(){
  227. document.forms.rekonFirst.action.value="generate";
  228. document.forms.rekonFirst.chanel.value = document.forms.rekonForm.billler.value;
  229. document.forms.rekonFirst.submit();
  230. doDisable(document.forms.rekonFirst, "button");
  231. }
  232. function doDetail(code){
  233. document.forms.appSetting.code.value=code;
  234. document.forms.appSetting.action.value="detail";
  235. document.forms.appSetting.submit();
  236. }
  237. function doFilter(){
  238. document.forms.appSetting.action.value="list";
  239. document.forms.appSetting.submit();
  240. doDisable(document.forms.appSetting, "button");
  241. }
  242. function doReset(){
  243. document.forms.appSetting.appSetting_code_filter.value="";
  244. document.forms.appSetting.appSetting_name_filter.value="";
  245. document.forms.appSetting.clear.value="true";
  246. document.forms.appSetting.action.value="list";
  247. document.forms.appSetting.submit();
  248. doDisable(document.forms.appSetting, "button");
  249. }
  250. function doOrder(field, type){
  251. document.forms.appSetting.appSetting_fieldOrder.value=field;
  252. document.forms.appSetting.appSetting_orderType.value=type;
  253. document.forms.appSetting.action.value="list";
  254. document.forms.appSetting.submit();
  255. doDisable(document.forms.status, "button");
  256. }
  257. function doGenerate(folder){
  258. var form = document.forms.rekonForm;
  259. form.folder.value=folder;
  260. form.action.value="view";
  261. form.submit();
  262. }
  263. </script>
  264. <!-- CONTENT -->
  265. <form name="rekonForm" method="post" action="rekonDepag.do">
  266. <input type="hidden" name="start" value="">
  267. <input type="hidden" name="startx" value="">
  268. <input type="hidden" name="action" value="">
  269. <input type="hidden" name="count" value="">
  270. <input type="hidden" name="code" value="">
  271. <input type="hidden" name="clear" value="">
  272. <input type="hidden" name="folder">
  273. <input type="hidden" name="focus_field" value=""/>
  274. <table width="100%" border="0" cellspacing="1" cellpadding="2">
  275. <tr>
  276. <td colspan="3" class="AddressTitle">REKON SYARIAH</td>
  277. </tr>
  278. </table>
  279. <table border="0" width="98%" align="center" cellpadding="2" cellspacing="1">
  280. <tr><td><html:errors/></td></tr>
  281. </table>
  282. <table width="100%" border="0" cellspacing="1" cellpadding="2">
  283. <tr>
  284. <td width="20%">Biller</td>
  285. <td width="2%">:</td>
  286. <td width="78%">
  287. &nbsp;Depag
  288. </td>
  289. </tr>
  290. <tr>
  291. <td width="20%">Rekon Date</td>
  292. <td width="2%">:</td>
  293. <td width="78%">
  294. <input type="text" id="fileDate" name="fileDate" value="" size="15" maxlength="10" >
  295. <a href="javascript:cal_rekonDate.popup();"><img src="./images/cal.gif" width="16" height="16" border="0" alt=""></a>
  296. <script type="text/javascript" language="javascript">
  297. var cal_rekonDate = new calendar1(document.forms['rekonForm'].elements['fileDate']);
  298. </script>
  299. </td>
  300. </tr>
  301. <tr>
  302. <td colspan="3">
  303. <input type="button" id="viewRekonData" name="viewRekonData" value="View"></td>
  304. <!--input type="button" value="View" onclick="doGenerate('REKON/PRINT/SYARIAH');"-->
  305. </td>
  306. </tr>
  307. </table>
  308. </form><br>
  309. <script language="javascript">
  310. function toggle(targetId) {
  311. target = document.all(targetId);
  312. if (target.style.display == "none"){
  313. target.style.display="";
  314. } else {
  315. target.style.display="none";
  316. }
  317. }
  318. //-->
  319. </script>
  320. <table width="100%" cellspacing="5" cellpadding="5">
  321. <tr>
  322. <td class="boxWhite">
  323. <table width="100%" border="0" cellspacing="1" cellpadding="2">
  324. <tr>
  325. <td colspan="3">
  326. <table width="100%" cellpadding="0" cellspacing="0" border="0">
  327. <tr>
  328. <td class="AddressTitle2">Download Depag </td>
  329. <td align="right" class="AddressTitle2">
  330. <a href="javascript:toggle('downloadLink','slide')">View</a>
  331. </td>
  332. </tr>
  333. </table>
  334. </td>
  335. </tr>
  336. </table>
  337. <table width="100%" border="0" cellspacing="2" cellpadding="2">
  338. <tr>
  339. <td colspan="3">
  340. <table width="100%" cellpadding="0" cellspacing="0" border="0">
  341. <tr>
  342. <td class="AddressTitle2"><span id="downloadAlert"></span></td>
  343. </tr>
  344. </table>
  345. </td>
  346. </tr>
  347. </table>
  348. <div id="downloadLink">
  349. <table width="100%" border="0" cellspacing="1" cellpadding="2">
  350. <tr>
  351. <td>
  352. <input type="reset" name="download" id="download" value="Download" />
  353. </td>
  354. <td>&nbsp;</td>
  355. </tr>
  356. </table><br>
  357. <table id="downloadedListTable" width="100%" border="0" cellspacing="1" cellpadding="2">
  358. <thead>
  359. <tr>
  360. <td class="titleField">Download Status</td>
  361. <td class="titleField">File Size</td>
  362. <td class="titleField">Date</td>
  363. <td class="titleField">&nbsp;</td>
  364. </tr>
  365. </thead>
  366. <tbody>
  367. <tr class="tr1">
  368. <td align="center">&nbsp;</td>
  369. <td align="center">&nbsp;</td>
  370. <td align="center">&nbsp;</td>
  371. <td align="center">&nbsp;</td>
  372. </tr>
  373. </tbody>
  374. </table>
  375. </div>
  376. </td>
  377. </tr>
  378. </table>
  379. <table width="100%" cellspacing="5" cellpadding="5">
  380. <tr>
  381. <td class="boxWhite">
  382. <table width="100%" border="0" cellspacing="1" cellpadding="2">
  383. <tr>
  384. <td colspan="3">
  385. <table width="100%" cellpadding="0" cellspacing="0" border="0">
  386. <tr>
  387. <td class="AddressTitle2">Download Syariah </td>
  388. <td align="right" class="AddressTitle2">
  389. <a href="javascript:toggle('downloadSyariahLink','slide')">View</a>
  390. </td>
  391. </tr>
  392. </table>
  393. </td>
  394. </tr>
  395. </table>
  396. <table width="100%" border="0" cellspacing="2" cellpadding="2">
  397. <tr>
  398. <td colspan="3">
  399. <table width="100%" cellpadding="0" cellspacing="0" border="0">
  400. <tr>
  401. <td class="AddressTitle2"><span id="syariahAlert"></span></td>
  402. </tr>
  403. </table>
  404. </td>
  405. </tr>
  406. </table>
  407. <div id="downloadSyariahLink">
  408. <table width="100%" border="0" cellspacing="1" cellpadding="2">
  409. <tr>
  410. <td>
  411. <input type="reset" name="downloadSyariah" id="downloadSyariah" value="Download" />
  412. </td>
  413. <td>&nbsp;</td>
  414. </tr>
  415. </table><br>
  416. <table id="downloadedSyariahListTable" width="100%" border="0" cellspacing="1" cellpadding="2">
  417. <thead>
  418. <tr>
  419. <td class="titleField">Download Status</td>
  420. <td class="titleField">File Size</td>
  421. <td class="titleField">Date</td>
  422. <td class="titleField">&nbsp;</td>
  423. </tr>
  424. </thead>
  425. <tbody>
  426. <tr class="tr1">
  427. <td align="center">&nbsp;</td>
  428. <td align="center">&nbsp;</td>
  429. <td align="center">&nbsp;</td>
  430. <td align="center">&nbsp;</td>
  431. </tr>
  432. </tbody>
  433. </table>
  434. </div>
  435. </td>
  436. </tr>
  437. </table>
  438. <table width="100%" cellspacing="5" cellpadding="5">
  439. <tr>
  440. <td class="boxWhite">
  441. <table width="100%" border="0" cellspacing="1" cellpadding="2">
  442. <tr>
  443. <td colspan="3">
  444. <table width="100%" cellpadding="0" cellspacing="0" border="0">
  445. <tr>
  446. <td class="AddressTitle2">Rekon </td>
  447. <td align="right" class="AddressTitle2">
  448. <a href="javascript:toggle('rekonLink','slide')">View</a>
  449. </td>
  450. </tr>
  451. </table>
  452. </td>
  453. </tr>
  454. </table>
  455. <table width="100%" border="0" cellspacing="2" cellpadding="2">
  456. <tr>
  457. <td colspan="3">
  458. <table width="100%" cellpadding="0" cellspacing="0" border="0">
  459. <tr>
  460. <td class="AddressTitle2"><span id="rekonAlert"></span></td>
  461. </tr>
  462. </table>
  463. </td>
  464. </tr>
  465. </table>
  466. <div id="rekonLink">
  467. <table width="100%" border="0" cellspacing="1" cellpadding="2">
  468. <tr>
  469. <td>
  470. <input type="reset" name="rekon" id="rekon" value="Rekon" />
  471. </td>
  472. <td>&nbsp;</td>
  473. </tr>
  474. </table><br>
  475. <table id="rekonListTable" width="100%" border="0" cellspacing="1" cellpadding="2">
  476. <thead>
  477. <tr>
  478. <td class="titleField">Rekon Status</td>
  479. <td class="titleField">File Size</td>
  480. <td class="titleField">Date</td>
  481. <td class="titleField">&nbsp;</td>
  482. </tr>
  483. </thead>
  484. <tbody>
  485. <tr class="tr1">
  486. <td align="center">&nbsp;</td>
  487. <td align="center">&nbsp;</td>
  488. <td align="center">&nbsp;</td>
  489. <td align="center">&nbsp;</td>
  490. </tr>
  491. </tbody>
  492. </table>
  493. </div>
  494. </td>
  495. </tr>
  496. </table>
  497. <!-- END CONTENT -->
  498. <logic:notEmpty name="focus"><bean:write name="focus" filter="false" /></logic:notEmpty>
  499. <%@ include file="../common/footer.jsp"%>