| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475 |
- <%@ include file="../common/header.jsp"%>
- <%
- if (seq==0){
- seq = request.getAttribute("dlog_start") == null ? 0 : (Integer) request.getAttribute("dlog_start");
- }
- %>
- <script type="text/javascript" language="javascript"><!--
-
- function loadPageInit() {
- doLoadC1();
- }
-
- function doLoadC1() {
- var form = document.forms.dlog;
- try {
- var dlogMdCRemovalObj = form.dlogMd_label_filter;
- var type = form.dlog_type_filter.value;
- var idParam = form.dlogMd_label_filter.value;
- var idLabel = form.labelFilter.value;
- if (type.length > 0) {
- var req = createXMLHttpRequest();
- var url = "dlog.do?action=getCList&type=" +type;
- var loop = 0;
- req.open("GET", url);
- req.onreadystatechange = function() {
- if (req.readyState == 4) {
- dlogMdCRemovalObj.length = 0;
- dlogMdCRemovalObj.options[0] = new Option("-- Select DlogMd Label --", "");
- document.getElementById("message").innerHTML="";
- var response = req.responseText;
- if (response) {
- var rst = eval("(" + req.responseText + ")");
- for(var i=0;i<rst.length;i++){
- var dlogMdCId = rst[i].id;
- var dlogMdCIdName = rst[i].name;
- dlogMdCRemovalObj.options[i+1] = new Option(dlogMdCIdName, dlogMdCId);
- if(idParam == dlogMdCId) {
- dlogMdCRemovalObj.options[loop+1].selected = true;
- }else if(idLabel == dlogMdCId) {
- dlogMdCRemovalObj.options[loop+1].selected = true;
- }
- loop++;
- }
- } else {
- dlogMdCRemovalObj.length = 0;
- dlogMdCRemovalObj.options[0] = new Option("-- Select DlogMd Label --", "");
- }
- } else {
- dlogMdCRemovalObj.length = 0;
- dlogMdCRemovalObj.options[0] = new Option("-- Select DlogMd Label --", "");
- document.getElementById("message").innerHTML="<img src='./images/wait.gif' border=0 > <b>Please Wait...<\/b>";
- }
- }
- req.send(null);
- } else {
- dlogMdCRemovalObj.length = 0;
- dlogMdCRemovalObj.options[0] = new Option("-- Select DlogMd Label --", "");
- }
- } catch(e) {
- alert(e);
- }
- }
- /* ==== TIME FILTER: hanya 1 tanggal yang boleh dipilih (max 1 hari), tapi start time
- dan end time (jam:menit) dalam tanggal itu tetap bisa diatur user.
- End date selalu disamakan dengan start date (tidak ada input end date terpisah). ==== */
- function syncTimestampFilter(){
- var form = document.forms.dlog;
- form.dlog_timestamp_end_filter.value = form.dlog_timestamp_start_filter.value;
- }
- /* ==== CR#2: tandai bahwa user benar-benar melakukan aksi (search/page/order/reset),
- supaya initial load tidak query ke tabel DLOG ==== */
- function markSearch(){
- document.forms.dlog.doSearch.value = "true";
- }
-
- function page(start, count){
- syncTimestampFilter();
- markSearch();
- document.forms.dlog.start.value=start;
- document.forms.dlog.count.value=count;
- document.forms.dlog.action.value="list";
- document.forms.dlog.submit();
- doDisable(document.forms.dlog, "button");
- }
- function doChangePage(count){
- syncTimestampFilter();
- markSearch();
- document.forms.dlog.start.value= (document.forms.dlog.startx.value-1)*20;
- if(document.forms.dlog.start.value=="NaN") document.forms.dlog.start.value = 0;
- document.forms.dlog.count.value=count;
- document.forms.dlog.action.value="list";
- document.forms.dlog.submit();
- doDisable(document.forms.dlog, "button");
- }
- function fillIndex(val){
- document.forms.dlog.startx.value = val.value;
- }
- function handleEvent(oEvent) {
- var arrKeys = [];
- if (oEvent.shiftKey) {
- arrKeys.push("Shift");
- }
- }
- function doDetail(id){
- //alert("My world is full :-)".wordWrap(10, "\n+", true));
- //document.forms.dlogDetail.target="_blank";
- document.forms.dlog.id.value=id;
- document.forms.dlog.action.value="detail";
- //handleEvent(event);
- document.forms.dlog.submit();
- }
- function doFilter(){
- syncTimestampFilter();
- markSearch();
- document.forms.dlog.start.value=0;
- document.forms.dlog.action.value="list";
- document.forms.dlog.submit();
- doDisable(document.forms.dlog, "button");
- }
- function doReset(){
- document.forms.dlog.dlog_type_filter.value="";
- document.forms.dlog.dlog_source_filter.value="";
- document.forms.dlog.dlog_source_sma.value="equal";
- document.forms.dlog.dlog_code_filter.value="";
- document.forms.dlog.dlog_code_sma.value="equal";
- document.forms.dlog.dlog_value_filter.value="";
- document.forms.dlog.dlogMd_label_filter.value="";
- document.forms.dlog.dlogMd_sma.value="equal";
- document.forms.dlog.dlog_timestamp_start_filter.value="";
- document.forms.dlog.dlog_timestamp_hour_start_filter.value="0";
- document.forms.dlog.dlog_timestamp_minute_start_filter.value="0";
- document.forms.dlog.dlog_timestamp_end_filter.value="";
- document.forms.dlog.dlog_timestamp_hour_end_filter.value="23";
- document.forms.dlog.dlog_timestamp_minute_end_filter.value="59";
-
- document.forms.dlog.clear.value="true";
- document.forms.dlog.action.value="list";
- /* CR#2: reset tetap dianggap aksi user -> boleh query (biar user lihat data ter-reset).
- Kalau reset juga TIDAK boleh query, hapus baris markSearch() di bawah ini. */
- markSearch();
- document.forms.dlog.submit();
- doDisable(document.forms.dlog, "button");
- }
-
- function doOrder(field, type){
- syncTimestampFilter();
- markSearch();
- document.forms.dlog.dlog_fieldOrder.value=field;
- document.forms.dlog.dlog_orderType.value=type;
- document.forms.dlog.action.value="list";
- document.forms.dlog.submit();
- doDisable(document.forms.status, "button");
- }
- String.prototype.wordWrap = function(m, b, c){
- var i, j, s, r = this.split("\n");
- if(m > 0) for(i in r){
- for(s = r[i], r[i] = ""; s.length > m;
- 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 : ""));
- r[i] += s;
- }
- return r.join("\n");
- }
-
- --></script>
- <!-- CONTENT -->
- <form name="dlog" method="post" action="dlog.do" target="_self">
- <input type="hidden" name="start" value="">
- <input type="hidden" name="startx" value="">
- <input type="hidden" name="action" value="">
- <input type="hidden" name="clear" value="">
- <input type="hidden" name="count" value="">
- <input type="hidden" name="id" value="">
- <input type="hidden" name="doSearch" value="">
- <input type="hidden" name="dlog_fieldOrder" value="<bean:write name="dlog_fieldOrder"/>">
- <input type="hidden" name="dlog_orderType" value="<bean:write name="dlog_orderType"/>">
- <input type="hidden" name="labelFilter" value="<logic:notEmpty name="dlogMd_label_filter"><bean:write name="dlogMd_label_filter" /></logic:notEmpty>">
- <input type="hidden" name="focus_field" value=""/>
- <!--td width="80%" valign="top"-->
- <table width="100%" border="0" align="center" cellpadding="2" cellspacing="4">
- <tr>
- <td class="titleHeader"><bean:message key="project.dlog.key"/> - LIST</td>
- </tr>
- <tr><td><html:errors /></td></tr>
- <logic:notEmpty name="paging">
- <tr>
- <td><%@ include file="../common/paging.jsp"%></td>
- </tr>
- </logic:notEmpty>
- </table>
- <logic:notEmpty name="dlogList">
- <table width="100%" border="0" cellspacing="1" cellpadding="1">
- <tr>
- <td colspan="7">
- <div id="message"></div>
- </td>
- </tr>
- <tr>
- <td width="5%" class="titleField"><div align="center">#</div></td>
- <td align="left" height="10" valign="top" class="titleField"><bean:message key="dlog.type.key" />
- <logic:equal name="dlog_fieldOrder" value="typeDmd.type">
- <logic:equal name="dlog_orderType" value="ASC">
- <a href="#" onclick="doOrder('typeDmd.type', 'DESC');"><img src="./images/arrow_down.gif" border="0" alt=""></a>
- </logic:equal>
- <logic:equal name="dlog_orderType" value="DESC">
- <a href="#" onclick="doOrder('typeDmd.type', 'ASC');"><img src="./images/arrow_up.gif" border="0" alt=""></a>
- </logic:equal>
- </logic:equal>
- <logic:notEqual name="dlog_fieldOrder" value="typeDmd.type">
- <a href="#" onclick="doOrder('typeDmd.type', 'ASC');"><img src="./images/arrow.gif" border="0" alt=""></a>
- </logic:notEqual>
- </td>
- <td align="left" height="10" valign="top" class="titleField"><bean:message key="dlog.timestamp.key" />
- <logic:equal name="dlog_fieldOrder" value="timestamp">
- <logic:equal name="dlog_orderType" value="ASC">
- <a href="#" onclick="doOrder('timestamp', 'DESC');"><img src="./images/arrow_down.gif" border="0" alt=""></a>
- </logic:equal>
- <logic:equal name="dlog_orderType" value="DESC">
- <a href="#" onclick="doOrder('timestamp', 'ASC');"><img src="./images/arrow_up.gif" border="0" alt=""></a>
- </logic:equal>
- </logic:equal>
- <logic:notEqual name="dlog_fieldOrder" value="timestamp">
- <a href="#" onclick="doOrder('timestamp', 'ASC');"><img src="./images/arrow.gif" border="0" alt=""></a>
- </logic:notEqual>
- </td>
- <td align="left" height="10" valign="top" class="titleField"><bean:message key="dlog.source.key" />
- <logic:equal name="dlog_fieldOrder" value="source">
- <logic:equal name="dlog_orderType" value="ASC">
- <a href="#" onclick="doOrder('source', 'DESC');"><img src="./images/arrow_down.gif" border="0" alt=""></a>
- </logic:equal>
- <logic:equal name="dlog_orderType" value="DESC">
- <a href="#" onclick="doOrder('source', 'ASC');"><img src="./images/arrow_up.gif" border="0" alt=""></a>
- </logic:equal>
- </logic:equal>
- <logic:notEqual name="dlog_fieldOrder" value="source">
- <a href="#" onclick="doOrder('source', 'ASC');"><img src="./images/arrow.gif" border="0" alt=""></a>
- </logic:notEqual>
- </td>
- <td align="left" height="10" valign="top" class="titleField"><bean:message key="dlog.code.key" />
- <logic:equal name="dlog_fieldOrder" value="code">
- <logic:equal name="dlog_orderType" value="ASC">
- <a href="#" onclick="doOrder('code', 'DESC');"><img src="./images/arrow_down.gif" border="0" alt=""></a>
- </logic:equal>
- <logic:equal name="dlog_orderType" value="DESC">
- <a href="#" onclick="doOrder('code', 'ASC');"><img src="./images/arrow_up.gif" border="0" alt=""></a>
- </logic:equal>
- </logic:equal>
- <logic:notEqual name="dlog_fieldOrder" value="code">
- <a href="#" onclick="doOrder('code', 'ASC');"><img src="./images/arrow.gif" border="0" alt=""></a>
- </logic:notEqual>
- </td>
- <td width="5%" class="titleField"> </td>
- </tr>
- <logic:iterate id="element" name="dlogList" scope="request" indexId="index">
- <%
- sequence++;
- String bgcolor = "FFFFFF";
- if(sequence%2 == 0){
- bgcolor = "EDEDE8";
- }
- %>
- <tr bgcolor="<% out.print(bgcolor); %>" onmouseover="mOvr(this);" onmouseout="mOut(this, '<% out.print(bgcolor); %>');">
- <td align="center" class="celBorder"><%=++seq%> </td>
- <td align="left" class="celBorder">
- <bean:write name="element" property="typeDmd.type"/>
- </td>
- <td align="left" class="celBorder">
- <logic:notEmpty name="element" property="timestamp">
- <bean:write name="element" property="timestamp.time" format="yyyy-MM-dd HH:mm:ss.SSS"/>
- </logic:notEmpty>
- </td>
- <td align="left" class="celBorder">
- <bean:write name="element" property="source"/>
- </td>
- <td align="left" class="celBorder">
- <bean:write name="element" property="code"/>
- </td>
- <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>
- </tr>
- </logic:iterate>
- </table>
- <table width="100%" border="0" align="center" cellpadding="2" cellspacing="4">
- <tr>
- <td><%@ include file="../common/paging.jsp"%></td>
- </tr>
- </table>
- </logic:notEmpty>
- <logic:empty name="dlogList">
- <table width="100%" border="0" align="center" cellpadding="2" cellspacing="4">
- <tr>
- <td>
- <%-- CR#2: bedakan pesan "belum search" vs "sudah search tapi hasilnya kosong",
- supaya pencarian valid dengan 0 hasil tidak terlihat seperti belum di-search --%>
- <logic:equal name="searched" value="true">
- Tidak ada log yang ditemukan untuk filter yang dipilih.
- </logic:equal>
- <logic:notEqual name="searched" value="true">
- Silakan tentukan tanggal dan filter yang diinginkan, lalu klik <b>Search</b>.
- </logic:notEqual>
- </td>
- </tr>
- </table>
- </logic:empty>
- <table width="100%" border="0" align="center" cellpadding="2" cellspacing="4">
- <br>
- <tr>
- <td class="search"><bean:message key="project.search.key" /></td>
- </tr>
- </table>
- <table width="100%" border="0" cellspacing="1" cellpadding="2">
- <tr>
- <td width="25%"><b><bean:message key="dlog.type.key"/></b></td>
- <td width="1%">:</td>
- <td width="79%">
- <select name="dlog_type_filter" style="width:300" onchange="doLoadC1();">
- <option value="">-- Select Type --</option>
- <logic:notEmpty name="dlogMdList">
- <logic:iterate id="element_dlogMd" name="dlogMdList" >
- <option value="<bean:write name="element_dlogMd"/>"
- <logic:notEmpty name="dlog_type_filter">
- <logic:equal name="dlog_type_filter" value="${element_dlogMd}">
- selected
- </logic:equal>
- </logic:notEmpty>
- ><bean:write name="element_dlogMd"/></option>
- </logic:iterate>
- </logic:notEmpty>
- </select>
- </td>
- </tr>
- <tr>
- <td width="20%"><b><bean:message key="dlog.timestamp.key"/></b> <span style="font-weight:normal;">(1 hari)</span></td>
- <td width="1%">:</td>
- <td width="79%">
- <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" readonly="readonly">
- <a href="javascript:cal_timestamp_start_filter.popup();"><img alt="cal" src="./images/cal.gif" width="16" height="16" border="0"></a>
- <script type="text/javascript" language="javascript">
- var cal_timestamp_start_filter = new calendar1(document.forms['dlog'].elements['dlog_timestamp_start_filter']);
- </script>
- <!-- End date selalu ikut start date (tanggal sama, tidak ada picker terpisah) -->
- <input type="hidden" name="dlog_timestamp_end_filter" value="<logic:notEmpty name="dlog_timestamp_start_filter"><bean:write name="dlog_timestamp_start_filter" format="dd/MM/yyyy" /></logic:notEmpty>">
- <b>Start:</b>
- <select name="dlog_timestamp_hour_start_filter" style="width:55">
- <logic:iterate id="hourStartItem" name="hourList">
- <option value="<bean:write name="hourStartItem"/>"<logic:equal name="dlog_timestamp_hour_start_filter" value="${hourStartItem}"> selected</logic:equal>><bean:write name="hourStartItem"/></option>
- </logic:iterate>
- </select> :
- <select name="dlog_timestamp_minute_start_filter" style="width:55">
- <logic:iterate id="minuteStartItem" name="minuteList">
- <option value="<bean:write name="minuteStartItem"/>"<logic:equal name="dlog_timestamp_minute_start_filter" value="${minuteStartItem}"> selected</logic:equal>><bean:write name="minuteStartItem"/></option>
- </logic:iterate>
- </select>
- <b>End:</b>
- <select name="dlog_timestamp_hour_end_filter" style="width:55">
- <logic:iterate id="hourEndItem" name="hourList">
- <option value="<bean:write name="hourEndItem"/>"<logic:equal name="dlog_timestamp_hour_end_filter" value="${hourEndItem}"> selected</logic:equal>><bean:write name="hourEndItem"/></option>
- </logic:iterate>
- </select> :
- <select name="dlog_timestamp_minute_end_filter" style="width:55">
- <logic:iterate id="minuteEndItem" name="minuteList">
- <option value="<bean:write name="minuteEndItem"/>"<logic:equal name="dlog_timestamp_minute_end_filter" value="${minuteEndItem}"> selected</logic:equal>><bean:write name="minuteEndItem"/></option>
- </logic:iterate>
- </select>
- </td>
- </tr>
- <tr>
- <td width="20%"><b><bean:message key="dlog.source.key"/></b></td>
- <td width="1%">:</td>
- <td width="79%">
- <select name="dlog_source_sma" style="width:100">
- <option value="equal"<logic:equal name="dlog_source_sma" value="equal"> selected</logic:equal>>Equal</option>
- <option value="not_equal"<logic:equal name="dlog_source_sma" value="not_equal"> selected</logic:equal>>Not Equal</option>
- <option value="like"<logic:equal name="dlog_source_sma" value="like"> selected</logic:equal>>Like</option>
- <option value="not_like"<logic:equal name="dlog_source_sma" value="not_like"> selected</logic:equal>>Not Like</option>
- </select>
- <label>
- <input type="text" name="dlog_source_filter" value="<logic:notEmpty name="dlog_source_filter"><bean:write name="dlog_source_filter"/></logic:notEmpty>">
- </label>
- </td>
- </tr>
- <tr>
- <td width="20%"><b><bean:message key="dlog.code.key"/></b></td>
- <td width="1%">:</td>
- <td width="79%">
- <select name="dlog_code_sma" style="width:100">
- <option value="equal"<logic:equal name="dlog_code_sma" value="equal"> selected</logic:equal>>Equal</option>
- <option value="not_equal"<logic:equal name="dlog_code_sma" value="not_equal"> selected</logic:equal>>Not Equal</option>
- <option value="like"<logic:equal name="dlog_code_sma" value="like"> selected</logic:equal>>Like</option>
- <option value="not_like"<logic:equal name="dlog_code_sma" value="not_like"> selected</logic:equal>>Not Like</option>
- </select>
- <label>
- <input type="text" name="dlog_code_filter" value="<logic:notEmpty name="dlog_code_filter"><bean:write name="dlog_code_filter"/></logic:notEmpty>">
- </label>
- </td>
- </tr>
- <tr>
- <td width="20%">
- <select name="dlogMd_label_filter" style="width:200" >
- <option value="">-- Select DlogMd Label --</option>
- <logic:notEmpty name="labelList">
- <logic:iterate id="element_dlogMdC" name="labelList" >
- <option value="<bean:write name="element_dlogMdC" property="id" />"
- <logic:notEmpty name="dlogMd_label_filter">
- <logic:equal name="dlogMd_label_filter" value="${element_dlogMdC.id}">
- selected
- </logic:equal>
- </logic:notEmpty>
- ><bean:write name="element_dlogMdC" property="name" />
- </option>
- </logic:iterate>
- </logic:notEmpty>
- </select>
-
- <select name="dlogMd_sma" style="width:100">
- <option value="equal"<logic:equal name="dlogMd_sma" value="equal"> selected</logic:equal>>Equal</option>
- <option value="not_equal"<logic:equal name="dlogMd_sma" value="not_equal"> selected</logic:equal>>Not Equal</option>
- <option value="like"<logic:equal name="dlogMd_sma" value="like"> selected</logic:equal>>Like</option>
- <option value="not_like"<logic:equal name="dlogMd_sma" value="not_like"> selected</logic:equal>>Not Like</option>
- </select>
-
- </td>
- <td width="1%">:</td>
- <td width="79%">
- <label>
-
-
-
- <input type="text" name="dlog_value_filter" value="<logic:notEmpty name="dlog_value_filter"><bean:write name="dlog_value_filter"/></logic:notEmpty>">
- </label>
- </td>
- <td></tr>
- <br>
- <tr>
- <td> </td>
- <td> </td>
- <td colspan="3" align="left">
- <input type="button" size="50" maxlength="25" value="<bean:message key="button.reset"/>" onclick="doReset();">
-
- <input type="button" value="<bean:message key="button.search"/>" onclick="doFilter();" >
- </td>
- <td> </td>
- <td> </td>
- <td> </td>
- </tr>
- </table>
- </form>
- <logic:notEmpty name="dlog_type_filter">
- <script type="text/javascript" language="javascript">loadPageInit();</script>
- </logic:notEmpty>
- <!-- END CONTENT -->
- <%@ include file="../common/footer.jsp"%>
|