APP_EMV_HIS_KPI.jsp 13.6 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 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326
<%@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.HelpEntry, 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"%>

<jsp:useBean id="APP_EMV_HIS_KPI" class="com.csc.library.system.Task" scope="page"/>
<%
	APP_EMV_HIS_KPI.setChannel(request, response);
	HelpEntry screen = (HelpEntry) APP_EMV_HIS_KPI.process("HelpEntry","APP_EMV_HIS");
	
	CheckNull chk = new CheckNull();
	int maxline = 10;

	String filter = "";
	String apsassessy = "";
	String apsassessor="";
	String bu1 = "";
	String bu2 = "";
	String year = "";
	String emp_position= "";
	
	
	String init_filter ="astid = 'AP10'";
	String init_filter_apsassessy ="astid = 'AP10'";
	String init_filter_apsassessor ="astid = 'AP10'";

	year = chk.chkNullString(request.getParameter("__year"));
	bu1 = chk.chkNullString(request.getParameter("bu1"));
	bu2 = chk.chkNullString(request.getParameter("bu2"));
	apsassessor = chk.chkNullString(request.getParameter("apsassessor"));
	apsassessy = chk.chkNullString(request.getParameter("apsassessy"));
	emp_position = chk.chkNullString(request.getParameter("emp_position"));
	
	filter = "astid = 'AP10'";

if(!year.equals("")){
	filter += " and apsid = '"+year+"' ";
}

if(!apsassessor.equals("")){
			filter += " and  (apsassessor = '"+apsassessor+"'  or apsapprove1 = '"+apsassessor+"' or apsapprove2 = '"+apsassessor+"') ";
	}

if(!apsassessy.equals("")){
			filter += " and apsassessy = '"+apsassessy+"' ";
	}

	if(!bu1.equals("")){
				filter += " and bu1 = '"+bu1+"' ";
	}


	if(!bu2.equals("")){
				filter += " and bu2 = '"+bu2+"' ";
	}

	if(!emp_position.equals("")){
			filter += " and emp_position = '"+emp_position+"' ";
	}

	
	screen.setMaxLine(maxline);
//	out.println("filter  : " + filter);
	screen.getInquiry().setFilter(filter);
	screen.process();
	CscCalendar  c_year = new CscCalendar();

		String dbtype =  ((CscConnection) StaticProperties.myConnection.getConnection(screen.getUProfile().get("dbname"), screen.getUProfile())).getVendor();

	
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="../CSS/TISCO.css" rel="stylesheet" type="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 type='text/javascript' src='../JS/SCREEN.js'></script>
<script type='text/javascript' src='../JS/ICONSMENU.js'></script>
<script language='javascript'>setLang('<%=screen.getUProfile().get("lang")%>');</script>

<script language="JavaScript" >
function goSearch(){
with(document.cscform){
		submit();
	}
}

function goClean(){
		with(document.cscform){
				cleanText();
		}
}

function cleanText(){
	with(document.cscform){
		for(i=0;i<elements.length;i++){
			if(elements[i].type=="text") {
				elements[i].value  = "";
			}
		}
	}
}

function goViewAps(apsid,apsassessor_,apsassessy_,isread){
		with(document.cscform){	
		//alert(apsid + " " + apsassessor + " " + apsassessy + " " +isread);
		var param="../EMPVIEW/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 goHelp(helpName,inputName){
	var helpReturn;
		 if(inputName=="bu1" ){
		 	helpReturn="bu1:bu1id,_bu1_tdesc:tdesc";
		 }else if(inputName=="bu2"){
				helpReturn="bu2:bu2id,_bu2_tdesc:tdesc";
		 }else if(inputName == "apsassessor"){
				helpReturn="apsassessor:employeeid,__apsassessor_name:fullname";
		 }else if(inputName=="apsassessy"){
				helpReturn="apsassessy:employeeid,__apsassessy_name:fullname";
		 }else if(inputName == "emp_position"){
				helpReturn="emp_position:positionid,_emp_position_tdesc:tdesc";
		 }
	     linkHelp_Return(helpName,helpReturn);
}

</script>

</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<form name="cscform" method="post" action="APP_EMV_HIS_KPI.jsp">


<!----------BEGIN CSC INITIAL ZONE ------------------------>

<%=screen.InitialVariable()%>

<!----------END CSC INITIAL ZONE -------------------------->

<input type="hidden" name="__calendar">
  <script language="javascript">getInputFormatDate();</script>
  <input type="hidden" name="__language" value="<%=screen.getUProfile().get("lang")%>">
  <input type ="hidden" name="__cmd" value="">
  <input type="hidden" name="__fixCon" value="">
  <input type="hidden" name="__screen" value="APP_EMV_HIS_KPI">
  <input type="hidden" name="__goPage" value ="">
  <input type="hidden" name="__jdesc" value="">
  <input type="hidden" name="__jobcode" value="">
  <div align="center">
  <table  cellpadding="0"  cellspacing="0">
    <tr> 
      <td class="header">APP_EMV_HIS_KPI,<script language="javascript">swapLang('History_Of_Key_Performance_Indicator_Assess');</script></td>
    </tr>
    <tr>
      <td><table  border="0" cellpadding="0" cellspacing="0" id="rsTable" name="rsTable"  class="maxsize">
          <TR> 
            <TD width="150" height="25"></TD>
            <TD width="379"></TD>
            <TD width="257"></TD>
          </TR>
			<tr>
				<td></td>
				<td colspan="2">
					<table  border="0" cellpadding="0" cellspacing="0" id="rsTable" name="rsTable"  class="maxsize">
					<%
								String tdesc = (screen.getUProfile().get("lang").equals("tha"))?"tdesc":"edesc";
								DataSet condition = new DataSet();
								condition.setDbName((String)screen.getUProfile().get("dbname"));



								condition.setTableName("hapstran0");
								
								condition.setSql("select apsid,tdesc,edesc from hapstran0 where "+init_filter+"");
								condition.initConnection(screen.getUProfile()); %>
						<tr>
								<td><script language="javascript">swapLang("Year_of_Apprasial");</script></td>
								<td><select name="__year">
										<option value="" selected><script language="JavaScript">swapLang("All");</script></option>
										<%
										while(condition.next()){%>
												<option value="<%=condition.getString("apsid")%>" <% if(year.equals(condition.getString("apsid"))){ out.print(" selected "); } %> ><%=condition.getString(tdesc)%></option>			
											
										<%}%>
										
										</select></td>
						</tr>
						
							<tr>
								<td><script language="javascript">swapLang("BU1");</script></td>
								<td><input type="text" name="bu1" id="bu1" value="<%=bu1%>" size="10">
								<a onmouseover="MM_swapImage('__bu1id_image','','../IMAGES/BUTTON/SWAP/SEARCH_SWAP20.gif',1)" onmouseout="MM_swapImgRestore()" href="javascript:goHelp('MBU1HELP','bu1');">
								<img name="__bu1id_image" width="20" height="20" align="absmiddle" alt="SEARCH" src="../IMAGES/BUTTON/MAIN/SEARCH20.gif" border="0"/></a><input type="text" name="_bu1_tdesc" value="<%=chk.chkNullString(request.getParameter("_bu1_tdesc"))%>" size ="30" readonly></td>
						</tr>
					
						<tr>
								<td><script language="javascript">swapLang("BU2");</script></td>
								<td><input type="text" name="bu2" value="<%=bu2%>" size="10">
								<a onmouseover="MM_swapImage('__bu1id_image','','../IMAGES/BUTTON/SWAP/SEARCH_SWAP20.gif',1)" onmouseout="MM_swapImgRestore()" href="javascript:goHelp('MBU2HELP','bu2');">
								<img name="__bu1id_image" width="20" height="20" align="absmiddle" alt="SEARCH" src="../IMAGES/BUTTON/MAIN/SEARCH20.gif" border="0"/></a><input type="text" name="_bu2_tdesc" value="<%=chk.chkNullString(request.getParameter("_bu2_tdesc"))%>" size ="30" readonly></td>
						</tr>

							<tr>
								<td><script language="javascript">swapLang("position");</script></td>
								<td><input type="text" name="emp_position" value="<%=emp_position%>" size="10">
								<a onmouseover="MM_swapImage('__bu1id_image','','../IMAGES/BUTTON/SWAP/SEARCH_SWAP20.gif',1)" onmouseout="MM_swapImgRestore()" href="javascript:goHelp('MPOSITIONHELP','emp_position');">
								<img name="__bu1id_image" width="20" height="20" align="absmiddle" alt="SEARCH" src="../IMAGES/BUTTON/MAIN/SEARCH20.gif" border="0"/></a><input type="text" name="_emp_position_tdesc" value="<%=chk.chkNullString(request.getParameter("_emp_position_tdesc"))%>" size ="30" readonly></td>
						</tr>
						
						<tr>
								<td><script language="javascript">swapLang("Assessor");</script></td>
								<td><input type="text" name="apsassessor" value="<%=apsassessor%>" size="10">
								<a onmouseover="MM_swapImage('__bu1id_image','','../IMAGES/BUTTON/SWAP/SEARCH_SWAP20.gif',1)" onmouseout="MM_swapImgRestore()" href="javascript:goHelp('MEMPLOYEEHELP','apsassessor');">
								<img name="__bu1id_image" width="20" height="20" align="absmiddle" alt="SEARCH" src="../IMAGES/BUTTON/MAIN/SEARCH20.gif" border="0"/></a><input type="text" name="__apsassessor_name" value="<%=chk.chkNullString(request.getParameter("__apsassessor_name"))%>" size ="30" readonly></td>
										

								</tr>
						
							<tr>
								<td><script language="javascript">swapLang("assessy");</script></td>
								<td><input type="text" name="apsassessy" value="<%=apsassessy%>" size="10">
								<a onmouseover="MM_swapImage('__bu1id_image','','../IMAGES/BUTTON/SWAP/SEARCH_SWAP20.gif',1)" onmouseout="MM_swapImgRestore()" href="javascript:goHelp('MEMPLOYEEHELP','apsassessy');">
								<img name="__bu1id_image" width="20" height="20" align="absmiddle" alt="SEARCH" src="../IMAGES/BUTTON/MAIN/SEARCH20.gif" border="0"/></a><input type="text" name="__apsassessy_name" value="<%=chk.chkNullString(request.getParameter("__apsassessy_name"))%>" size ="30" readonly>
								
								</td>

								</tr>

								<tr>
									<td>&nbsp;</td>
									<td>&nbsp;</td>
								</tr>



						<tr>
							<td  class="buttonline" colspan="7"><div align="center">
								<button type="button" class="btn btn-primary width100" swlang code="SW013168" onClick="goSearch();">SEARCH</button>&nbsp;
								<button type="button" class="btn btn-primary width100" swlang code="SW013047" onClick="goClean();">CLEAR</button>
							</div>
							</td>
						</tr>
						----------

					</table>
				</td>
			  </tr>

          <TR> 
            <TD class="columnlabel" >&nbsp;<script language="JavaScript" type="text/javascript">swapLang("Found Data");</script> :&nbsp;<%=screen.getRecCount()%></TD>
            <TD colspan="2" nowrap><div align="right">&nbsp;&nbsp;<%=screen.getPageTag()%></div></TD>
          </TR>
          <TR> 
            <TD class="columnlabel" >&nbsp;</TD>
            <TD>&nbsp;</TD>
            <TD>&nbsp;</TD>
          </TR>
        </table>
        <table width="327" border="0" cellpadding="0" cellspacing="0" class="inframe tablewithborder" >
          
          <tr > 
					<td width="5%" class="row3"><div align="center"><script language="javascript">swapLang('Seq');</script></div></td>
					<td width="20%" class="row3"><div align="center"><script language="javascript">swapLang('Assessy');</script></div></td>
					<td width="18%" class="row3"><div align="center"><script language="javascript">swapLang('BU1');</script></div></td>
					<td width="18%" class="row3"><div align="center"><script language="javascript">swapLang('BU2');</script></div></td>
					<td width="18%" class="row3"><div align="center"><script language="javascript">swapLang('Position');</script></div></td>
					<td width="10%" class="row3"><div align="center"><script language="javascript">swapLang('Work Age');</script></div></td>
					<td width="7%" class="row3"><div align="center"><script language="javascript">swapLang('Age');</script></div></td>
									
          </tr>

		
		<%
								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 width="10%" class=""><div align="center"><%=inc%></div></td>
						
									<td width="20%" class="" ><div align="left"><a href="javascript:goViewAps('<%=screen.getString("apsid")%>','<%=screen.getString("apsassessor")%>','<%=screen.getString("apsassessy")%>','1')"><%=screen.getString("SIMEMP","fullname")%></a></div></td>
									<td width="18%" class=""><div align="center"><%=screen.getString("mbu1","tdesc")%></div></td>
									<td width="18%" class=""><div align="center"><%=screen.getString("mbu2","tdesc")%></div></td>
									<td width="18%" class=""><div align="center"><%=screen.getString("mposition","tdesc")%></div></td>
									<% String[] y = screen.getDataLabel("simemp","empworkages").split(" "); %>
									<td width="10%" class=""><div align="center"><%=y[0] %>&nbsp;<script language="javascript">swapLang('Year');</script></div></td>
									<td width="7%" class=""><div align="center"><%=screen.getString("SIMEMP","empages")%></div></td>
									
								</tr>
			
								<%
								
								inc++;
								}%>
		
		      
			<tr><td colspan="7" class="blankspace"></td></tr>
			<tr>
			 <td  class="bottom" colspan="7"></td>
		    </tr>
        </table></td>
    </tr>
	
	
  </table>
  </div>
  
</form>
</body>
</html>