<%@page contentType="text/html; charset=UTF-8"%>
<%@page import="com.csc.library.entry.HelpEntry,com.csc.library.system.*,com.csc.library.utilities.*,com.csc.library.session.*,com.csc.library.report.*"%>
<%@page import="com.csc.library.export.*"%>
<jsp:useBean id="XLSOPTION" class="com.csc.library.system.Task" scope="page" />
<%
XLSOPTION.setChannel(request, response);
XLSOPTION.checkProfile();
UProfile up=XLSOPTION.getUProfile();
String xlsname=request.getParameter("__xlsname");
JxlOption jop=new JxlOption(xlsname,up);

if(!jop.getJspOption().equals("")){
	response.sendRedirect(jop.getJspOption()+"?__xlsname="+xlsname);
}
%>
<html>
	<head>
		<title></title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
		<link rel="stylesheet" type="text/css" href="./CSS/EMV_LAYOUT.css" />
		<link rel="stylesheet" type="text/css" href="./CSS/EMV_TEXT.css" />

		<link href="./CSS/bootstrap.css" rel="stylesheet"  type="text/css">
		<link href="./CSS/bootstrap_csc_backend.css" rel="stylesheet"  type="text/css">
		<script type="text/javascript" src="./JS/jquery-2.1.3.min.js"></script>
		<script type='text/javascript' src="./JS/bootstrap.js"></script>

		<script language="JavaScript" src="./JS/VIEWCALENDAR.js"></script>
		<script language="JavaScript" src="./JS/SCREEN.js"></script>
		<script language="JavaScript" src="./JS/ICONSMENU.js"></script>
		<script language="JavaScript" src="./JS/HOTKEY.js"></script>

		<script type="text/javascript" src="./JS/jquery-1.3.2.min.js"></script>
		<script type="text/javascript" src="./JS/jquery/js/jquery-ui.js"></script>
		<script type="text/javascript" src="./JS/jquery.blockUI.js"></script>
		<link href="./JS/jquery/css/redmond/jquery-ui-1.7.1.custom.css" rel="stylesheet" type="text/css"/>

		<script language='javascript'>setLang('<%=XLSOPTION.getUProfile().get("lang")%>');</script>
		<script language="JavaScript" type="text/JavaScript">
		function goUpload(page){
			with(document.cscform){
				open(page,"header","height=600,width=800");
			}
		}

		function goPreview(){
			with(document.cscform){
				bCon=confirm("Do you want to print data?");
				if (bCon==true)	{
					action = "/hr/servlet/exportexcel/";
					var temp =  target;
					target = "_blank";
					method="post";
					submit();
					target=temp;
				}
			}
		}

		function goExport(){
			with(document.cscform){
				bCon=confirm("Do you want to export data?");
				if (bCon==true)	{
					__cmd.value="save";
					action = "/hr/EXPEXCEL.jsp";
					var temp =  target;
					target = "_blank";
					method="post";
					submit();
					target=temp;
				}
			}
		}

		function goHelp(helpName,helpReturn){
			linkHelp_Return(helpName,helpReturn);
		}

		function showDate(mypicker){
			$(function() {
				$("#"+mypicker.id).datepicker({dateFormat: "dd-mm-yy",showAnim: "fadeIn",showOn: "focus",direction: 'up',showOtherMonths: true,selectOtherMonths: true,changeMonth: true,changeYear: true });
			});
		}

		</script>
	</head>
	<body>
		<div class="centered">
			<div id="toolTipLayer" style="position:absolute; visibility: hidden"></div>
			<script language="javascript">initToolTips();</script>
			<form name="cscform" method="post" action="XLSOPTION.jsp">
				<input type="hidden" name="__cmd" value=""/>
				<input type="hidden" name="__help" value=""/>
				<input type="hidden" name="__goPage" value=""/>
				<input type="hidden" name="__notNull" value=""/>
				<input type="hidden" name="__helpReturn" value=""/>
				<input type="hidden" name="__helpName" value=""/>
				<input type="hidden" name="__pageCall" value=""/>
				<input type="hidden" name="__referPage" value=""/>
				<input type="hidden" name="__language" value="<%=XLSOPTION.getUProfile().get("lang")%>"/>
				<input type="hidden" name="__calendar"/>
				<input type="hidden" name="__screen" value="XLSOPTION"/>
				<script language="javascript">getInputFormatDate();</script>
				<input type="hidden" name="__fixCon" value=""/>
				<input type="hidden" name="__orderBy" value="<%=request.getParameter("__orderBy")%>"/>
				<input type="hidden" name="__companyid"  value="<%=XLSOPTION.getUProfile().get("companyid")%>"/>
				<input type="hidden" name="__xlsname" value="<%=xlsname%>"/>
				<input type="hidden" name="__tname" value="นำข้อมูลออกเป็นรูปแบบ excel"/>
				<input type="hidden" name="__ename" value="Export Excel"/>
				<input type="hidden" name="__ptype" value=""/>
				<input type="hidden" name="__prclass" value="ExcelExportFile"/>

				<br/>
				<jsp:include page="XLS_CHOOCE_COLUMN.jsp" flush="true"/>

				<div class="box-search-condition">
					<div class="content-title"><%=XLSOPTION.getUProfile().get("lang").equals("tha")?"กำหนดเงื่อนไข":"Condition Asset"%></div>
					<table width="100%" border="0" cellpadding="0" cellspacing="0" class="table-search-condition">
						<tr>
							<td colspan="5" class="column-label">&nbsp;</td>
						</tr>
						<%=jop.getOption()%>
						<tr>
							<td colspan="5"  class="column-label"><div align="center">
								<!-- <a href="javascript:goPreview()"><img src="IMAGES/MYNOTE/BUTTON/BUTTON_PRINT.gif" border="0"></a>
								<a href="javascript:goExport();"><img src="IMAGES/MYNOTE/BUTTON/BUTTON_EXPORT.gif" width="89" height="37" border="0"></a> -->
								<button type="button" class="btn btn-primary width100" onClick="goPreview();"><%=XLSOPTION.getUProfile().get("lang").equals("tha")?"พิมพ์":"Print"%></button>&nbsp;
								<button type="button" class="btn btn-primary width100" onClick="goExport();"><%=XLSOPTION.getUProfile().get("lang").equals("tha")?"ส่งออก":"Export"%></button>
							</div></td>
						</tr>
						<tr>
							<td colspan="5" class="column-label">&nbsp;</td>
						</tr>
					</table>
				</div>
				<!--  End -->

				<br/>
				<br/>
			</form>
		</div>
	</body>
</html>