| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249 |
- <%@ include file="../common/header.jsp"%>
- <script type="text/javascript" src="./js/autocomplete/jquery.js"></script>
- <script type='text/javascript'
- src='./js/autocomplete/jquery.bgiframe.min.js'></script>
- <script type='text/javascript'
- src='./js/autocomplete/jquery.ajaxQueue.js'></script>
- <script type='text/javascript'
- src='./js/autocomplete/thickbox-compressed.js'></script>
- <script type='text/javascript'
- src='./js/autocomplete/jquery.autocomplete.js'></script>
- <script type='text/javascript' src='./js/autocomplete/localdata.js'></script>
- <script type="text/javascript" language="javascript">
- <!--
- function loadPageInit() {
- doLoadBillerReport();
- }
-
- function doChangeReport() {
- doLoadBillerReport();
- }
-
- function doLoadBillerReport() {
- var form = document.forms.billerData;
- var code = form.billerCode.value;
- var req = createXMLHttpRequest();
-
- if (code <= 0) {
- document.getElementById('report_div').innerHTML = "";
- } else {
- try {
- var url = "billerData.do?action=getBillerReport&code=" +code+ "&ts=" +new Date().getTime();
- req.open("GET", url);
-
- req.onreadystatechange = function(){
- if (req.readyState < 4){
- document.getElementById('report_div').innerHTML = "<img src='./images/wait.gif' border=0 > <b>Please Wait...<\/b>";
- }
- if (req.readyState == 4){
- var response = req.responseText;
- if (response) {
- var responseHTML = "<tr><td>";
- responseHTML = responseHTML + "<input type=\"checkbox\" id=\"header\" value=\"checkbox\" onclick=\"checkAll('header','report');\">";
- responseHTML = responseHTML + " Check All";
- responseHTML = responseHTML + "</td></tr><br/>";
- var rst = eval("(" + response + ")");
- for(var i=0;i<rst.length;i++){
- var code = rst[i].code;
- var name = rst[i].name;
- var checked = rst[i].checked;
- responseHTML = responseHTML + "<tr><td>";
- responseHTML = responseHTML + "<input type=\"checkbox\"";
- if (checked == true)
- responseHTML = responseHTML + "checked=\"CHECKED\"";
-
- responseHTML = responseHTML + " name=\"report_" + code + "\">";
- responseHTML = responseHTML + " " + name;
- responseHTML = responseHTML + "</td></tr><br/>";
- }
- document.getElementById('report_div').innerHTML = responseHTML;
- } else {
- document.getElementById('report_div').innerHTML = "";
- }
- }
- }
- req.send(null);
-
- } catch(e) {
- alert(e);
- }
- }
- }
- $(function() {
- function format(jsonmap) {
- return jsonmap.name+ " - " +jsonmap.value;
- }
- $("#idNhBilCon").autocomplete('billerData.do?action=loadCodeBillerName', {
- dataType: "json",
- parse: function(data) {
- return $.map(data, function(row) {
- return {
- data: row,
- value: row.name,
- result: row.name
- }
- });
- },
- formatItem: function(jsonmap) {
- return format(jsonmap);
- }
- }).result(function(e, jsonmap) {
- //after select
- $("#biller").val(jsonmap.value);
- $("#idNhBilCon").val(format(jsonmap));
- $("#nhBillerCode").val(jsonmap.name);
- });
- });
-
- function doCreate(){
- var x = window.confirm("<bean:message key="confirm.create" />");
- if (x) {
- document.forms.billerData.action.value="create_ok";
- document.forms.billerData.post.value = "true";
- document.forms.billerData.submit();
- doDisable(document.forms.billerData, "button");
- }
- }
-
- function doAddParent(){
- document.forms.billerData.addParent.disabled=true;
- document.forms.billerData.action.value="add_parent";
- document.forms.billerData.itemFocus.value="name";
- document.forms.billerData.submit();
- }
-
- function doBack(){
- document.forms.billerData.action.value="list";
- document.forms.billerData.clear.value="true";
- document.forms.billerData.submit();
- }
-
- function checkAll(header, chk) {
- var chkbox = document.getElementsByTagName('input');
- if(document.getElementById(header).checked==true){
- for (i = 0; i < chkbox.length; i++) {
- if(chkbox[i].type == 'checkbox' && chkbox[i].name.substr(0, chkbox[i].name.indexOf('_')) == chk)
- chkbox[i].checked = true ;
- }
- } else {
- for (i = 0; i < chkbox.length; i++) {
- if(chkbox[i].type == 'checkbox' && chkbox[i].name.substr(0, chkbox[i].name.indexOf('_')) == chk)
- chkbox[i].checked = false ;
- }
- }
- }
-
- function doRefreshBiller(){
- document.forms.billerData.action.value="refresh_biller";
- document.forms.billerData.submit();
- doDisable(document.forms.billerData, "button");
- }
-
- --></script>
- <!-- CONTENT -->
- <form name="billerData" method="post" action="billerData.do"><input
- type="hidden" name="action"> <input type="hidden" name="post">
- <input type="hidden" name="clear"> <input type="hidden"
- name="itemFocus"> <input type="hidden" name="redirect"
- value="create"> <input type="hidden" id="biller" name="biller">
- <input type="hidden" id="nhBillerCode" name="nhBillerCode"> <input
- type="hidden" name="ts"
- value="<logic:notEmpty name="ts"><bean:write name="ts" /></logic:notEmpty>">
- <table width="100%" border="0" align="center" cellpadding="2"
- cellspacing="4">
- <tr>
- <td class="titleHeader" align="left"><bean:message
- key="project.biller.key" /> - CREATE</td>
- </tr>
- </table>
- <table width="100%" border="0" align="center" cellpadding="2"
- cellspacing="4">
- <tr>
- <td align="center">
- <table width="100%" border="0" cellspacing="1" cellpadding="2">
- <tr>
- <td colspan="5"><html:errors /></td>
- </tr>
- <tr align="left">
- <td width="15%"><b><bean:message
- key="billerData.biller.key" /></b></td>
- <td width="1%">:</td>
- <td width="84%" valign="top" colspan="4">
- <table border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td><input type="text" name="idNhBillerData" size="50"
- id="idNhBilCon"></td>
- <td><input type="button" value="refresh"
- onclick="doRefreshBiller();"></td>
- </tr>
- </table>
- </td>
- </tr>
- <tr align="left">
- <td width="15%"><b><bean:message
- key="billerData.category.key" /></b></td>
- <td width="1%">:</td>
- <td width="34%" valign="top"><select name="billerCode"
- style="width: 200" onchange="doChangeReport();">
- <option value="">-- Select Biller Category --</option>
- <logic:notEmpty name="billerCategoryList">
- <logic:iterate id="element_billerCategory"
- name="billerCategoryList">
- <option
- value="<bean:write name="element_billerCategory" property="code" />"
- <logic:notEmpty name="billerCategoryCode">
- <logic:equal name="billerCategoryCode" value="${element_billerCategory.code}">
- selected
- </logic:equal>
- </logic:notEmpty>><bean:write
- name="element_billerCategory" property="name" /></option>
- </logic:iterate>
- </logic:notEmpty>
- </select></td>
- </tr>
- <tr>
- <td width="15%" valign="top"><b><bean:message
- key="billerData.report.key" /></b></td>
- <td width="1%" valign="top">:</td>
- <td width="84%" valign="top" colspan="4"><!--div style="overflow:auto;height: 150px; width: 300px;;border:1px solid #336699;padding-left:5px"-->
- <table border="0" width="100%" align="left" cellpadding="0"
- cellspacing="0">
- <!--tr>
- <td><input type="checkbox" id="header" value="checkbox" onclick="checkAll('header','report');"></td>
- </tr-->
- <tr>
- <td>
- <div id="report_div" align="left"> </div>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <td width="15%"></td>
- <td width="1%"></td>
- <td width="84%"><input type="button"
- value="<bean:message key="button.back"/>"
- onclick="javascript:doBack();"> <input type="button"
- value="<bean:message key="button.submit"/>"
- onclick="javascript:doCreate();"></td>
- <td colspan="4"> </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </form>
- <!-- END CONTENT -->
- <logic:notEmpty name="biller" property="code">
- <script type="text/javascript" language="javascript">loadPageInit();</script>
- </logic:notEmpty>
- <%@ include file="../common/footer.jsp"%>
|