WELR08.jsp 4.42 KB
Newer Older
Thitichaipun Wutthisak committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@page contentType="text/html; charset=UTF-8"%>
<%@ page import="com.csc.library.entry.*" %>
<%@ page import="com.csc.library.utilities.*,com.csc.library.report.*" %>
<jsp:useBean id="ASR002" scope="page" class="com.csc.library.system.Task"/>
<% 
   ASR002.setChannel(request ,response);
   ReportEntry screen=null;
   screen=(ReportEntry)ASR002.process("ReportEntry",request.getParameter("__screen"));
   UProfile uf=screen.getUProfile();
	ReportUDF rf=new ReportUDF();
%>
<html>
<head>
<title>ReportOption</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="../CSS/TISCO.css" rel="stylesheet" type="text/css">
<script language='javascript' src='../JS/SCREEN.js'></script>
<script src="../JS/VIEWCALENDAR.js"></script>
<script language='javascript'>setLang('<%=screen.getUProfile().get("lang")%>');</script>

<script language="JavaScript" type="text/JavaScript">
<!--
function back(){
	var z=0;
	if(setFilter()){
	with(document.cscform){
	 for(z=0;z<elements.length;z++){
	 	setParent(elements[z].name,elements[z].value);
	 }
	}	
	window.close();
	}
}

function setParent(inputName,inputValue){
	with(window.opener.document.cscform){
	 for(var  z=0;z<elements.length;z++){
	 	if(elements[z].name==inputName){
	 		//alert(inputName+" "+inputValue);
 			elements[z].value=inputValue;
 		}	
	 }
	}
}

function setFilter(){
	with(document.cscform){
	      var filter ="status='1' and approvestatus='1'";
		  if(__udf1.checked||__udf2.checked||__udf3.checked){
		  			filter+=" and reqtype in (";
		  			if(__udf1.checked)
					        filter+="'"+__udf1.value+"',";
		  			if(__udf2.checked)
					        filter+="'"+__udf2.value+"',";
		  			if(__udf3.checked)
					        filter+="'"+__udf3.value+"',";
					filter=filter.substring(0,filter.length-1)+")";					
				}else{
				   filter+=" and reqtype in('0','2')";
				}				
				if(__budyear.value.length>0){
						filter+=" and budyear='"+__budyear.value+"'"
				}
		}//with
		 window.opener.document.cscform.__fixfilterMCOMPLAIN.value=filter;
	return true;
}

//-->
</script>

</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<form name="cscform" method="post" >


<!----------BEGIN CSC INITIAL ZONE ------------------------>

<%=screen.InitialVariable()%>

<!----------END CSC INITIAL ZONE -------------------------->

<input type="hidden" name="__cmd" value="">
 <input type="hidden" name="__language" value ="<%=screen.getUProfile().get("lang").toUpperCase()%>"> 
  <input type="hidden" name="__calendar">
  <input type="hidden" name="__dateformat" value="YYYY-MM-DD">
  <input type="hidden" name="__fixCon" value="">
 
  <div align="center">
    <table  cellpadding="0"  cellspacing="0">
      <tr > 
        <td  class="header"> ASR002, 
		<script language="javascript">swapLang('Report Option');</script>&nbsp;</td>
      </tr>
      <tr > 
        <td  colspan="2"> 
          <div align="center"> 
            <table  cellpadding="0" cellspacing="0" >
              <tr> 
                <td colspan="2"  class="blankspace"></td>
              </tr>
			  <%
						String keyvalue[];			  
				  		String tstatus[]=rf.getSystemCode("TYPEOFREQ",screen.getUProfile().get("lang"));
						for(int n=0;n<tstatus.length;n++){
							keyvalue=tstatus[n].split(",");
							%>
							  <tr >
									<td width="159" class="blankspace">&nbsp;</td>
									<td width="409" class="blankspace"><input type="checkbox" name="__udf<%=n+1%>" value="<%=keyvalue[0]%>" size="15"><%=keyvalue[1]%></td>
							  </tr>
							<%							
							}
			  %>
              <tr > 
                <td  align="right"><script language="javascript">swapLang('ปี');</script></td>
                <td  class="blankspace"><input type="text" name="__budyear" value="<%=new CscCalendar().getThaiYYYY()%>" size="7" maxlength="4"></td>
              </tr>
              <TR> 
                <TD colspan="2"><div align="center"><img src="../IMAGES/BUTTON/OK.gif" onClick="back()"> 
                    &nbsp;&nbsp; <img src="../IMAGES/BUTTON/CANCEL.gif" onClick="window.close()"></div></TD>
              </TR>
              <tr > 
                <td colspan="2" class="blankspace"></td>
              </tr>
            </table>
          </div></td>
      </tr>
      <tr bordercolor="0069B3"> 
        <td  class="bottom"></td>
      </tr>
    </table>
  </div>
<INPUT TYPE="hidden" NAME="__screen" VALUE="<%=request.getParameter("__screen")%>">
</form>
</body>
</html>