<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ page import="com.csc.library.menu.Menu" %>
<%@ page import="com.csc.library.menu.GlobalMenu" %>
<%@ page import="com.csc.library.utilities.CscCalendar" %>
<%@ page import="com.csc.library.utilities.UProfile" %>
<%@ page import="org.apache.commons.lang.StringUtils" %>
<%@ include file="CHECKPROFILE.jsp" %>
<%//=screen.getRecord().getViewUrl("picture") %>
<%

	Menu menu = new GlobalMenu(uprofile);
	//menu.setUseCache(false);
	String menuHtml = menu.getMenu();

	String csdate="";
	String cstime="";
	String swapsource = (String)uprofile.get("swapsource");
	String login_status = (String)uprofile.get("swipetime");
	CscCalendar cs = new CscCalendar();
	
	if( "ENG".equalsIgnoreCase((String)uprofile.get("lang"))) {
	    csdate = cs.getEngFull(); 
	}else{
	    csdate = cs.getThaiFull();
	}
	cstime = cs.getHHMM();
%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Main</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<!-- Begin CSS Links -->
<!--<link rel="stylesheet" type="text/css" href="CSS/DDMENU.css" />
<link rel="stylesheet" type="text/css" href="CSS/EMV_DEFAULT.css" />
<link rel="stylesheet" type="text/css" href="CSS/EMV_LAYOUT.css" />
<link rel="stylesheet" type="text/css" href="CSS/EMV_LAYOUT_ONE.css" />
<link rel="stylesheet" type="text/css" href="CSS/EMV_TEXT.css" />-->
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/CSS/metro.css"/>
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/CSS/metro-icons.css"/>
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/CSS/MENU_BACKEND.css"/>
<!-- End CSS Links -->
<!-- Begin Scripts -->
<script language="JavaScript"  type="text/javascript"src="JS/EVENTS.js"></script>
<script language="JavaScript" type="text/javascript" src="JS/AC_RunActiveContent.js"></script>
<script language="JavaScript"  type="text/javascript"src="JS/SCREEN.js"></script>
<script type="text/javascript" language="JavaScript" src="<%=request.getContextPath()%>/JS/std.menu.config.js"></script>
<script src="<%=request.getContextPath()%>/JS/jquery-2.1.3.min.js"></script>
<script language="javascript">
	var Gol_status=2;

	setLang("<%=uprofile.get("lang")%>");
	var str = "<%=login_status%>";
	var swap = "<%=swapsource%>";
	var chk_login = "<%//=chk_login%>";
    
	function openNewwin() {
		if (str==1 && chk_login==1) {
		      open("TALOGIN.jsp?__logStatus=in","Login","width=600,height=180,toolbar=no,status=yes,scrollbars=no,resizeable=no");
		}
	}

		function CheckSession(){
			/*$.ajax
			({
				type: "POST",
				url: "CHECKPROFILE.jsp",
				cache: false,
				success : function(result){
					if (result!=""){
						Gol_status=1;
						window.top.location.href ="LOGINERROR.jsp";
					}
					else
					{
						Gol_status=2;
					}
				},
				async: false
			});*/
		}


	function linkModule(jsppage){
		CheckSession();

		if (Gol_status!=1){

			with(document.cscform){
				action = "CHECKMODULE.jsp";
				modulename.value=jsppage.substring(0, jsppage.lastIndexOf("/"));
				modulepath.value=modulename.value;
				linkaction.value=jsppage;
				if (str==1 && swap==1 && jsppage=="LOGOUT.jsp") {
					open("TALOGIN.jsp?__logStatus=out","Logout","width=600,height=180,toolbar=no,status=yes,scrollbars=no");
				} else {
					submit();
				}
			}
		}
	 }

	function logout(){
		open("/hr/TALOGIN.jsp?__logStatus=out","Logout","width=600,height=180,toolbar=no,status=yes,scrollbars=no");
	}
	function logoutSystem(){
		window.location.href ="/hr/LOGOUT.jsp";
	}
	/*function setTime() {
		now = new Date();
		hour = now.getHours();
		min = now.getMinutes();
		sec = now.getSeconds();
		if (min <10) {
			min = "0" + min; 
		}
		if (sec <10) {
			sec = "0" + sec; 
		}
		if (hour < 10) {
			hour = "0" + hour; 
		}
		document.getElementById("showtime").innerHTML = hour + ":" + min;
		setTimeout("setTime()", 60000); 
	}*/
	/*function show() {
		now = new Date();
		hour = now.getHours();
		min = now.getMinutes();
		sec = now.getSeconds();
		if (min <10) {
			min = "0" + min; 
		}
		if (sec <10) {
			sec = "0" + sec; 
		}
		if (hour < 10) {
			hour = "0" + hour; 
		}
		document.getElementById("showtime").innerHTML = hour + ":" + min;
		setTimeout("setTime()", (60-sec)*1000); 
	}*/

	/*function RemoveHover(){
		var color_bg =$(".main-body").css("background-color"); 
		$(".bg-hover-myhr").css("background-color",color_bg);
		$(".set_control").removeClass("bg-hover-myhr");
	}

	$(document).ready(function(){

		$(".set_control").hover(function(){
			$(this).addClass("bg-hover-myhr");
			var color_bg=$(".main-body").css("background-color");
			$(".mif-switch").css("color","red");

		},function(){
			RemoveHover();
		});
	});*/
    </script>
</head>
<body class="main-body">
<form name="cscform" method="post">
  <input type="hidden" name="modulename" value="">
  <input type="hidden" name="modulepath" value="">
  <input type="hidden" name="linkaction" value="">
  <input type="hidden" name="__language" value="<%=uprofile.get("lang")%>">
	<div class="tile-area fg-white">
		<h1 class="tile-area-title">myHR</h1>
		<div class="tile-area-controls">
			<a class="image-button icon-right bg-transparents fg-white no-border">
				<span class="sub-header  text-light"><%=uprofile.get("fullname")%></span>
				<img class="pic-profile icon" src='<%=uprofile.get("picture_path")%>'/>
			</a>
			<a href="<%=request.getContextPath()%>/LOGOUT.jsp" class="set_control square-button bg-transparents fg-white no-border"><span class="mif-switch"></span></a>
		</div>
		<!--<div class="tile-group">
			<div class="tile-large bg-dark-orange fg-white" data-role="tile">
				<div class="tile-content iconic">
					<img src="<%=request.getContextPath()%>/IMAGES/ICON/Organ.png">
				</div>
				<span class="tile-label">Organization Information</span>
			</div>

			<div class="tile op-lightBlue fg-white" data-role="tile">
				<div class="tile-content iconic">
					<img src="<%=request.getContextPath()%>/IMAGES/ICON/Payroll.png">
				</div>
				<span class="tile-label">Payroll</span>
			</div>

			<div class="tile bg-orange fg-white" data-role="tile">
				<div class="tile-content iconic">
					<img src="<%=request.getContextPath()%>/IMAGES/ICON/Time.png">
				</div>
				<span class="tile-label">Time Attendance</span>
			</div>

			<div class="tile-wide bg-dark-green fg-white" data-role="tile">
				<div class="tile-content iconic">
					<img src="<%=request.getContextPath()%>/IMAGES/ICON/Employee_new.png">
				</div>
				<span class="tile-label-wide-normal">Employee View</span>
			</div>
			
			<div class="tile bg-light-green fg-white" data-role="tile">
				<div class="tile-content iconic">
					<img src="<%=request.getContextPath()%>/IMAGES/ICON/Train.png">
				</div>
				<span class="tile-label">Training</span>
			</div>

			<div class="tile-wide bg-crimson fg-white" data-role="tile">
				<div class="tile-content iconic">
					<img src="<%=request.getContextPath()%>/IMAGES/ICON/Personal_new.png">
				</div>
				<span class="tile-label">Personal Information</span>
			</div>

			 <div class="tile bg-purple fg-white" data-role="tile">
				<div class="tile-content iconic">
					<img src="<%=request.getContextPath()%>/IMAGES/ICON/Appraisal.png">
				</div>
				<span class="tile-label">Appraisal</span>
			</div>
			
			<div class="tile bg-dark-blue fg-white" data-role="tile">
				<div class="tile-content iconic">
					<img src="<%=request.getContextPath()%>/IMAGES/ICON/Welf.png">
				</div>
				<span class="tile-label">Welfare & Benefit</span>
			</div>

			<div class="tile-wide bg-pink-red fg-white" data-role="tile">
				<div class="tile-content iconic">
					<img src="<%=request.getContextPath()%>/IMAGES/ICON/Approve_new.png">
				</div>
				<span class="tile-label-wide-normal">Approve Document</span>
			</div>

			<div class="tile bg-blue fg-white" data-role="tile">
				<div class="tile-content iconic">
					<img src="<%=request.getContextPath()%>/IMAGES/ICON/recrui.png">
				</div>
				<span class="tile-label">Recruitment</span>
			</div>

			<div class="tile-wide bg-brown fg-white" data-role="tile">
				<div class="tile-content iconic">
					<img src="<%=request.getContextPath()%>/IMAGES/ICON/System.png">
				</div>
				<span class="tile-label-wide-normal">System Setting</span>
			</div>
		</div>-->
	<%=menuHtml %>
	</div>
</form>
</body>
</html>