APP_EMV011_01.jsp 7.45 KB
Newer Older
Thitichaipun Wutthisak committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201
<!DOCTYPE html>
<%@page contentType="text/html; charset=UTF-8"%>
<%@page import="com.csc.library.entry.UIManager, com.csc.library.utilities.CheckNull"%>
<%@page import="com.csc.library.entry.EmvHelpEntry, com.csc.library.utilities.CscCalendar"%>
<%@page import="com.csc.library.session.DbInquiry, com.csc.library.session.InitialInquiry"%>
<%@page import="com.csc.library.database.DataSet, com.csc.library.components.ListBox, com.csc.library.report.ReportUDF"%>
<%@page import="com.csc.library.database.StaticProperties, com.csc.library.database.CscConnection"%>
<%@ include file="../CHECKPROFILE.jsp" %>
<jsp:useBean id="APP_EMV011_01" class="com.csc.library.system.Task" scope="page" />
<% 
	
	APP_EMV011_01.setChannel(request, response);
	EmvHelpEntry screen = (EmvHelpEntry) APP_EMV011_01.process("EmvHelpEntry","APP_EMV011_01");
	CheckNull chk = new CheckNull();
	int maxline = 15;
	String year = chk.chkNullString(request.getParameter("__year")); 
	String filter = "apsassessor = apsassessy and apsassessy = '"+screen.getUProfile().get("employeeid")+"' and astid = 'AP10' ";
	if(!year.equals("")){
			filter += " and apsid ='"+year+"' ";
	}
	//out.println("filter : " +filter);
	screen.setMaxLine(maxline);
	screen.getInquiry().setFilter(filter);
	int beginRow=((Integer.parseInt(screen.goPage)-1)*screen.maxLine)+1;
    int endRow=(Integer.parseInt(screen.goPage))*screen.maxLine;
    screen.getInquiry().setBetween(beginRow, endRow);
	screen.process();
	CscCalendar  c_year = new CscCalendar();


	//out.println(screen.getInquiry().getCurrentDbRecord().getChildTable());
	
%>

<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("SW012369");
			setPageTitle(titlename);

			/*function goViewAps(apsid,apsassessor,apsassessy,isread){
					with(document.cscform){	
					//alert(apsid + " " + apsassessor + " " + apsassessy + " " +isread);
					var param="APP_EMV707_HIS.jsp?apsid="+apsid+"&apsassessor="+apsassessor+"&apsassessy="+apsassessy+"&bpage="+__screen.value+"&ass_level=1&bu1=&bu2=&isread="+isread+"&__type=KPI";	
					window.open(param,"Assess_Pages","left=150,top=150,width=750,height=750,toolbar=no,status=yes,scrollbars=yes,resizable=yes");
				
				}
			}*/

			function calAge(strDate){
				var currentYear = parseInt(new Date().getYear());
				var birthdateYear = parseInt(strDate.substring(6,10));
				var age = currentYear-birthdateYear;
				document.write(age);
			}

			function GoSearch(){
						with(document.cscform){	
								submit();
						}
			}

		</script>
		
		<section>
			<div class="container csc-content">
				<form name="cscform" class="form-horizontal" method="post" action="APP_EMV011_01.jsp">
					<input type="hidden" name="__screen"  value="APP_EMV011_01">
					<input type="hidden" name="__help" value="">
					<input type="hidden" name="__cmd"  value="">
					<input type="hidden" name="__language" value ="<%=screen.getUProfile().get("lang")%>"> 
					<input type="hidden" name="__fixCon" value="">
					<input type="hidden" name="issearch" value="">
					<input type="hidden" name="isall" value="">
					<input type="hidden" name="__goPage" value="">
					<input type="hidden" name="__employeeid" value="<%=screen.getUProfile().get("employeeid")%>">
					<input type="hidden" name="__employeeid" value="<%=screen.getUProfile().get("companyid")%>">
				
					
					<div class="csc-block">
						<div class="center">
							<h2 class="csc-block-head" swlang code='SW012369'>History of Self Appraisal (KPI)</h2>
						</div>
						
						<div class="form-horizontal">
							<div class="row">
								<div class="form-group">
									<div class="col-md-4 col-sm-4 col-xs-2"></div>
									<div class="col-md-2 col-sm-2 col-xs-4">
										<label class="control-label label-right" swlang code='SW012262'>Year of Apprasial</label>
									</div>

									<div class="col-md-2 col-sm-2 col-xs-4">
										<%
											DataSet condition = new DataSet();
											condition.setDbName((String)screen.getUProfile().get("dbname"));
											condition.setTableName("hapstran0");
											
											condition.setSql("select apsid,tdesc from hapstran0 where astid = 'AP10'");
											condition.initConnection(screen.getUProfile());
										%>
										<select class="form-control" name="__year">
											<%
												while(condition.next()){
											%>
											<option value="<%=condition.getString("apsid")%>"><%=condition.getString("tdesc")%></option>
											<%}%>
										</select>
									</div>
								</div>
							</div>
							
							<div class="center">
								<a class="btn btn-primary" href="javascript:GoSearch();" swlang code='SW003537'>Search</a>
							</div>
							
						</div>
					</div>	
					
					<span class="detail-table">
						<span swlang code='SW001771'>Found Data</span> :&nbsp;&nbsp;<%= screen.getInquiry().recCount() %>&nbsp;
						<span swlang code='SW001780'>records</span> 
					</span>
					<span class="detail-table label-right">
						<span swlang code='SW001120'>Page</span> : <%=screen.getPageTagNew()%> 
					</span>
					
					<div class="table-responsive">
						<table class="table table-head table-hover table-bordered table-title-left table-content-center">
							<thead>
								<tr>
									<th swlang code='SW000193'>Seq</th>
									<th swlang code='SW000013'>Score</th>
									<th swlang code='SW000021'>Assessy</th>
									<th><%=screen.getLabel("memployee","bu1")%></th>
									<th><%=screen.getLabel("memployee","bu2")%></th>
									<th swlang code='SW000057'>Position</th>
									<th swlang code='SW000230'>Service Year</th>
									<th swlang code='SW000172'>Age</th>
								</tr>
							</thead>
							<tbody>
								<%
									String goPage = chk.chkNullString(request.getParameter("__goPage"),"+0");
									String page_ = goPage.substring(goPage.indexOf("+")+1,goPage.length());
									int numberPage = Integer.parseInt(page_);
									//out.println("numberPage "  + numberPage);
									int inc=1;
									int inc_cout = 1;
									if(numberPage > 1){
										inc_cout = maxline * (numberPage-1);
										inc += inc_cout;
									}
									while(screen.nextRec()){
								%>	
								<tr>
									<td><%=inc%></td>
									<td><%=screen.getString("APSASSSOURCE")%></td>
									<td>
										<!--
										<a href="javascript:goViewAps('<%=screen.getString("apsid")%>','<%=screen.getString("apsassessor")%>','<%=screen.getString("apsassessy")%>','1')">
										-->
											<%=screen.getString("SIMEMP","fullname")%>
										</a>
									</td>
									<td><%=screen.getString("mbu1","tdesc")%></td>
									<td><%=screen.getString("mbu2","tdesc")%></td>
									<td><%=screen.getString("mposition","tdesc")%></td>
									<% String[] y = screen.getDataLabel("simemp","empworkages").split(" "); %>
									<td><%=y[0] %> <span swlang code='SW000717'>Year</span></td>
									<td><%=screen.getString("SIMEMP","empages")%></td>
								</tr>
								<%
									inc++;
									}
								%>
							</tbody>
						</table>
					</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>