tokenRequestPln_list.jsp 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. <%@ include file="../common/header.jsp"%>
  2. <script type="text/javascript" language="javascript">
  3. <!--
  4. function doFilter() {
  5. var form = document.forms.tokenRequestPln;
  6. form.action.value="list";
  7. doDisable(form, "button");
  8. form.submit();
  9. }
  10. function doClaim(tempTableId, dlogId) {
  11. var form = document.forms.tokenRequestPln;
  12. var x = window.confirm("<bean:message key="confirm.claimToken"/>")
  13. if (x) {
  14. form.action.value = "claim_token";
  15. form.tempTableId.value = tempTableId;
  16. form.dlogId.value = dlogId;
  17. doDisable(form, "button");
  18. form.submit();
  19. }
  20. }
  21. function doGetToken(meterNo, refNo, idPelanggan) {
  22. var form = document.forms.tokenRequestPln;
  23. doDisable(form, "button");
  24. try {
  25. var req = createXMLHttpRequest();
  26. req.open("GET", "tokenRequestPln.do?action=get_token&meterNo=" +meterNo+ "&refNo=" +refNo+ "&idPelanggan=" +idPelanggan+ "&ts=" +new Date().getTime());
  27. var res = "";
  28. req.onreadystatechange = function(){
  29. if (req.readyState < 4){
  30. document.getElementById("token_div_" +refNo).innerHTML = "<img src='images/wait.gif' border=0 >&nbsp;<b>Please Wait...<\/b>";
  31. }
  32. if (req.readyState == 4){
  33. var response = req.responseText;
  34. document.getElementById("token_div_" +refNo).innerHTML = response;
  35. if (response.length > 0 && (response == "Token not exist!" || response == "Problem Occurred!")) {
  36. document.getElementById("token_div_" +refNo).style.color='red';
  37. }
  38. doEnable(form, "button");
  39. }
  40. }
  41. req.send(null);
  42. } catch(e) {
  43. alert(e);
  44. }
  45. }
  46. -->
  47. </script>
  48. <!-- CONTENT -->
  49. <form name="tokenRequestPln" method="post" action="tokenRequestPln.do">
  50. <input type="hidden" name="action" value="" />
  51. <input type="hidden" name="clear" value="" />
  52. <input type="hidden" name="tempTableId" value="" />
  53. <input type="hidden" name="dlogId" value="" />
  54. <table width="100%" border="0" cellpadding="1" cellspacing="2">
  55. <tr>
  56. <td class="titleHeader"><bean:message key="project.tokenRequestPln.key"/></td>
  57. </tr>
  58. </table>
  59. <table width="100%" border="0" cellspacing="1" cellpadding="2">
  60. <tr><td><html:errors /></td></tr>
  61. </table>
  62. <table width="100%" border="0" cellspacing="1" cellpadding="2">
  63. <tr>
  64. <td width="20%"><b><bean:message key="tokenRequestPln.idPelanggan.key"/></b></td>
  65. <td width="1%">:</td>
  66. <td width="29%">
  67. <label><input type="text" name="tokenRequestPln_idPelanggan_filter" value="<logic:notEmpty name="tokenRequestPln_idPelanggan_filter"><bean:write name="tokenRequestPln_idPelanggan_filter"/></logic:notEmpty>" /></label>
  68. </td>
  69. <td width="50%">&nbsp;</td>
  70. </tr>
  71. <tr>
  72. <td width="20%"><b><bean:message key="tokenRequestPln.meterNo.key"/></b></td>
  73. <td width="1%">:</td>
  74. <td width="29%">
  75. <label><input type="text" name="tokenRequestPln_meterNo_filter" value="<logic:notEmpty name="tokenRequestPln_meterNo_filter"><bean:write name="tokenRequestPln_meterNo_filter"/></logic:notEmpty>" /></label>
  76. </td>
  77. <td width="50%">&nbsp;</td>
  78. </tr>
  79. <tr>
  80. <td width="20%"><b><bean:message key="tokenRequestPln.refNo.key"/></b></td>
  81. <td width="1%">:</td>
  82. <td width="29%">
  83. <label><input type="text" name="tokenRequestPln_refNo_filter" value="<logic:notEmpty name="tokenRequestPln_refNo_filter"><bean:write name="tokenRequestPln_refNo_filter"/></logic:notEmpty>" /></label>
  84. </td>
  85. <td width="50%">&nbsp;</td>
  86. </tr>
  87. <tr>
  88. <td colspan="4">&nbsp;</td>
  89. </tr>
  90. <tr>
  91. <td>&nbsp;</td>
  92. <td>&nbsp;</td>
  93. <td colspan="4" align="left">
  94. <input type="button" value="<bean:message key="button.search"/>" onclick="doFilter();"/>
  95. </td>
  96. </tr>
  97. <tr>
  98. <td colspan="4">&nbsp;</td>
  99. </tr>
  100. <tr>
  101. <td colspan="4">&nbsp;</td>
  102. </tr>
  103. </table>
  104. <table width="100%" border="0" cellspacing="1" cellpadding="1">
  105. <tr>
  106. <td width="5%" class="titleField"><div align="center">#</div></td>
  107. <td align="left" height="10" valign="top" class="titleField"><bean:message key="tokenRequestPln.insertDate.key" /></td>
  108. <td align="left" height="10" valign="top" class="titleField"><bean:message key="tokenRequestPln.idPelanggan.key" /></td>
  109. <td align="left" height="10" valign="top" class="titleField"><bean:message key="tokenRequestPln.meterNo.key" /></td>
  110. <td align="left" height="10" valign="top" class="titleField"><bean:message key="tokenRequestPln.refNo.key"/></td>
  111. <td align="left" height="10" valign="top" class="titleField"><bean:message key="tokenRequestPln.token.key"/></td>
  112. <td align="left" height="10" valign="top" class="titleField"><bean:message key="tokenRequestPln.claimDate.key"/></td>
  113. <td align="left" height="10" valign="top" class="titleField"><bean:message key="tokenRequestPln.isClaim.key"/></td>
  114. </tr>
  115. <logic:notEmpty name="tokenRequestPlnList">
  116. <logic:iterate id="element" name="tokenRequestPlnList" scope="request" indexId="index">
  117. <%
  118. sequence++;
  119. String bgcolor = "FFFFFF";
  120. if(sequence%2 == 0){
  121. bgcolor = "EDEDE8";
  122. }
  123. %>
  124. <tr bgcolor="<% out.print(bgcolor); %>" onmouseover="mOvr(this);" onmouseout="mOut(this, '<% out.print(bgcolor); %>');">
  125. <td align="center" class="celBorder"><%=++seq%>&nbsp;</td>
  126. <td align="left" class="celBorder">
  127. <bean:write name="element" property="a02" />&nbsp;<bean:write name="element" property="a01" />
  128. </td>
  129. <td align="left" class="celBorder"><bean:write name="element" property="a10"/></td>
  130. <td align="left" class="celBorder"><bean:write name="element" property="a07"/></td>
  131. <td align="left" class="celBorder"><bean:write name="element" property="a09"/></td>
  132. <td align="left" class="celBorder">
  133. <logic:notEmpty name="element" property="a15">
  134. <bean:write name="element" property="a15"/>
  135. </logic:notEmpty>
  136. <logic:empty name="element" property="a15">
  137. <div id="token_div_${element.a09}" align="left"><input id="getToken_btn_${element.a09}" type="button" value="<bean:message key="button.getToken"/>" onclick="doGetToken('<bean:write name="element" property="a07" />', '<bean:write name="element" property="a09" />', '<bean:write name="element" property="a10" />');"/></div>
  138. </logic:empty>
  139. </td>
  140. <td align="left" class="celBorder"><logic:notEmpty name="element" property="a17"><bean:write name="element" property="a17" /></logic:notEmpty><logic:empty name="element" property="a17">&nbsp;</logic:empty></td>
  141. <td align="center" class="celBorder">
  142. <logic:notEmpty name="element" property="a15">
  143. <logic:notEmpty name="element" property="a16">
  144. <logic:equal name="element" property="a16" value="1">
  145. CLAIMED
  146. </logic:equal>
  147. <logic:notEqual name="element" property="a16" value="1">
  148. <input type="button" value="<bean:message key="button.claim"/>" onclick="doClaim('<bean:write name="element" property="temptablePk" />', '<bean:write name="element" property="a33" />');"/>
  149. </logic:notEqual>
  150. </logic:notEmpty>
  151. <logic:empty name="element" property="a16">
  152. <input type="button" value="<bean:message key="button.claim"/>" onclick="doClaim('<bean:write name="element" property="temptablePk" />', '<bean:write name="element" property="a33" />');"/>
  153. </logic:empty>
  154. </logic:notEmpty>
  155. </td>
  156. </tr>
  157. </logic:iterate>
  158. </logic:notEmpty>
  159. <logic:empty name="tokenRequestPlnList">
  160. <tr>
  161. <td colspan="7"><font color="#FF0000">no record data</font></td>
  162. </tr>
  163. </logic:empty>
  164. </table>
  165. </form>
  166. <!-- END CONTENT -->
  167. <logic:notEmpty name="focus"><bean:write name="focus" filter="false" /></logic:notEmpty>
  168. <%@ include file="../common/footer.jsp"%>