dlog_list.jsp 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459
  1. <%@ include file="../common/header.jsp"%>
  2. <%
  3. if (seq==0){
  4. seq = request.getAttribute("dlog_start") == null ? 0 : (Integer) request.getAttribute("dlog_start");
  5. }
  6. %>
  7. <script type="text/javascript" language="javascript"><!--
  8. function loadPageInit() {
  9. doLoadC1();
  10. }
  11. function doLoadC1() {
  12. var form = document.forms.dlog;
  13. try {
  14. var dlogMdCRemovalObj = form.dlogMd_label_filter;
  15. var type = form.dlog_type_filter.value;
  16. var idParam = form.dlogMd_label_filter.value;
  17. var idLabel = form.labelFilter.value;
  18. if (type.length > 0) {
  19. var req = createXMLHttpRequest();
  20. var url = "dlog.do?action=getCList&type=" +type;
  21. var loop = 0;
  22. req.open("GET", url);
  23. req.onreadystatechange = function() {
  24. if (req.readyState == 4) {
  25. dlogMdCRemovalObj.length = 0;
  26. dlogMdCRemovalObj.options[0] = new Option("-- Select DlogMd Label --", "");
  27. document.getElementById("message").innerHTML="";
  28. var response = req.responseText;
  29. if (response) {
  30. var rst = eval("(" + req.responseText + ")");
  31. for(var i=0;i<rst.length;i++){
  32. var dlogMdCId = rst[i].id;
  33. var dlogMdCIdName = rst[i].name;
  34. dlogMdCRemovalObj.options[i+1] = new Option(dlogMdCIdName, dlogMdCId);
  35. if(idParam == dlogMdCId) {
  36. dlogMdCRemovalObj.options[loop+1].selected = true;
  37. }else if(idLabel == dlogMdCId) {
  38. dlogMdCRemovalObj.options[loop+1].selected = true;
  39. }
  40. loop++;
  41. }
  42. } else {
  43. dlogMdCRemovalObj.length = 0;
  44. dlogMdCRemovalObj.options[0] = new Option("-- Select DlogMd Label --", "");
  45. }
  46. } else {
  47. dlogMdCRemovalObj.length = 0;
  48. dlogMdCRemovalObj.options[0] = new Option("-- Select DlogMd Label --", "");
  49. document.getElementById("message").innerHTML="<img src='./images/wait.gif' border=0 >&nbsp;<b>Please Wait...<\/b>";
  50. }
  51. }
  52. req.send(null);
  53. } else {
  54. dlogMdCRemovalObj.length = 0;
  55. dlogMdCRemovalObj.options[0] = new Option("-- Select DlogMd Label --", "");
  56. }
  57. } catch(e) {
  58. alert(e);
  59. }
  60. }
  61. function page(start, count){
  62. document.forms.dlog.start.value=start;
  63. document.forms.dlog.count.value=count;
  64. document.forms.dlog.action.value="list";
  65. document.forms.dlog.submit();
  66. doDisable(document.forms.dlog, "button");
  67. }
  68. function doChangePage(count){
  69. document.forms.dlog.start.value= (document.forms.dlog.startx.value-1)*20;
  70. if(document.forms.dlog.start.value=="NaN") document.forms.dlog.start.value = 0;
  71. document.forms.dlog.count.value=count;
  72. document.forms.dlog.action.value="list";
  73. document.forms.dlog.submit();
  74. doDisable(document.forms.dlog, "button");
  75. }
  76. function fillIndex(val){
  77. document.forms.dlog.startx.value = val.value;
  78. }
  79. function handleEvent(oEvent) {
  80. var arrKeys = [];
  81. if (oEvent.shiftKey) {
  82. arrKeys.push("Shift");
  83. }
  84. }
  85. function doDetail(id){
  86. //alert("My world is full :-)".wordWrap(10, "\n+", true));
  87. //document.forms.dlogDetail.target="_blank";
  88. document.forms.dlog.id.value=id;
  89. document.forms.dlog.action.value="detail";
  90. //handleEvent(event);
  91. document.forms.dlog.submit();
  92. }
  93. function doFilter(){
  94. document.forms.dlog.action.value="list";
  95. document.forms.dlog.submit();
  96. doDisable(document.forms.dlog, "button");
  97. }
  98. function doReset(){
  99. document.forms.dlog.dlog_type_filter.value="";
  100. document.forms.dlog.dlog_source_filter.value="";
  101. document.forms.dlog.dlog_code_filter.value="";
  102. document.forms.dlog.dlog_value_filter.value="";
  103. document.forms.dlog.dlogMd_label_filter.value="";
  104. document.forms.dlog.dlog_timestamp_start_filter.value="";
  105. document.forms.dlog.dlog_timestamp_hour_start_filter.value="";
  106. document.forms.dlog.dlog_timestamp_minute_start_filter.value="";
  107. document.forms.dlog.dlog_timestamp_end_filter.value="";
  108. document.forms.dlog.dlog_timestamp_hour_end_filter.value="";
  109. document.forms.dlog.dlog_timestamp_minute_end_filter.value="";
  110. document.forms.dlog.clear.value="true";
  111. document.forms.dlog.action.value="list";
  112. document.forms.dlog.submit();
  113. doDisable(document.forms.dlog, "button");
  114. }
  115. function doOrder(field, type){
  116. document.forms.dlog.dlog_fieldOrder.value=field;
  117. document.forms.dlog.dlog_orderType.value=type;
  118. document.forms.dlog.action.value="list";
  119. document.forms.dlog.submit();
  120. doDisable(document.forms.status, "button");
  121. }
  122. String.prototype.wordWrap = function(m, b, c){
  123. var i, j, s, r = this.split("\n");
  124. if(m > 0) for(i in r){
  125. for(s = r[i], r[i] = ""; s.length > m;
  126. j = c ? m : (j = s.substr(0, m).match(/\S*$/)).input.length - j[0].length || m,r[i] += s.substr(0, j) + ((s = s.substr(j)).length ? b : ""));
  127. r[i] += s;
  128. }
  129. return r.join("\n");
  130. }
  131. --></script>
  132. <!-- CONTENT -->
  133. <form name="dlog" method="post" action="dlog.do" target="_self">
  134. <input type="hidden" name="start" value="">
  135. <input type="hidden" name="startx" value="">
  136. <input type="hidden" name="action" value="">
  137. <input type="hidden" name="clear" value="">
  138. <input type="hidden" name="count" value="">
  139. <input type="hidden" name="id" value="">
  140. <input type="hidden" name="dlog_fieldOrder" value="<bean:write name="dlog_fieldOrder"/>">
  141. <input type="hidden" name="dlog_orderType" value="<bean:write name="dlog_orderType"/>">
  142. <input type="hidden" name="labelFilter" value="<logic:notEmpty name="dlogMd_label_filter"><bean:write name="dlogMd_label_filter" /></logic:notEmpty>">
  143. <input type="hidden" name="focus_field" value=""/>
  144. <!--td width="80%" valign="top"-->
  145. <table width="100%" border="0" align="center" cellpadding="2" cellspacing="4">
  146. <tr>
  147. <td class="titleHeader"><bean:message key="project.dlog.key"/> - LIST</td>
  148. </tr>
  149. <tr><td><html:errors /></td></tr>
  150. <tr>
  151. <td><%@ include file="../common/paging.jsp"%></td>
  152. </tr>
  153. </table>
  154. <table width="100%" border="0" cellspacing="1" cellpadding="1">
  155. <tr>
  156. <td colspan="7">
  157. <div id="message"></div>
  158. </td>
  159. </tr>
  160. <tr>
  161. <td width="5%" class="titleField"><div align="center">#</div></td>
  162. <td align="left" height="10" valign="top" class="titleField"><bean:message key="dlog.type.key" />
  163. <logic:equal name="dlog_fieldOrder" value="typeDmd.type">
  164. <logic:equal name="dlog_orderType" value="ASC">
  165. <a href="#" onclick="doOrder('typeDmd.type', 'DESC');"><img src="./images/arrow_down.gif" border="0" alt=""></a>
  166. </logic:equal>
  167. <logic:equal name="dlog_orderType" value="DESC">
  168. <a href="#" onclick="doOrder('typeDmd.type', 'ASC');"><img src="./images/arrow_up.gif" border="0" alt=""></a>
  169. </logic:equal>
  170. </logic:equal>
  171. <logic:notEqual name="dlog_fieldOrder" value="typeDmd.type">
  172. <a href="#" onclick="doOrder('typeDmd.type', 'ASC');"><img src="./images/arrow.gif" border="0" alt=""></a>
  173. </logic:notEqual>
  174. </td>
  175. <td align="left" height="10" valign="top" class="titleField"><bean:message key="dlog.timestamp.key" />
  176. <logic:equal name="dlog_fieldOrder" value="timestamp">
  177. <logic:equal name="dlog_orderType" value="ASC">
  178. <a href="#" onclick="doOrder('timestamp', 'DESC');"><img src="./images/arrow_down.gif" border="0" alt=""></a>
  179. </logic:equal>
  180. <logic:equal name="dlog_orderType" value="DESC">
  181. <a href="#" onclick="doOrder('timestamp', 'ASC');"><img src="./images/arrow_up.gif" border="0" alt=""></a>
  182. </logic:equal>
  183. </logic:equal>
  184. <logic:notEqual name="dlog_fieldOrder" value="timestamp">
  185. <a href="#" onclick="doOrder('timestamp', 'ASC');"><img src="./images/arrow.gif" border="0" alt=""></a>
  186. </logic:notEqual>
  187. </td>
  188. <td align="left" height="10" valign="top" class="titleField"><bean:message key="dlog.source.key" />
  189. <logic:equal name="dlog_fieldOrder" value="source">
  190. <logic:equal name="dlog_orderType" value="ASC">
  191. <a href="#" onclick="doOrder('source', 'DESC');"><img src="./images/arrow_down.gif" border="0" alt=""></a>
  192. </logic:equal>
  193. <logic:equal name="dlog_orderType" value="DESC">
  194. <a href="#" onclick="doOrder('source', 'ASC');"><img src="./images/arrow_up.gif" border="0" alt=""></a>
  195. </logic:equal>
  196. </logic:equal>
  197. <logic:notEqual name="dlog_fieldOrder" value="source">
  198. <a href="#" onclick="doOrder('source', 'ASC');"><img src="./images/arrow.gif" border="0" alt=""></a>
  199. </logic:notEqual>
  200. </td>
  201. <td align="left" height="10" valign="top" class="titleField"><bean:message key="dlog.code.key" />
  202. <logic:equal name="dlog_fieldOrder" value="code">
  203. <logic:equal name="dlog_orderType" value="ASC">
  204. <a href="#" onclick="doOrder('code', 'DESC');"><img src="./images/arrow_down.gif" border="0" alt=""></a>
  205. </logic:equal>
  206. <logic:equal name="dlog_orderType" value="DESC">
  207. <a href="#" onclick="doOrder('code', 'ASC');"><img src="./images/arrow_up.gif" border="0" alt=""></a>
  208. </logic:equal>
  209. </logic:equal>
  210. <logic:notEqual name="dlog_fieldOrder" value="code">
  211. <a href="#" onclick="doOrder('code', 'ASC');"><img src="./images/arrow.gif" border="0" alt=""></a>
  212. </logic:notEqual>
  213. </td>
  214. <td width="5%" class="titleField">&nbsp;</td>
  215. </tr>
  216. <logic:notEmpty name="dlogList">
  217. <logic:iterate id="element" name="dlogList" scope="request" indexId="index">
  218. <%
  219. sequence++;
  220. String bgcolor = "FFFFFF";
  221. if(sequence%2 == 0){
  222. bgcolor = "EDEDE8";
  223. }
  224. %>
  225. <tr bgcolor="<% out.print(bgcolor); %>" onmouseover="mOvr(this);" onmouseout="mOut(this, '<% out.print(bgcolor); %>');">
  226. <td align="center" class="celBorder"><%=++seq%>&nbsp;</td>
  227. <td align="left" class="celBorder">
  228. <bean:write name="element" property="typeDmd.type"/>
  229. </td>
  230. <td align="left" class="celBorder">
  231. <logic:notEmpty name="element" property="timestamp">
  232. <bean:write name="element" property="timestamp.time" format="yyyy-MM-dd HH:mm:ss.SSS"/>
  233. </logic:notEmpty>&nbsp;
  234. </td>
  235. <td align="left" class="celBorder">
  236. <bean:write name="element" property="source"/>
  237. </td>
  238. <td align="left" class="celBorder">
  239. <bean:write name="element" property="code"/>
  240. </td>
  241. <td align="center" class="celBorder" id="tdId"><a href="#"><img src="./images/detail.gif" border="0" onclick="doDetail('<bean:write name="element" property="id"/>');" alt="see detail"></a></td>
  242. </tr>
  243. </logic:iterate>
  244. </logic:notEmpty>
  245. </table>
  246. <table width="100%" border="0" align="center" cellpadding="2" cellspacing="4">
  247. <tr>
  248. <td><%@ include file="../common/paging.jsp"%></td>
  249. </tr>
  250. </table>
  251. <table width="100%" border="0" align="center" cellpadding="2" cellspacing="4">
  252. <br>
  253. <tr>
  254. <td class="search"><bean:message key="project.search.key" /></td>
  255. </tr>
  256. </table>
  257. <table width="100%" border="0" cellspacing="1" cellpadding="2">
  258. <tr>
  259. <td width="25%"><b><bean:message key="dlog.type.key"/></b></td>
  260. <td width="1%">:</td>
  261. <td width="79%">
  262. <select name="dlog_type_filter" style="width:300" onchange="doLoadC1();">
  263. <option value="">-- Select Type --</option>
  264. <logic:notEmpty name="dlogMdList">
  265. <logic:iterate id="element_dlogMd" name="dlogMdList" >
  266. <option value="<bean:write name="element_dlogMd"/>"
  267. <logic:notEmpty name="dlog_type_filter">
  268. <logic:equal name="dlog_type_filter" value="${element_dlogMd}">
  269. selected
  270. </logic:equal>
  271. </logic:notEmpty>
  272. ><bean:write name="element_dlogMd"/></option>
  273. </logic:iterate>
  274. </logic:notEmpty>
  275. </select>
  276. </td>
  277. </tr>
  278. <tr>
  279. <td width="20%"><b><bean:message key="dlog.timestamp.key"/></b></td>
  280. <td width="1%">:</td>
  281. <td width="79%">
  282. <input type="text" name="dlog_timestamp_start_filter" value="<logic:notEmpty name="dlog_timestamp_start_filter"><bean:write name="dlog_timestamp_start_filter" format="dd/MM/yyyy" /></logic:notEmpty>" size="12" maxlength="10">
  283. <a href="javascript:cal_timestamp_start_filter.popup();"><img alt="cal" src="./images/cal.gif" width="16" height="16" border="0"></a>
  284. <script type="text/javascript" language="javascript">
  285. var cal_timestamp_start_filter = new calendar1(document.forms['dlog'].elements['dlog_timestamp_start_filter']);
  286. </script>
  287. <select name="dlog_timestamp_hour_start_filter" style="width:70">
  288. <logic:notEmpty name="hourList">
  289. <logic:iterate id="element_hour" name="hourList" indexId="hourIndex">
  290. <option value="${hourIndex}"
  291. <logic:equal name="dlog_timestamp_hour_start_filter" value="${hourIndex}">
  292. selected
  293. </logic:equal>
  294. ><bean:write name="element_hour" /></option>
  295. </logic:iterate>
  296. </logic:notEmpty>
  297. </select>
  298. <select name="dlog_timestamp_minute_start_filter" style="width:70">
  299. <logic:notEmpty name="minuteList">
  300. <logic:iterate id="element_minute" name="minuteList" indexId="minuteIndex">
  301. <option value="${minuteIndex}"
  302. <logic:equal name="dlog_timestamp_minute_start_filter" value="${minuteIndex}">
  303. selected
  304. </logic:equal>
  305. ><bean:write name="element_minute"/></option>
  306. </logic:iterate>
  307. </logic:notEmpty>
  308. </select>
  309. &nbsp;To&nbsp;
  310. <input type="text" name="dlog_timestamp_end_filter" value="<logic:notEmpty name="dlog_timestamp_end_filter"><bean:write name="dlog_timestamp_end_filter" format="dd/MM/yyyy" /></logic:notEmpty>" size="12" maxlength="10">
  311. <a href="javascript:cal_dlog_timestamp_end_filter.popup();"><img alt="cal" src="./images/cal.gif" width="16" height="16" border="0"></a>
  312. <script type="text/javascript" language="javascript">
  313. var cal_dlog_timestamp_end_filter = new calendar1(document.forms['dlog'].elements['dlog_timestamp_end_filter']);
  314. </script>
  315. <select name="dlog_timestamp_hour_end_filter" style="width:70">
  316. <logic:notEmpty name="hourList">
  317. <logic:iterate id="element_hour" name="hourList" indexId="hourIndex">
  318. <option value="${hourIndex}"
  319. <logic:equal name="dlog_timestamp_hour_end_filter" value="${hourIndex}">
  320. selected
  321. </logic:equal>
  322. ><bean:write name="element_hour" /></option>
  323. </logic:iterate>
  324. </logic:notEmpty>
  325. </select>
  326. <select name="dlog_timestamp_minute_end_filter" style="width:70">
  327. <logic:notEmpty name="minuteList">
  328. <logic:iterate id="element_minute" name="minuteList" indexId="minuteIndex">
  329. <option value="${minuteIndex}"
  330. <logic:equal name="dlog_timestamp_minute_end_filter" value="${minuteIndex}">
  331. selected
  332. </logic:equal>
  333. ><bean:write name="element_minute" /></option>
  334. </logic:iterate>
  335. </logic:notEmpty>
  336. </select>
  337. </td>
  338. </tr>
  339. <tr>
  340. <td width="20%"><b><bean:message key="dlog.source.key"/></b></td>
  341. <td width="1%">:</td>
  342. <td width="79%">
  343. <label>
  344. <input type="text" name="dlog_source_filter" value="<logic:notEmpty name="dlog_source_filter"><bean:write name="dlog_source_filter"/></logic:notEmpty>">
  345. </label>
  346. </td>
  347. </tr>
  348. <tr>
  349. <td width="20%"><b><bean:message key="dlog.code.key"/></b></td>
  350. <td width="1%">:</td>
  351. <td width="79%">
  352. <label>
  353. <input type="text" name="dlog_code_filter" value="<logic:notEmpty name="dlog_code_filter"><bean:write name="dlog_code_filter"/></logic:notEmpty>">
  354. </label>
  355. </td>
  356. </tr>
  357. <tr>
  358. <td width="20%">
  359. <select name="dlogMd_label_filter" style="width:200" >
  360. <option value="">-- Select DlogMd Label --</option>
  361. <logic:notEmpty name="labelList">
  362. <logic:iterate id="element_dlogMdC" name="labelList" >
  363. <option value="<bean:write name="element_dlogMdC" property="id" />"
  364. <logic:notEmpty name="dlogMd_label_filter">
  365. <logic:equal name="dlogMd_label_filter" value="${element_dlogMdC.id}">
  366. selected
  367. </logic:equal>
  368. </logic:notEmpty>
  369. ><bean:write name="element_dlogMdC" property="name" />
  370. </option>
  371. </logic:iterate>
  372. </logic:notEmpty>
  373. </select>
  374. <select name="dlogMd_sma" style="width:42">
  375. <option value="="
  376. <logic:notEmpty name="dlogMd_sma">
  377. <logic:equal name="dlogMd_sma" value="=">
  378. selected
  379. </logic:equal>
  380. </logic:notEmpty>
  381. >=
  382. </option>
  383. <option value="!="
  384. <logic:notEmpty name="dlogMd_sma">
  385. <logic:equal name="dlogMd_sma" value="!=">
  386. selected
  387. </logic:equal>
  388. </logic:notEmpty>
  389. >!=
  390. </option>
  391. <option value="=="
  392. <logic:notEmpty name="dlogMd_sma">
  393. <logic:equal name="dlogMd_sma" value="==">
  394. selected
  395. </logic:equal>
  396. </logic:notEmpty>
  397. >==
  398. </option>
  399. </select>
  400. </td>
  401. <td width="1%">:</td>
  402. <td width="79%">
  403. <label>
  404. <input type="text" name="dlog_value_filter" value="<logic:notEmpty name="dlog_value_filter"><bean:write name="dlog_value_filter"/></logic:notEmpty>">
  405. </label>
  406. </td>
  407. <td></tr>
  408. <br>
  409. <tr>
  410. <td>&nbsp;</td>
  411. <td>&nbsp;</td>
  412. <td colspan="3" align="left">
  413. <input type="button" size="50" maxlength="25" value="<bean:message key="button.reset"/>" onclick="doReset();">
  414. &nbsp;&nbsp;
  415. <input type="button" value="<bean:message key="button.search"/>" onclick="doFilter();" >
  416. </td>
  417. <td>&nbsp;</td>
  418. <td>&nbsp;</td>
  419. <td>&nbsp;</td>
  420. </tr>
  421. </table>
  422. </form>
  423. <logic:notEmpty name="dlog_type_filter">
  424. <script type="text/javascript" language="javascript">loadPageInit();</script>
  425. </logic:notEmpty>
  426. <!-- END CONTENT -->
  427. <%@ include file="../common/footer.jsp"%>