<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" language="java" %>
<%@ 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="org.apache.commons.lang.StringUtils"  %>
<%@ include file="../CHECKPROFILE.jsp" %>
<% request.setCharacterEncoding("UTF-8"); %>
<jsp:useBean id="EMV" class="com.csc.library.system.Task" scope="page" />
<jsp:setProperty name="EMV" property="appname" value="empview" />
<%
	EMV.setChannel(request, response);	
	HelpEntry screen = (HelpEntry)EMV.process("HelpEntry", "OI_ORGCHARTHELP"); 
	if(screen==null){
		return;
	}
	screen.getInquiry().setFixFilter("profiletype='5' and status='1' and companyid='" +screen.getUProfile().get("companyid")+"'");
	screen.getInquiry().refresh();
	
%>
<html xmlns="http://www.w3.org/1999/xhtml" ng-app="myHR">
	<head>

		<title>Employee View</title>

		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

	</head>
	<body>
		<div class="bg-com"></div>
		<jsp:include page="EMV_HEADMENU.jsp" flush="true" />
		
		<script type="text/javascript">
			setLang("<%=screen.getUProfile().get("lang")%>");
			var swap = new swaplang();
            var titlename = swap.swap2String("SW011245");
			setPageTitle(titlename);

		</script>
		
		<section>
			<div class="container csc-content">
				<form name="cscform" class="form-horizontal" method="post" action="?">
					<%=screen.InitialVariable()%>
					<input type="hidden" name="__cmd" value="">
					<input type="hidden" name="__screen" value="OI_ORGCHART">
					<input type="hidden" name="__language" value ="<%=screen.getUProfile().get("lang")%>">
				
					<div class="csc-block">
						<div class="container csc-content">
					
							<div class="center">
								<h2 class="csc-block-head" swlang code='SW011245'>Organization Chart</h2>
							</div>
							
							<div class="form-horizontal">
								<%
									while(screen.nextRec()){
										screen.referLangOn();
										DbInquiry dbi = (DbInquiry) screen.getInquiry().getCurrentDbRecord().getChild("mcom_profile_file");
										
								%>
								<div class="row">
									<div class="form-group">
										<legend class="csc-block-head"><%=screen.getString("tdesc")%></legend>
										
										<% 
										   int number = 1;
										   do 
											{ 
										%>
										<div class="col-md-1 col-sm-1 col-xs-1"></div>
										<div class="col-md-5 col-sm-5 col-xs-5">
											<label class="control-label"><a href="<%=dbi.getCurrentDbRecord().getDownloadUrl("attac")%>" ><i class="fa fa-download "></i>&nbsp;&nbsp;<%=StringUtils.defaultIfEmpty(dbi.getString("tdesc"), "เน�เธ�เธฅเน�เน�เธ�เธ� #" +number++) %></a></label>
										</div>
										
										<% 
										} while(dbi.next()); 
										%>
									
									</div>
								</div>
								</br>
								<%}%>
							</div>
						</div>
						
					</div>
						
				</form>
			</div>
			<a href="#top" id="top-button">
				<i class="fa fa-angle-up"></i>
				<div class="top-word">Back to top</div>
			</a>
		</section>
		<jsp:include page="FOOTER.jsp" flush="true" />
	</body>
</html>