MG_ERROR.jsp 29.8 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 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754
<!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.*,java.util.*"%>
<%@page import="com.csc.library.entry.*,com.csc.library.database.*,com.csc.library.session.*"  %>
<%@page import="com.csc.library.formula.FormulaString,java.text.DecimalFormat, com.csc.library.report.*"  %>
<%@ 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);

	ThaiUtilities thaicode = new ThaiUtilities();
	CheckNull chk = new CheckNull();
	ReportUDF rt = new ReportUDF();
	String groupID = thaicode.ASCII2Unicode(chk.chkNullString(request.getParameter("__subgroupid")));
	String startDate = thaicode.ASCII2Unicode(chk.chkNullString(request.getParameter("date_start")));
	String endDate = thaicode.ASCII2Unicode(chk.chkNullString(request.getParameter("date_end")));

	CscCalendar cs1 = new CscCalendar();
	cs1.decDate(5);
	CscCalendar cs2 = new CscCalendar();
	if (request.getParameter("date_start")!=null && request.getParameter("date_end")!=null) {
		cs1 = new CscCalendar(request.getParameter("date_start"));
		cs2 = new CscCalendar(request.getParameter("date_end"));
	}

	EmvHelpEntry screen = (EmvHelpEntry) EMV.process("EmvHelpEntry", "MG_ERRORHELP");
	//String filter = "(dateid between '"+cs1.getYYYYMMDD()+"' and '"+cs2.getYYYYMMDD()+"') "+
	//	" and (warn00<>'' or warn01<>'')";
	String filter = "";
	String statusfilter = "employeeid in (select employeeid from memployee where status in (select statuscode from mempl_status where statustype = 'A'))";
	if (request.getParameter("__childFilter")!=null) {
		filter = statusfilter;
		if(!request.getParameter("__childFilter").equals("")){
			filter += " and ";
		}
		filter += request.getParameter("__childFilter");
	} else {
		//out.println("xxxxx");
		filter = statusfilter + " and (dateid between '"+cs1.getYYYYMMDD()+"' and '"+cs2.getYYYYMMDD()+"') "+
			"and (warn00 is not null or warn01 is not null or warn02 is not null or warn05 is not null or warn11 is not null)";
		//out.println(filter);
	}

	if (request.getParameter("__select_orderby")!=null) {
		screen.inq.setOrderBy(request.getParameter("__select_orderby"));
	}
	//out.println(filter);
	screen.inq.setFilter(filter);

	CscCalendar cs = new CscCalendar();
	FormulaString fs = new FormulaString();
	DecimalFormat df = new DecimalFormat("0.00");
	DecimalFormat df2 = new DecimalFormat("00.00");

	screen.setMaxLine(15);
	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();

	screen.inq.refresh();
	screen.nextRec();
%>

<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>
			setLang("<%=screen.getUProfile().get("lang")%>");
			var swap = new swaplang();
            var titlename = swap.swap2String("SW012373");
			setPageTitle(titlename);

			$(document).ready(function(){


				//datepicker function
				var myLang='<%=screen.getUProfile().get("lang")%>';
				if (myLang=="tha"){
					$.datepicker.setDefaults($.datepicker.regional['tha']);
				}

				$("input[name=date_start]").hover(function(){
					$("input[name=date_start]").datepicker({
						dateFormat:"dd-mm-yy",
						maxDate:-1,
						defaultDate:-1,
						changeMonth: true,
						changeYear: true
					});
					$("input[name=date_end]").datepicker("destroy");
				});


				$("input[name=date_end]").change(function(){
					if ($("input[name=date_start]").val()>$("input[name=date_end]").val()){
						$("input[name=date_start]").val($("input[name=date_end]").val());
					} else if ($("input[name=date_start]").val()==""){
						$("input[name=date_start]").val($("input[name=date_end]").val());
					}
				});


				$("input[name=date_end]").hover(function(){
					$("input[name=date_end]").datepicker({
						minDate: new Date(ConvertDate($("input[name=date_start]").val())),
						dateFormat:"dd-mm-yy",
						changeMonth: true,
						changeYear: true
					});
				});
			});

			function goHelp(helpName,inputName){
				//alert(helpName+" "+inputName);
				with(document.cscform){
					var helpReturn="";
					var fcon=__fixCon.value;
					var sub_value = "";
					if (inputName=="__subgroupid") {
						__fixCon.value = "employeeid='<%=EMV.getUProfile().get("employeeid")%>'";
						helpReturn = inputName+":groupid,__desc:edesc"
						linkHelp_Return(helpName,helpReturn);
					}
					__fixCon.value = "";
				}
			}

			function chkAll(){
				with (document.cscform){
					for (i=0;i<elements.length;i++){
						if (elements[i].name.indexOf("error_") > -1){
							if(errorall.checked){
							//alert(i);
								elements[i].checked=true;
							}else{
								elements[i].checked=false;
							}
						}
					}
				}
			}

			function GoSearch() {
				with(document.cscform){
					setChildFilter();

					//กรองข้อผิดพลาดที่ต้องการ
					var etype = "";
					var err = "";
					for (j=0; j<elements.length; j++){
						if (elements[j].name.indexOf("error_") > -1){
							if (elements[j].checked){
								if (etype != ""){
									etype +=" or ";
								}
								if(elements[j].value=="absent"){
									etype += "eventgrp = 'J' ";
								}else{
									etype += elements[j].value+" is not null ";
								}
								//etype += elements[j].value+" != '' ";
								err += elements[j].value+",";
							}
						}
					}
						//alert(etype);
					if (!etype==""){
						__error.value = err;
						__childFilter.value += " and ("+etype+")";
						search();
					} else {
						if(__language.value=="tha") {
							alert("กรุณาเลือกเงื่อนไขข้อผิดพลาดที่ต้องการอย่างน้อย 1 ประเภท");
						} else alert("Please select error type less 1 type");
						//return false;
					}
				} //end with
			}

			function setChildFilter(){
				with(document.cscform){
					var sqlDate="";
					if (date_start.value.length>0 && date_end.value.length>0)
						sqlDate = " (dateid between '"+chkDateTime1(date_start.value)+"' and '"+chkDateTime1(date_end.value)+"') ";
					else if (date_start.value.length>0 && date_end.value.length==0)
						sqlDate = " dateid='"+chkDateTime1(date_start.value)+"' ";
					else if (__date2.value.length>0 && date_start.value.length==0)
						sqlDate = " dateid='"+chkDateTime1(date_end.value)+"' ";

					if (sqlDate!="") {
						__childFilter.value = sqlDate;
					} else __childFilter.value = "";
				}
			}

			//Override Method in Screen
			function goPage(page){
				with(document.cscform){
					setChildFilter();
					__goPage.value=page;
					submit();
				}
			}

			/*function GoSearch(){
				with(document.cscform){
					if (__subgroupid.value=="") {
						__desc.value = "";
					}
					search();
				}
			}*/

			function getOrderByDesc(m){
				//alert(m);
				with(document.cscform){
					var orderName = "";
					var engOrder = new Array("Date","EmployeeID","Date [Max->Min]","EmployeeID  [Max->Min]");
					var thaiOrder = new Array("วันที่","รหัสพนักงาน","วันที่ [มาก->น้อย]","รหัสพนักงาน [มาก->น้อย]");
					if (m=='dateid') {
						m = 1;
					} else if (m=='employeeid') {
						m = 2;
					} else if (m=='dateid desc') {
						m = 3;
					} else if (m=='employeeid desc') {
						m = 4;
					}
					if (__language.value=='tha') {
						orderName = thaiOrder[parseInt(m)-1];
					} else orderName = engOrder[parseInt(m)-1];
					//alert(m+" "+engDate);
					document.write(orderName);
				}
			}

			function pageDesc(empid, dateid, sequence){
				with(document.cscform) {
					var d=chkDateTime1(dateid);
					var filterCon = "employeeid='"+empid+"' and (dateid='"+d+"') and sequence='"+sequence+"'";

					//alert(filterCon);
					window.open("PI_ERROR_DESC.jsp?__cmd="+
						"&__fixCon="+filterCon,
						"ShowWarning","left=50,top=50,width=920,height=500,toolbar=no,status=yes,scrollbars=yes,resizable=yes"
					);
				}
			}

		</script>

		<section>
			<div class="container csc-content">
				<form name="cscform" class="form-horizontal" method="post" action="MG_ERROR.jsp">
					<%=screen.InitialVariable()%>
					<input type="hidden" name="__cmd" value="">
					<input type="hidden" name="__screen"  value="MG_ERROR">
					<input type="hidden" name="__help" value="">
					<input type="hidden" name="__helpReturn" value="">
					<input type="hidden" name="__helpName" value="">
					<input type="hidden" name="__goPage" value="" />
					<input type="hidden" name="__pageCall" >
					<input type="hidden" name="__referPage" value="">
					<input type="hidden" name="__calendar">
					<script language="javascript">getInputFormatDate();</script>
					<input type="hidden" name="__companyid"  value="<%=screen.getUProfile().get("companyid")%>">
					<input type="hidden" name="__fixCon"  >
					<input type="hidden" name="__language" value="<%=screen.getUProfile().get("lang")%>">
					<input type="hidden" name="__childFilter" >
					<input type="hidden" name="__error" value="<%=request.getParameter("__error")%>">
					<div id="toolTipLayer" style="position:absolute; visibility: hidden"></div>
					<script>initToolTips();</script>

					<%
						/*
						 * Error_Type
						 *		ลืมรูดเข้า = FORGOT-IN ---> 0
						 * 		ลืมรูดออก = FORGOT-OUT ---> 1
						 * 		สาย = LATE ---> 2
						 * 		โอทีก่อนเวลา = OT-BEFORE ---> 3
						 * 		โอทีหลังเวลา = OT-AFTER ---> 4
						 * 		ออกก่อนเวลา = OUT-ABSENT ---> 5
						 * 		เข้าช้า = IN-ABSENT ---> 6
						 * 		//รูดเข้าหลายครั้ง = IN-MORE ---> 7 NOT USE
						 * 		//รูดออกหลายครั้ง = OUT-MORE ---> 8 NOT USE
						 * 		//ทำงานก่อนเวลางาน WK-BEFORE ---> 9 NOT USE
						 * 		//ทำงานหลังเวลางาน WK-AFTER ---> 10 NOT USE
						 * 		รูดบัตรในวันหยุดงาน WK-HOLIDAY ---> 11
						 * 		โอทีเกินก่อนเวลา OT-OVER-BEFORE ---> 12
						 * 		โอทีเกินหลังเวลา OT-OVER-AFTER ---> 13
						 *    	โอทีขาดก่อนเวลา OT-LESS-BEFORE ---> 14
						 * 		โอทีขาดหลังเวลา OT-LESS-AFTER ---> 15
						 */
						TreeMap hmErrorType = new TreeMap();
						String[][] sysCode = SystemCode.getContent("ERROR_TYPE");
						for(int i=0;i<sysCode.length;i++){
							String key = sysCode[i][0];
							if (Integer.parseInt(key)>=7 && Integer.parseInt(key)<=10) {
								continue;
							}

							if (Integer.parseInt(key)<10) {
								key = "warn0"+key;
							} else {
								key = "warn"+key;
							}

							String value = sysCode[i][1];
							if (((String)screen.getUProfile().get("lang")).equals("tha")) {
								value = value.substring(value.indexOf(",") + 1);
							} else {
								value = value.substring(0, value.indexOf(","));
							}
							hmErrorType.put(key, value);
						}

						String date1="", date2="", warn_c01="", warn_c02="", warn_c03="", warn_c04="", warn_c05="";
						if (request.getParameter("date_start")!=null) date1=request.getParameter("date_start");
						if (request.getParameter("date_end")!=null) date2=request.getParameter("date_end");
						if (request.getParameter("warn_col01")!=null) warn_c01=request.getParameter("warn_col01");
						if (request.getParameter("warn_col02")!=null) warn_c02=request.getParameter("warn_col02");
						if (request.getParameter("warn_col03")!=null) warn_c03=request.getParameter("warn_col03");
						if (request.getParameter("warn_col04")!=null) warn_c04=request.getParameter("warn_col04");
						if (request.getParameter("warn_col05")!=null) warn_c05=request.getParameter("warn_col05");

						HashMap hm = new HashMap();
						String type = "";
						String error = "";
						if (request.getParameter("__error")==null) {
							error = "warn00,warn01,warn02,warn05,warn11";
						} else error = chk.chkNullString(request.getParameter("__error"));
						StringTokenizer str = new StringTokenizer(error,",");
						while (str.hasMoreTokens()) {
							type = str.nextToken();
							hm.put(type,type);
						}

					%>

					<div class="csc-block">
						<div class="center">
							<h2 class="csc-block-head" swlang code='SW012373'>Daily Statistic</h2>
						</div>

						<div class="form-horizontal">
							<div class="row">
								<div class="form-group">
									<div class="col-md-2 col-sm-2 col-xs-2"></div>
									<div class="col-md-2 col-sm-2 col-xs-2">
										<label class="control-label label-right" swlang code='SW002085'>Subordinate Group </label>
									</div>

									<div class="col-md-2 col-sm-2 col-xs-2">
										<% if (request.getParameter("__subgroupid")!=null && !request.getParameter("__subgroupid").equals("")) { %>
										<div class="input-group">
											<input class="form-control" name="__subgroupid" type="text" class="text" size="15" value="<%=request.getParameter("__subgroupid")%>"/>
											<a class="input-group-addon" href="javascript:goHelp('MSUBORDINATE_GRPHELP','__subgroupid')">
												<i class="fa fa-search"></i>
											</a>
										</div>
										<% } else { %>
										<div class="input-group">
											<input class="form-control" name="__subgroupid" type="text" class="text" size="15" />
											<a class="input-group-addon" href="javascript:goHelp('MSUBORDINATE_GRPHELP','__subgroupid')">
												<i class="fa fa-search"></i>
											</a>
										</div>
										<% } %>
									</div>
									<div class="col-md-3 col-sm-3 col-xs-3">
										<% if (request.getParameter("__desc")!=null && !request.getParameter("__desc").equals("")) { %>
										<input class="form-control" name="__desc" type="text" class="text" size="60" value="<%=request.getParameter("__desc")%>"/>
										<% } else { %>
										<input class="form-control" name="__desc" type="text" class="text" size="60" value="" />
										<% } %>
									</div>
								</div>
							</div>

							<div class="row">
								<div class="form-group">
									<div class="col-md-2 col-sm-2 col-xs-2"></div>
									<div class="col-md-2 col-sm-2 col-xs-2">
										<label class="control-label label-right" swlang code='SW000275'>Begin Date</label>
									</div>
									<div class="col-md-2 col-sm-2 col-xs-2">
										<% if (request.getParameter("date_start")==null) { %>
										<input class="form-control" name="date_start" type="text" value="<%=cs1.getDDMMYYYY()%>" size="9" maxlength="10" onkeyup = "formatDate(this)" onblur = "chkInputDate2(this,date_end)" onkeypress = "chkIntegerOfDate(this.value)" >
										<% } else {%>
										<input class="form-control" name="date_start" type="text" value="<%=request.getParameter("date_start")%>" size="9" maxlength="10" onkeyup = "formatDate(this)" onblur = "chkInputDate2(this,date_end)" onkeypress = "chkIntegerOfDate(this.value)" >
										<% }%>
									</div>
									<div class="col-md-1 col-sm-1 col-xs-1">
										<label class="control-label label-right" swlang code='SW002379'>To Date</label>
									</div>
									<div class="col-md-2 col-sm-2 col-xs-2">
										<% if (request.getParameter("date_end")==null) { %>
										<input class="form-control" name="date_end" type="text" value="<%=cs2.getDDMMYYYY()%>" size="9" maxlength="10" onkeyup = "formatDate(this)" onblur = "chkInputDate2(date_start,this)" onkeypress = "chkIntegerOfDate(this.value)">
										<% } else {%>
										<input class="form-control" name="date_end" type="text" value="<%=request.getParameter("date_end")%>" size="9" maxlength="10" onkeyup = "formatDate(this)" onblur = "chkInputDate2(date_start,this)" onkeypress = "chkIntegerOfDate(this.value)">
										<% }%>
									</div>
								</div>
							</div>

							<div class="row">
								<div class="form-group">
									<div class="col-md-2 col-sm-2 col-xs-2"></div>
									<div class="col-md-2 col-sm-2 col-xs-2">
										<label class="control-label label-right"><span swlang code='SW002184'>Column</span> 1 </label>
									</div>

									<div class="col-md-2 col-sm-2 col-xs-2">
										<select class="form-control" name="warn_col01">
											<%
												Iterator it = hmErrorType.keySet().iterator();
												while (it.hasNext()) {
													String key = (String) it.next();
													String value = (String) hmErrorType.get(key);

													if (warn_c01.equals("") && key.equals("warn00")) {
											%>
													<option value="<%=key%>" selected><%=value%></option>
											<%
													} else {
											%>
													<option value="<%=key%>" <% if (warn_c01.equals(key)) out.println("selected");%>><%=value%></option>
											<%
													}
												} //end while
											%>
										</select>
									</div>

									<div class="col-md-1 col-sm-1 col-xs-1">
										<label class="control-label label-right"><span swlang code='SW002184'>Column</span> 2 </label>
									</div>

									<div class="col-md-2 col-sm-2 col-xs-2">
										<select class="form-control" name="warn_col02">
											<%
												it = hmErrorType.keySet().iterator();
												while (it.hasNext()) {
													String key = (String) it.next();
													String value = (String) hmErrorType.get(key);
													if (warn_c02.equals("") && key.equals("warn01")) {
											%>
													<option value="<%=key%>" selected><%=value%></option>
											<%
													} else {
											%>
													<option value="<%=key%>" <% if (warn_c02.equals(key)) out.println("selected");%>><%=value%></option>
											<%
													}
												} //end while
											%>
										</select>
									</div>
								</div>
							</div>

							<div class="row">
								<div class="form-group">
									<div class="col-md-2 col-sm-2 col-xs-2"></div>
									<div class="col-md-2 col-sm-2 col-xs-2">
										<label class="control-label label-right"><span swlang code='SW002184'>Column</span> 3 </label>
									</div>

									<div class="col-md-2 col-sm-2 col-xs-2">
										<select class="form-control" name="warn_col03">
											<%
												it = hmErrorType.keySet().iterator();
												while (it.hasNext()) {
													String key = (String) it.next();
													String value = (String) hmErrorType.get(key);
													if (warn_c03.equals("") && key.equals("warn02")) {
											%>
													<option value="<%=key%>" selected><%=value%></option>
											<%
													} else {
											%>
													<option value="<%=key%>" <% if (warn_c03.equals(key)) out.println("selected");%>><%=value%></option>
											<%
													}
												} //end while
											%>
										</select>
									</div>

									<div class="col-md-1 col-sm-1 col-xs-1">
										<label class="control-label label-right"><span swlang code='SW002184'>Column</span> 4 </label>
									</div>

									<div class="col-md-2 col-sm-2 col-xs-2">
										<select class="form-control" name="warn_col04">
											<%
												it = hmErrorType.keySet().iterator();
												while (it.hasNext()) {
													String key = (String) it.next();
													String value = (String) hmErrorType.get(key);
													if (warn_c04.equals("") && key.equals("warn05")) {
											%>
													<option value="<%=key%>" selected><%=value%></option>
											<%
													} else {
											%>
													<option value="<%=key%>" <% if (warn_c04.equals(key)) out.println("selected");%>><%=value%></option>
											<%
													}
												} //end while
											%>
										</select>
									</div>
								</div>
							</div>

							<div class="row">
								<div class="form-group">
									<div class="col-md-2 col-sm-2 col-xs-2"></div>
									<div class="col-md-2 col-sm-2 col-xs-2">
										<label class="control-label label-right" swlang code='SW002014'>Order By </label>
									</div>
									<div class="col-md-2 col-sm-2 col-xs-2">
										<select class="form-control" name="__select_orderby">
											<%
												String s_order = "";
												if (request.getParameter("__select_orderby")!=null) {
													s_order = request.getParameter("__select_orderby");
												}
											%>
											<option value="dateid" <% if (s_order.equals("dateid")) { %> selected <%}%>><script>getOrderByDesc('dateid')</script></option>
											<option value="employeeid" <% if (s_order.equals("employeeid")) { %> selected <%}%>><script>getOrderByDesc('employeeid')</script></option>
											<option value="dateid desc" <% if (s_order.equals("dateid desc")) { %> selected <%}%>><script>getOrderByDesc('dateid desc')</script></option>
											<option value="employeeid desc" <% if (s_order.equals("employeeid desc")) { %> selected <%}%>><script>getOrderByDesc('employeeid desc')</script></option>
										</select>
									</div>
								</div>
							</div>

							</br>
							<div class="row">
								<div class="form-group">
									<div class="col-md-2 col-sm-2 col-xs-2"></div>
									<div class="col-md-3 col-sm-3 col-xs-3">
										<label class="control-label">
											<input name="error_00" type="checkbox" value="warn00" <% if (hm.containsKey("warn00")) out.println("checked");%>><%=rt.getSystemCode("ERROR_TYPE",screen.getUProfile().get("lang"),"0")%>
										</label>
									</div>
									<div class="col-md-3 col-sm-3 col-xs-3">
										<label class="control-label">
											<input name="error_01" type="checkbox" value="warn01" <% if (hm.containsKey("warn01")) out.println("checked");%>><%=rt.getSystemCode("ERROR_TYPE",screen.getUProfile().get("lang"),"1")%>
										</label>
									</div>
									<div class="col-md-3 col-sm-3 col-xs-3">
										<label class="control-label">
											<input name="error_02" type="checkbox" value="warn02" <% if (hm.containsKey("warn02")) out.println("checked");%>><%=rt.getSystemCode("ERROR_TYPE",screen.getUProfile().get("lang"),"2")%>
										</label>
									</div>
								</div>
							</div>

							<div class="row">
								<div class="form-group">
									<div class="col-md-2 col-sm-2 col-xs-2"></div>
									<div class="col-md-3 col-sm-3 col-xs-3">
										<label class="control-label">
											<input name="error_03" type="checkbox" value="warn03" <% if (hm.containsKey("warn03")) out.println("checked");%>><%=rt.getSystemCode("ERROR_TYPE",screen.getUProfile().get("lang"),"3")%>
										</label>
									</div>
									<div class="col-md-3 col-sm-3 col-xs-3">
										<label class="control-label">
											<input name="error_04" type="checkbox" value="warn04" <% if (hm.containsKey("warn04")) out.println("checked");%>><%=rt.getSystemCode("ERROR_TYPE",screen.getUProfile().get("lang"),"4")%>
										</label>
									</div>
									<div class="col-md-3 col-sm-3 col-xs-3">
										<label class="control-label">
											<input name="error_05" type="checkbox" value="warn05" <% if (hm.containsKey("warn05")) out.println("checked");%>><%=rt.getSystemCode("ERROR_TYPE",screen.getUProfile().get("lang"),"5")%>
										</label>
									</div>
								</div>
							</div>


							<div class="row">
								<div class="form-group">
									<div class="col-md-2 col-sm-2 col-xs-2"></div>
										<div class="col-md-3 col-sm-3 col-xs-3">
										<label class="control-label">
											<input name="error_06" type="checkbox" value="warn06" <% if (hm.containsKey("warn06")) out.println("checked");%>><%=rt.getSystemCode("ERROR_TYPE",screen.getUProfile().get("lang"),"6")%>
										</label>
									</div>
									<div class="col-md-3 col-sm-3 col-xs-3">
										<label class="control-label">
											<input name="error_11" type="checkbox" value="warn11" <% if (hm.containsKey("warn11")) out.println("checked");%>><%=rt.getSystemCode("ERROR_TYPE",screen.getUProfile().get("lang"),"11")%>
										</label>
									</div>
									<div class="col-md-3 col-sm-3 col-xs-3">
										<label class="control-label">
											<input name="error_12" type="checkbox" value="warn12" <% if (hm.containsKey("warn12")) out.println("checked");%>><%=rt.getSystemCode("ERROR_TYPE",screen.getUProfile().get("lang"),"12")%>
										</label>
									</div>
								</div>
							</div>



							<div class="row">
								<div class="form-group">
									<div class="col-md-2 col-sm-2 col-xs-2"></div>
									<div class="col-md-3 col-sm-3 col-xs-3">
										<label class="control-label">
											<input name="error_13" type="checkbox" value="warn13" <% if (hm.containsKey("warn13")) out.println("checked");%>><%=rt.getSystemCode("ERROR_TYPE",screen.getUProfile().get("lang"),"13")%>
										</label>
									</div>
									<div class="col-md-3 col-sm-3 col-xs-3">
										<label class="control-label">
											<input name="error_14" type="checkbox" value="warn14" <% if (hm.containsKey("warn14")) out.println("checked");%>><%=rt.getSystemCode("ERROR_TYPE",screen.getUProfile().get("lang"),"14")%>
										</label>
									</div>
									<div class="col-md-3 col-sm-3 col-xs-3">
										<label class="control-label">
											<input name="error_15" type="checkbox" value="warn15" <% if (hm.containsKey("warn06")) out.println("checked");%>><%=rt.getSystemCode("ERROR_TYPE",screen.getUProfile().get("lang"),"15")%>
										</label>
									</div>
								</div>
							</div>

							<div class="row">
								<div class="form-group">
									<div class="col-md-2 col-sm-2 col-xs-2"></div>
									<div class="col-md-3 col-sm-3 col-xs-3">
										<label class="control-label">
											<input name="error_absent" type="checkbox" value="absent" <% if (hm.containsKey("absent")) out.println("checked");%>><%=screen.getUProfile().get("lang").equalsIgnoreCase("THA")?"ขาดงาน":"Absent"%>
										</label>
									</div>
									<div class="col-md-3 col-sm-3 col-xs-3">
										<label class="control-label">
											<input name="errorall" type="checkbox" value="warn16" onclick="javascript:chkAll();" ><span swlang code='SW002185'>Select All</span>
										</label>
									</div>
								</div>
							</div>
							<div class="center">
								<a class="btn btn-primary" swlang code="SW003537" href="javascript:GoSearch();">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">
							<%
								int i = 0;
								String tmpEmp = "";
								String empID = "", empName = "";
								DbInquiry child = screen.inq;
								if (child.recCount()>0) {
									do {
										DbRecord rec = child.getCurrentDbRecord();
										CscCalendar cDate = new CscCalendar(rec.getString("dateid"));
										if (tmpEmp.equals(rec.getString("employeeid"))) {
											empID = "";
											empName = "";
										} else {
											empID = rec.getString("employeeid");
											empName = rec.getString("employeeid") + " : " + rec.getChild("memployee").getString("fullname");
										}
							%>
							<% if (i==0) { %>
							<div align = "right" swlang code='SW013247'>unit : HH.MM</div>
								<tr>
									<th swlang code="SW007745">Name Surname</th>
									<th swlang code="SW000002">Date</th>
									<th><%=rec.getField("warn_col01").getDescription()%></th>
									<th><%=rec.getField("warn_col02").getDescription()%></th>
									<th><%=rec.getField("warn_col03").getDescription()%></th>
									<th><%=rec.getField("warn_col04").getDescription()%></th>
									<th><%=rec.getField("warn_col06").getDescription()%></th>
								</tr>

								<% } %>

								<tr>
									<td class="table-title table-title-mini"><%=empName%></td>
									<td><%=cDate.getDDMMYYYY()%></td>
									<% if (warn_c01.equals("warn00") || warn_c01.equals("warn01")) { %>
									<td class="week"><%=rec.getString("warn_col01")%></td>
									<% } else { %>
									<td><%=rec.getString("warn_col01")%></td>
									<% }%>
									<% if (warn_c02.equals("warn00") || warn_c02.equals("warn01")) { %>
									<td class="week"><%=rec.getString("warn_col02")%></td>
									<% } else { %>
									<td><%=rec.getString("warn_col02")%></td>
									<% }%>
									<% if (warn_c03.equals("warn00") || warn_c03.equals("warn01")) { %>
									<td class="week"><%=rec.getString("warn_col03")%></td>
									<% } else { %>
									<td><%=rec.getString("warn_col03")%></td>
									<% }%>
									<% if (warn_c04.equals("warn00") || warn_c04.equals("warn01")) { %>
									<td class="week"><%=rec.getString("warn_col04")%></td>
									<% } else { %>
									<td><%=rec.getString("warn_col04")%></td>
									<% }%>
									<td>
										<%
											if (rec.getString("warn_col06").equals("YES") || rec.getString("warn_col06").equals("มี")) {
										%>
										<a href="javascript:pageDesc('<%=rec.getString("employeeid")%>','<%=cDate.getDDMMYYYY()%>','<%=rec.getString("sequence")%>')">
											<i class="changepage-icon fa fa-info"></i>
										</a>
										<%
											}  else { out.println("-"); }
										%>
									</td>
								</tr>
								<%
											tmpEmp = rec.getString("employeeid");
											i++;
										} while (child.next());
									}
								%>
						</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>