<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" language="java" %>
<%@ page import="com.csc.library.database.*,com.csc.library.session.*,com.csc.library.utilities.*,com.csc.library.utility.*"  %>
<%@ include file="../CHECKPROFILE.jsp" %>
<% request.setCharacterEncoding("UTF-8"); %>
<%
	CheckNull chk = new CheckNull();

	UProfile up = null;
	if (session != null){
		up = (UProfile)session.getAttribute("userprofile");
	}

	if (up == null){
		return ;
	}
	String sequence = StaticConfig.getConfigCompany(up, "SEQUENCE_UPPER");
	int year = Integer.parseInt(StaticConfig.getConfigCompany(up, "YEAR_UPPER"));
	String p_apsid = chk.chkNullString(request.getParameter("apsid_aps"),"APS_EMP");
	String p_apsassessy = chk.chkNullString(request.getParameter("assessy"),up.get("employeeid"));
	String p_type = chk.chkNullString(request.getParameter("type"),"self");

%>
<html ng-app='APS_JET_PER_EMP'>
	<head>
		<title>Employee View</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<link rel="stylesheet" href="<%=request.getContextPath()%>/EMPVIEW/css/APP_UP/style_apsup.css" />
		<link rel="stylesheet" type="text/css" href="css/APP_MBO/style.css" />
	</head>
	<body ng-controller='ApsEmpForm'>
		<div class='bg-com'></div>
		<div class="emv-headmenu" style="display:none"><jsp:include page="EMV_HEADMENU.jsp" flush="true" /></div>

		<script type="text/javascript" src="../JS/SCREEN.js"></script>
		<script type="text/javascript" src="../JS/jquery-2.1.3.min.js"></script>
		<script type='text/javascript' src="../public/lib/angular-resource/angular-resource.min.js"></script>
		<script type='text/javascript' src='JS/APS_JET_PER_EMP/Module.Controller.js'></script>
		<script type='text/javascript' src='JS/APS_JET_PER_EMP/services.js'></script>
		<script type='text/javascript' src='JS/APS_JET_PER_EMP/ApsEmp.Controller.js'></script>
		<script type='text/javascript'>
			setLang('<%=up.get("lang")%>');
		</script>

		<section>
			<div class="container csc-content">
				<form name="cscform" class="form-horizontal" method="post" >
					<div>
						<input type='hidden' name='apsid' value='<%=p_apsid%>'/>
						<input type='hidden' name='assessy' value='<%=p_apsassessy%>'/>
						<input type='hidden' name='type' value='<%=p_type%>'/>
						<input type='hidden' name='me' value='<%=up.get("username")%>' />
						<div class='loading-page'>
							<div class='spiner'></div>
						</div>
						<div class="form-horizontal" id='target_warpper'>
							<table class="table table-head table-bordered table-title-left" >
								<tr>
									<th colspan='4' class='center detail-table'>{{ formdesc }} <%=year%></th>
								</tr>
								<tr>
									<th width='50%' colspan='2' class='center detail-table' swlang code='SW001041'>Assessor</th>
									<th width='50%' colspan='2' class='center detail-table' swlang code='SW001042'>Assessy</th>
								</tr>
								<tr>
									<th class='headlabel td-bold' swlang code='SW001984'>Fullname</th>
									<td>{{ assessordata.fullname }}</td>
									<th class='headlabel td-bold' swlang code='SW001984'>Fullname</th>
									<td>{{ assessydata.fullname }}</td>
								</tr>
								<tr>
									<th class='headlabel td-bold' swlang code='SW000274'>Employee ID</th>
									<td>{{ assessordata.assessy }}</td>
									<th class='headlabel td-bold' swlang code='SW000274'>Employee ID</th>
									<td>{{ assessydata.assessy }}</td>
								</tr>
								<tr>
									<th class='headlabel td-bold' swlang code='SW000057'>Position</th>
									<td>{{ assessordata.position }}</td>
									<th class='headlabel td-bold' swlang code='SW000057'>Position</th>
									<td>{{ assessydata.position }}</td>
								</tr>
								<tr>
									<th class='headlabel td-bold' swlang code='SW012799'>Start Date</th>
									<td>{{ assessordata.startdate }}</td>
									<th class='headlabel td-bold' swlang code='SW012799'>Start Date</th>
									<td>{{ assessydata.startdate }}</td>
								</tr>
								<tr>
									<th class='headlabel td-bold' colspan="4">OVERALL PERFORMANCE RATING SCORE</th>
								</tr>
								<!-- <tr>
									<th class='headlabel td-bold'>Add Individual Compentency Ratings</th>
									<th class='headlabel td-bold'>Number of Compentencies</th>
									<th class='headlabel td-bold' colspan="2">Overall Performance Rating</th>
								</tr>
								<tr>
									<td class='headlabel td-bold center'>{{ score }}</td>
									<td class='headlabel td-bold center'>{{ max }}</td>
									<td class='headlabel td-bold center' colspan="2">{{ result }} %</td>
								</tr> -->
							</table>
						</div>

						<ul id="tabs" class="nav nav-tabs nav-justified" data-tabs="tabs" >
							<li class="active"><a href="#tab1" data-toggle="tab" class="black"><b>Section 1: Performance Review</b></a></li>
							<li><a href="#tab2" data-toggle="tab" class="black"><b>Section 2: Summary comments and feedback</b></a></li>
						</ul>

						<div class="tab-content clearfix">
							<!-- ############################### TAB1 ############################### -->
							<div class="tab-pane active" id="tab1">
								<div class="form-horizontal">
									<table class="table table-head table-bordered table-title-left" >
										<tr>
											<th class='headlabel td-bold' colspan="4">Discuss and assess performance against factors as they apply to the employee in their position</th>
										</tr>
										<tr>
											<th class='headlabel td-bold' colspan="4">Performance ratings</th>
										</tr>
										<tr ng-repeat='masanswer in masanswer_tab1 | orderBy:"-anwscore" '>
											<td class='headlabel td-bold' colspan="1">{{masanswer.anwscoredesc}} - {{masanswer.topic}}</td>
											<td class='headlabel td-bold' colspan="3">{{masanswer.tdesc}}</td>
										</tr>
									</table>
								</div>

								<div class="form-horizontal">
									<table class="table table-head table-bordered table-title-left" >
										<tr>
											<th class='td-bold' colspan="15">Please comment on the employee's performance against each of the areas with examples</th>
											<th class='td-bold' colspan="{{ masanswer_tab1.length }}">Performance<br>Rating 1-5<br>(Choose as appropriate)</th>
										</tr>
										<tbody ng-repeat='tastran_tab1 in tastran_tab1'>
											<tr>
												<td colspan="15"><b>{{ tastran_tab1.massess_assuggest }}: </b>{{ tastran_tab1.massess_desc}}</td>
												<td colspan="1" class='headlabel td-bold center' ng-repeat='masanswer in masanswer_tab1'>{{masanswer.anwscoredesc}}</td>
											</tr>
											<tr ng-show="(apsstate>=0)">
												<td colspan="15"><b><!-- Score : {{ result1 }} %     -->Comments & feedback: </b><textarea class='' rows="5" style="width:100%" ng-model='tastran_tab1.apscomment1' ng-trim='true' ng-disabled='!(isApsassessy && apsstate==0)'></textarea></td><td colspan="1" class='headlabel td-bold center' ng-repeat='masanswer in masanswer_tab1'><input type="radio" ng-model='tastran_tab1.asranswer1' ng-click="calSumScore('result1','asranswer1')" value="{{masanswer.anwscore}}" ng-disabled='!(isApsassessy && apsstate==0)'></td>
											</tr>
											<tr ng-show="(apsstate>=1)">
												<td colspan="15"><b><!-- Score : {{ result2 }} %     -->Comments & feedback: </b><textarea class='' rows="5" style="width:100%" ng-model='tastran_tab1.apscomment2' ng-trim='true' ng-disabled='!(isApsapprove1 && apsstate==1)'></textarea></td><td colspan="1" class='headlabel td-bold center' ng-repeat='masanswer in masanswer_tab1'><input type="radio" ng-model='tastran_tab1.asranswer2' ng-click="calSumScore('result2','asranswer2')" value="{{masanswer.anwscore}}" ng-disabled='!(isApsapprove1 && apsstate==1)'></td>
											</tr>
											<tr ng-show="(apsstate>=2)">
												<td colspan="15"><b><!-- Score : {{ result3 }} %     -->Comments & feedback: </b><textarea class='' rows="5" style="width:100%" ng-model='tastran_tab1.apscomment3' ng-trim='true' ng-disabled='!(isApsapprove2 && apsstate==2)'></textarea></td><td colspan="1" class='headlabel td-bold center' ng-repeat='masanswer in masanswer_tab1'><input type="radio" ng-model='tastran_tab1.asranswer3' ng-click="calSumScore('result3','asranswer3')" value="{{masanswer.anwscore}}" ng-disabled='!(isApsapprove2 && apsstate==2)'></td>
											</tr>
										</tbody>
									</table>
								</div>
							</div>
							
							<!-- ############################### TAB2 ############################### -->
							<div class="tab-pane" id="tab2">
								<div class="form-horizontal">
									<table class="table table-head table-bordered table-title-left" >
										<tr>
											<th class='headlabel td-bold left'>To be complete at the performance review(s)</th>
										</tr>
										<tr>
											<td class='headlabel td-bold'>
												Employee:<br>
												<textarea class='' rows="5" style="width:100%" ng-model='tapstran.apsappcomment1' ng-trim='true' ng-disabled='!(isApsassessy && apsstate==0)'></textarea><br>
												Date: 
											</td>
										</tr>
										<tr>
											<td class='headlabel td-bold'>
												Team Leader<br>
												<textarea class='' rows="5" style="width:100%" ng-model='tapstran.apsappcomment2' ng-trim='true' ng-disabled='!(isApsapprove1 && apsstate==1)'></textarea><br>
												Date: 
											</td>
										</tr>
										<tr>
											<td class='headlabel td-bold'>
												Manager:<br>
												<textarea class='' rows="5" style="width:100%" ng-model='tapstran.apsappcomment3' ng-trim='true' ng-disabled='!(isApsapprove2 && apsstate==2)'></textarea><br>
												Date: 
											</td>
										</tr>
									</table>
								</div>
							</div>
						</div>
						<div class="center">
							<button type="button" ng-disabled='!(isApsassessy && apsstate==0) && !(isApsapprove1 && apsstate==1) && !(isApsapprove2 && apsstate==2)' class="btn btn-info" ng-click='saveDraft()' >Save Draft</button>
							<button type="button" ng-disabled='!(isApsassessy && apsstate==0) && !(isApsapprove1 && apsstate==1) && !(isApsapprove2 && apsstate==2)' class="btn btn-info" ng-click='save()' >Submit</button>
							<button type="button" ng-if='!(isApsassessy)' class="btn btn-info" ng-click='closePage()' >Close</button>
						</div>
						<div class='spece-bot'></div>
				</form>
				<a href="#top" id="top-button"><i class="fa fa-angle-up"></i><div class="top-word">Back to top</div></a>
			</div>
		</section>
		<div><jsp:include page="FOOTER.jsp" flush="true" /></div>
	</body>
</html>