<%@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.*"  %>
<jsp:useBean id="SME_EXPORTDATA" class="com.csc.library.system.Task" scope="page"/>
<%
	SME_EXPORTDATA.setChannel(request ,response);
   	ProcessEntry screen=(ProcessEntry)SME_EXPORTDATA.process("ProcessEntry","Process");
   	screen.process();
%>
<html>
<head>
<title></title>
<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" src='../JS/DATEINPUT.js'></script>
<script language="javascript" src='../JS/VIEWCALENDAR.js'></script>
<script language="javascript" src='./JS/PROCESS.js'></script>
<script language="javascript">setLang('<%=screen.getUProfile().get("lang")%>');</script>
<script language="JavaScript" type="text/JavaScript">
<!--
function process() {
	var export_dtm = document.getElementById("export_dtm") ;
	var export_amt=document.getElementById("export_amt");
	var export_sty =document.getElementById("export_sty");
	var ptype=document.getElementById("ptype");
	var prclass =document.getElementById("prclass");
	var startDate=document.getElementById("startDate");
	var endDate=document.getElementById("endDate");
	var stEmployeeid=document.getElementById("stEmployeeid");
	var endEmployeeid=document.getElementById("endEmployeeid");
 
	if(startDate.value==null||startDate.value==""){
		alert("กรุณาระบุข้อมูลวันที่เริ่มต้น");
		return;
	}//end if 

	if(endDate.value==null||endDate.value==""){
		alert("กรุณาระบุข้อมูลวันที่สิ้นสุด");
		return;
	}//end if 

	if(stEmployeeid.value==null||stEmployeeid.value==""){
		alert("กรุณาระบุข้อมูลรหัสพนักงานเริ่มต้น");
		return;
	}//end if 

	if(endEmployeeid.value==null||endEmployeeid.value==""){
		alert("กรุณาระบุข้อมูลรหัสพนักงานสิ้นสุด");
		return;
	}//end if 
 
	if(export_dtm.checked==true){
		ptype.value='Export_dtm';
		prclass.value='Export_dtm';
	}//end if 
	if(export_amt.checked==true){
		ptype.value='Export_amt';
		prclass.value='Export_amt';
	}//end if 
	if(export_sty.checked==true){
		ptype.value='Export_sty';
		prclass.value='Export_sty';
	}//end if 

	if(prclass.value==null||prclass.value==""){
		alert("กรุณาระบุประเภทข้อมูลที่ต้องการ Export");
		return;
	}
	with(document.cscform){
		__cmd .value = "save";							
		submit();
	}//end with
}//end function
//-->
</script>
</head>
<body  leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" >
<form name="cscform" method="post" action="">
<!----------BEGIN CSC INITIAL ZONE ----------------------->
<%=screen.InitialVariable()%>
<!----------END CSC INITIAL ZONE -------------------------->
<input type="hidden" name="__screen"  value="SME_EXPORTDATA">
	<input type="hidden" name="__fixCon"  value="">
	<input type="hidden" name="__cmd"  value="">
	<input type="hidden" name="__help"  value="">
	<input type="hidden" name="__user" value="<%=screen.getUProfile().getUserId()%>">
	<input type="hidden" name="__condition$companyid" value='<%=screen.getUProfile().get("companyid")%>'>
	<input type="hidden" id="ptype" name="__ptype" value="">
	<input type="hidden" id="prclass" name="__prclass" value="">
	<script language="javascript">getInputFormatDate();</script>
	<input type="hidden" name="__language" value ="<%=screen.getUProfile().get("lang")%>">		
	<div id="toolTipLayer" style="position:absolute; visibility: hidden"></div>
  	<script language="javascript">initToolTips();</script>
 	<br>
  	<div align="center">
    <table  cellpadding="0"  cellspacing="0">
    <tr >
    	<td  class="header" colspan="2">SME-EXPORT DATA</td>
   	</tr>
	<tr>
    	<td colspan="2" class="blankspace"  ></td>
    </tr>
	<tr>
		<td width="150" class="columnlabel"><div align="right"><script language="javascript">swapLang("Start Date");</script></div></td>
		<td width="420" valign="bottom"><div align="left">&nbsp;
			<input type="text" id="startDate" name="__condition$startDate"size="10" maxlength="8" onKeyup = "formatDate(this)" onBlur = "chkInputDate2(this,__condition$endDate)" onKeypress = "chkIntegerOfDate(this.value)" onMouseOver="toolTip('วันเริ่มต้น(DDMMYYYY)')" onMouseOut="toolTip()">&nbsp;
			<a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image1','','../IMAGES/BUTTON/SWAP/CALENDAR_SWAP20.gif',1)" onClick="viewCal('__condition$startDate')"><img src="../IMAGES/BUTTON/MAIN/CALENDAR20.gif" alt="Calendar" name="Image1" width="20" height="20" border="0" align="absmiddle"></a>
			&nbsp;&nbsp;-&nbsp;&nbsp;
		  	<script language="javascript">swapLang("End Date");</script>&nbsp;
		  	<input type="text" id="endDate" name="__condition$endDate" size="10" maxlength="8" onKeyup = "formatDate(this)" onBlur = "chkInputDate2(__condition$startDate,this)" onKeypress = "chkIntegerOfDate(this.value)" onMouseOver="toolTip('วันสิ้นสุด(DDMMYYYY)')" onMouseOut="toolTip()">&nbsp;
            <a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image2','','../IMAGES/BUTTON/SWAP/CALENDAR_SWAP20.gif',1)" onClick="viewCal('__condition$endDate')"><img src="../IMAGES/BUTTON/MAIN/CALENDAR20.gif" alt="Calendar" name="Image2" width="20" height="20" border="0" align="absmiddle"></a> </div>
		</td>
	</tr>
	<tr>
    	<td colspan="2" class="blankspace"  ></td>
    </tr>
	<tr>
		<td><div align="right"><script language="javascript">swapLang("Employee ID");</script></div></td>	
		<td><div align="left">&nbsp;
			<input type="text" id="stEmployeeid" name="__condition$stEmployeeid" size="15">
			<a href="javascript:goHelp('MEMPLOYEEHELP','__condition$stEmployeeid','')" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image3','','../IMAGES/BUTTON/SWAP/SEARCH_SWAP20.gif',1)"><img src="../IMAGES/BUTTON/MAIN/SEARCH20.gif" alt="Help" name="Image3" width="20" height="20" border="0" align="absmiddle"></a>
			&nbsp;&nbsp;-&nbsp;&nbsp;
			<input type="text" id="endEmployeeid" name="__condition$endEmployeeid" size="15">
			<a href="javascript:goHelp('MEMPLOYEEHELP','__condition$endEmployeeid','')" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image4','','../IMAGES/BUTTON/SWAP/SEARCH_SWAP20.gif',1)"><img src="../IMAGES/BUTTON/MAIN/SEARCH20.gif" alt="Help" name="Image4" width="20" height="20" border="0" align="absmiddle"></a>
		</div></td>	
	</tr>	
	<tr>
	   <td colspan="2" class="blankspace"></td>
	</tr>
	<tr>
		<td><div align="right"><script language="javascript">swapLang("File Path Directory");</script></div></td>
		<td>
		<div align="left">&nbsp;&nbsp;<input type="text" readonly name="__condition$filePath" size="50" value='C:\Export File\'></div>
		</td>
	</tr>
	<tr>
	   <td colspan="2" class="blankspace"></td>
	</tr>
	<tr>
		<td><div align="right"><INPUT type='radio' id='export_dtm' name="exportType"></div></td>
		<td><div align="left">Detail Time Monthly [DTM]</div></td> 
	</tr>
	<tr>
		<td><div align="right"><INPUT type='radio' id='export_amt' name="exportType"></div></td>
		<td><div align="left">Summary Time Monthly [AMT]</div></td> 
	</tr>
	<tr>
		<td><div align="right"><INPUT type='radio' id='export_sty' name="exportType"></div></td>
		<td><div align="left">Summary Time Yearly [STY]</div></td> 
	</tr>
	<tr>
	   <td colspan="2" class="blankspace"></td>
	</tr>
	<tr>
	   <td colspan="2">
			<div align="center">
				<a href="javascript:process();"><img src="../IMAGES/BUTTON/TRANSFERDATA.gif" border="0"></a>
			</div>
		</td>
    </tr>
	<tr>
		<td  class="bottom" colspan="2"></td>
    </tr>
	</table>
  </div>
</form>
</body>
</html>