<%@page contentType="text/html; charset=UTF-8"%>
<%@page import="com.csc.library.entry.HelpEntry,com.csc.library.system.*,com.csc.library.utilities.*"%>
<%@ page import="com.csc.library.entry.*,com.csc.library.database.*,com.csc.library.session.*"  %>
<%@ page import="java.util.*"%>
<jsp:useBean id="TAU185" class="com.csc.library.system.Task" scope="page" />

<%
	TAU185.setChannel(request,response);
	HelpEntry screen = (HelpEntry) TAU185.process("HelpEntry","TAU185HELP");
	screen.process();
	screen.referLangOn();
	screen.nextRec();
	java.text.DecimalFormat df=new java.text.DecimalFormat("#0.00");
	CheckNull chkNull = new CheckNull();
	ThaiUtilities th = new ThaiUtilities();
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="../CSS/TISCO.css" rel="stylesheet" type="text/css">
<script type='text/javascript' src='../JS/SCREEN.js'></script>
<script language='javascript'>setLang('<%=screen.getUProfile().get("lang")%>');</script>
<script type='text/javascript' src='../JS/DATEINPUT.js'></script>
<script type='text/javascript' src='../JS/VIEWCALENDAR.js'></script>
<script language="javascript">getTitleName();</script>

<script language="JavaScript" type="text/JavaScript">
function chkDateTime1(valueSearch){
	var tmpval="";
	with(document.cscform){
		var valueSearch1=valueSearch.split("-");
		if(valueSearch1.length==3){
			if(valueSearch1[1].length==1){
				valueSearch1[1]="0"+valueSearch1[1];
			}
			if(valueSearch1[0].length==1){
				valueSearch1[0]="0"+valueSearch1[0];
			}
			valueSearch1[2]=parseInt(valueSearch1[2]);
        	return valueSearch=valueSearch1[2]+"-"+valueSearch1[1]+"-"+valueSearch1[0];
		 }
	}
}

function bdOnload() {
	with(document.cscform){
		if (__employeeid.value=="") {
			alert("Please Input EmployeeID !!!");
			__employeeid.focus();
		} else	if (dstart.value=="") {
			alert("Please Input Start Date !!!");
			dstart.focus();
		} else if (dend.value=="") {
			alert("Please Input End Date !!!");
			dend.focus();
		} else {
			var a=chkDateTime1(dstart.value);		
			var b=chkDateTime1(dend.value);
			__fixCon.value="employeeid='"+__employeeid.value+"' and (start_date between '"+a+"' and '"+b+"')";
			__cmd.value="search";
			submit();
		}
	}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function goHelp(helpName,inputName) {
	var helpReturn;
	if (inputName=="__employeeid" ) {
	 	helpReturn="__employeeid:employeeid,FULLNAME:FULLNAME";
	} 
	linkHelp_Return(helpName,helpReturn);
}


function helpPageCon(help,input,fcon){
	with(document.cscform){
		var param="PRU084.jsp?__fixCon="+fcon+"&__helpName="+help+"&__helpReturn="+input+"&__pageCall="+__screen.value+"&securityoff=true";
		window.open(param,"Help","left=150,top=150,width=600,height=400,toolbar=no,status=yes,scrollbars=yes,resizable=yes");
	}
}


</script>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<% CscCalendar cs = new CscCalendar();%>
<form name="cscform" method="post" action="TAU185.jsp">
 

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

<%=screen.InitialVariable()%>

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

<input type="hidden" name="__screen" value="TAU185">   
  <input type="hidden" name="__calendar">
  <script language="javascript">getInputFormatDate();</script>
  <input type="hidden" name="__help" value="">
  <input type="hidden" name="__helpReturn" value="">
  <input type="hidden" name="__helpName" value=""> 
  <input type="hidden" name="__fixCon" value="">  
  <input type="hidden" name="__childFilter">  
  <input type="hidden" name="__cmd" >
  <input type="hidden" name="__gorec">
  <input type="hidden" name="__companyid" value="<%=screen.getUProfile().get("companyid")%>">
  <input type="hidden" name="__language" value="<%=screen.getUProfile().get("lang")%>">  
     <div align="center">
    <br>
    <table cellpadding="0" cellspacing="0">
      <tr >
        <td width="640"  class="header">TAU185, <script language="javascript">swapLang('OT After Process Detail');</script>&nbsp;</td>
    </tr>
      <tr>
        <td colspan="2"> <div align="center">
            <center>
              <table cellpadding="0" cellspacing="0">
                <tr>
                  <td class="blankspace" colspan="2"></td>
                </tr>
                <tr>
                  <td class="columnlabel"><%=screen.getLabel("employeeid")%>&nbsp;</td>
                  <td width="482"><input type="text" name="__employeeid" size="15" value="<%=request.getParameter("__employeeid")%>" >&nbsp;
				<a href="javascript:goHelp('MEMPLOYEEHELP','__employeeid')" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image2','','../IMAGES/BUTTON/SWAP/SEARCH_SWAP20.gif',1)"><img src="../IMAGES/BUTTON/MAIN/SEARCH20.gif" alt="Help" name="Image2" width="20" height="20" border="0" align="absmiddle"></a>&nbsp;
				<input type="text" name="FULLNAME" size="40" value="<%=th.ASCII2Unicode(chkNull.chkNullString(request.getParameter("FULLNAME")))%>" readonly>
				</td>
                </tr>
                <tr>
                  <td class="columnlabel"><script language="javascript">swapLang('Time Period');</script>&nbsp;</td>
                  <td>
				  <% if (request.getParameter("dstart")==null) { %>
				  <input name="dstart" type="text" value="" size="10" onKeyup = "formatDate(this)" onBlur = "chkInputDate2(this,dend)" onKeypress = "chkIntegerOfDate(this.value)">&nbsp;
				  <% } else {%>
				   <input name="dstart" type="text" value="<%=request.getParameter("dstart")%>" size="10" onKeyup = "formatDate(this)" onBlur = "chkInputDate2(this,dend)" onKeypress = "chkIntegerOfDate(this.value)">&nbsp;
				  <% }%>
				  <a href="#" onMouseOut="MM_swapImgRestore()"
					onMouseOver="MM_swapImage('calendar1','','../IMAGES/BUTTON/SWAP/CALENDAR_SWAP20.gif',1)">
                    <img src="../IMAGES/BUTTON/MAIN/CALENDAR20.gif" name="calendar1"
					width="20" height="20" border="0" align="absmiddle"
					onClick="viewCal('dstart')" alt="Calendar"></a>&nbsp; - &nbsp;
					<% if (request.getParameter("dend")==null) { %>
				  <input name="dend" type="text" value="" size="10" onKeyup = "formatDate(this)" onBlur = "chkInputDate2(dstart,this)" onKeypress = "chkIntegerOfDate(this.value)">&nbsp;
				   <% } else {%>
				   <input name="dend" type="text" value="<%=request.getParameter("dend")%>" size="10" onKeyup = "formatDate(this)" onBlur = "chkInputDate2(dstart,this)" onKeypress = "chkIntegerOfDate(this.value)">&nbsp;
				  <% }%>
					<a href="#" onMouseOut="MM_swapImgRestore()"
					onMouseOver="MM_swapImage('calendar2','','../IMAGES/BUTTON/SWAP/CALENDAR_SWAP20.gif',1)">
                    <img src="../IMAGES/BUTTON/MAIN/CALENDAR20.gif" name="calendar2"
					width="20" height="20" border="0" align="absmiddle"
					onClick="viewCal('dend')" alt="Calendar"></a> <a
					href="javascript:bdOnload();"> <img src="../IMAGES/BUTTON/SUBMIT.gif"
					 border="0" align="absbottom"></a></td>
                </tr>
                <%
						String cmd = request.getParameter("__cmd");
						String goPage = request.getParameter("__goPage");
						if((cmd != null && cmd.equals("search")) || (goPage != null && !goPage.equals(""))){
				%>
				<tr> 
					<td colspan="4"><div align="right">&lt; <%=screen.getPageTag()%> &gt;</div></td>
				</tr>
				<tr>
				  <td class="blankspace" colspan="4"></td>
				</tr>  	
				<tr>
				  <td class="blankspace" colspan="4">
						<% String html = screen.printTableHTML();
						  html = html.replaceAll("&lt;", "<");
						  html = html.replaceAll("&gt;", ">");
						  html = html.replaceAll("&quot;", "\"");
						  html = html.replaceAll("&#039;", "'");
						  out.println(html);
						 %>			
				</td>
				</tr>		
				<% } %>
                <tr>
                  <td class="blankspace" colspan="2"></td>
                </tr>
              </table>
              <br>
            </center>
          </div></td>
      </tr>
      <tr>
        <td class="bottom"></td>
      </tr>
    </table></center>
    </div>
</div>
</form>
<!--Start ERROR AND WARNING -->
<!--END ERROR AND WARNING -->
</body>
</html>