TAU_CSCWF_018_Center.jsp 36.2 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
<%@page contentType="text/html; charset=UTF-8"%>
<%@page import="java.util.*,java.io.*"%>
<%@page import="com.csc.library.util.download.*"%>
<%@page import="com.csc.library.util.ManageDocument"%>
<%@page import="com.csc.library.databean.util.FileUtil"%>
<%@page import="com.csc.library.approve.*,com.csc.library.databean.*"%>
<%@page import="com.csc.library.entry.*,com.csc.library.utilities.*"%>
<%@page import="com.csc.library.session.*"%>

<%@page import="com.csc.library.entry.*,com.csc.library.system.*,com.csc.library.session.*,com.csc.library.utilities.*,java.text.DecimalFormat,com.csc.library.database.*"%>
<%@page import="java.util.*,java.io.*,java.sql.*"%>

<%request.setCharacterEncoding("UTF-8");%>

<!-- Begin useBean -->

<jsp:useBean id="TEMPLATE_WORKFLOW" class="com.csc.library.system.Task" scope="page"/>
<jsp:setProperty name="TEMPLATE_WORKFLOW" property="classauthen" value="WorkflowUIAuthen" />

<%
TEMPLATE_WORKFLOW.setChannel(request,response);
TEMPLATE_WORKFLOW.checkProfile();

if( TEMPLATE_WORKFLOW.getUProfile() != null ){
	TEMPLATE_WORKFLOW.getUProfile().set("appname","TA");
	UIManager screenSingle = (UIManager) TEMPLATE_WORKFLOW.process("SingleEntry","TEMPLATE_WORKFLOW");
	
	/*boolean isStep1 = false;
	boolean isStep2 = false;
	boolean isStep3 = false;
	boolean isStepCancel = false;
	boolean isStepComment = false;
	boolean isStepReturn = false;
	boolean isStepCopy = false;*/
	
	String wf = null;
	CheckNull chkNull = new CheckNull();
	Organization og = new Masfactor(screenSingle.getUProfile());
	String subject = null;
	String remark = null;
	String step_type = null;
	String emp_fullname = null;
	String bossid = og.getBoss(screenSingle.getUProfile().get("employeeid"),screenSingle.getUProfile().get("job")).get(0).toString();
	String bossjob = bossid.substring(bossid.indexOf(":")+1);
	CscCalendar calendar = new CscCalendar();
	long attach_time = Long.parseLong(chkNull.chkNullString(request.getParameter("attach_time"),String.valueOf(calendar.getTimeInMillis())));
	ManageDocument md = new ManageDocument();
	md.setUProfile(screenSingle.getUProfile());
	md.setRequest(request);
	md.setScreen(screenSingle);

	if( !chkNull.chkNullString(request.getParameter("__cmd")).equals("save") ){
		subject = chkNull.chkNullString(request.getParameter("subject"));
		remark = chkNull.chkNullString(request.getParameter("__remark"));
		emp_fullname = chkNull.chkNullString(request.getParameter("emp_fullname"));
	}else if( chkNull.chkNullString(request.getParameter("__cmd")).equals("save") ){
		/*if( chkNull.chkNullString(request.getParameter("__checkPage")).equals("true") ){
			response.sendRedirect("../MYNOTE/SENT_COMPLETE.jsp");
		}else{
			response.sendRedirect("../MYNOTE/INBOX.jsp");
		}*/
			if(chkNull.chkNullString(request.getParameter("isAdminEdit")).equals("true")){
			response.sendRedirect("../WORKFLOW_ADMIN/ADMIN_EDIT.jsp");
		}else if(chkNull.chkNullString(request.getParameter("isAdminCancel")).equals("true")){
			response.sendRedirect("../WORKFLOW_ADMIN/ADMIN_CANCEL.jsp");
		}else	if(chkNull.chkNullString(request.getParameter("isAdminClean")).equals("true")){
			response.sendRedirect("../WORKFLOW_ADMIN/ADMIN_CLEAN.jsp");
		}else if(chkNull.chkNullString(request.getParameter("isAdminDelete")).equals("true")){
			response.sendRedirect("../WORKFLOW_ADMIN/ADMIN_DELETE.jsp");
		}else{
			response.sendRedirect("../MYNOTE/SENT_COMPLETE.jsp");
		}
		//response.sendRedirect("../MYNOTE/SENT_COMPLETE.jsp");
	}else{
		subject = "";
		remark = "";
		emp_fullname = "";
	}

	bossid = bossid.substring(0,bossid.indexOf(":"));
	DbRecord memployee_dr = new InitialRecord(screenSingle.getUProfile()).getDbRecord("Memployee");
	memployee_dr.setColumn("*");
	memployee_dr.set("COMPANYID",screenSingle.getUProfile().get("companyid"));
	memployee_dr.set("EMPLOYEEID",bossid);
	memployee_dr.search();

	//WF_STATUS 1 = รอการอนุมัติ
	//          3 = ยกเลิกการอนุมัติ
	//          4 = อนุมัติแล้ว
	//          5 = ไม่อนุมัติ
	//          6 = แก้ไขโดย HR
	//          7 = ส่งกลับ
	//          8 = ยกเลิกเอกสาร
	//          9 = ประวัติ

	if( (request.getParameter("__runno") == null || request.getParameter("__runno").equals("")) && 
		(request.getParameter("__help") == null || request.getParameter("__help").equals("")) ){
		screenSingle.clean();
	}

	if( (!screenSingle.getDataLabel("WF_STATUS").equals("1")) && (!screenSingle.getDataLabel("WF_STATUS").equals("4")) &&
		(!screenSingle.getDataLabel("WF_STATUS").equals("7")) ){
		wf = "false";
	}else{
		wf = "true";
	}

	if( request.getParameter("downfile") != null ){
		ThaiUtilities tu = new ThaiUtilities();
		String filePath = request.getParameter("downfile");
		File f = new File(tu.ASCII2Unicode(filePath));
		String fileName = f.getName();
		String fileType = fileName.substring(fileName.indexOf(".")+1,fileName.length());
		if ( f.exists() && f.canRead() ) {
			response.setContentType("application/octet-stream");
			response.setHeader("Content-Disposition", "attachment; filename="+tu.Unicode2ASCII(f.getName()));
			response.setHeader("cache-control", "no-cache");
			response.setContentLength((int) f.length());
			BufferedInputStream fileInput = new BufferedInputStream(new FileInputStream(f));
			byte buffer[] = new byte[8 * 1024];
			out.clearBuffer();
			OutputStream out_s = response.getOutputStream();
			CopyStreams.copyStreamsWithoutClose(fileInput, out_s, buffer);
			out_s.flush();
			out_s.close();
			fileInput.close();
		}
	}
	
	String  filters = "";
	String dbName = screenSingle.getUProfile().getDbName();
	String tableName = "emp_center";
	String sql = "select filter from emp_center where usernameid = '"+screenSingle.getUProfile().get("username")+"'";
	DataSet ds = new DataSet(sql, dbName,tableName); 
	ds.initConnection(screenSingle.getUProfile());
	while(ds.next()){
		filters = chkNull.chkNullString(ds.getString("filter"));
	}
	ds.closeConnection();
	
%>
<!-- End useBean -->

<HTML ng-app="myHR">
	<HEAD>
		<TITLE>myNOTE : Business Process Management Service</TITLE>
		<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
		<!-- Begin Link -->
		<LINK HREF="../CSS/MYNOTE.css" REL="stylesheet" TYPE="text/css">
		<LINK HREF="../CSS/MYNOTE_MENU.css" REL="stylesheet" TYPE="text/css">
		<!-- End Link -->
		<!-- Begin Import Script -->
		<SCRIPT TYPE='text/JavaScript' SRC='../JS/MYNOTE_SCREEN.js'></SCRIPT>
		<SCRIPT TYPE='text/JavaScript' SRC='../JS/MYNOTE_MENU.js'></SCRIPT>
		<SCRIPT TYPE='text/JavaScript' SRC='../JS/SCREEN.js'></SCRIPT>
		<SCRIPT TYPE='text/JavaScript' SRC='../JS/DATEINPUT.js'></SCRIPT>
		<SCRIPT TYPE='text/JavaScript' SRC='../JS/VIEWCALENDAR.js'></SCRIPT>
		<SCRIPT TYPE='text/JavaScript' SRC='../JS/ICONSMENU.js'></SCRIPT>
		<SCRIPT LANGUAGE="JavaScript">setLang('<%=screenSingle.getUProfile().get("lang")%>');</SCRIPT>
		<SCRIPT TYPE='text/JavaScript' SRC='../TA/JS/TA_SCREEN.js'></SCRIPT>
                <script type='text/javascript' src='../JS/angular-1.3.15/angular.js'></script>
                <script type='text/JavaScript' SRC='../JS/ANGULAR/SCREEN_ANGULAR.js'></script>

		<!-- End Import Script -->
		<!--DWR INCLUDE-->
		<script type='text/javascript' src='/hr/dwr/interface/SearchDWR.js'></script>
		<script type='text/javascript' src='/hr/dwr/engine.js'></script>
		<script type='text/javascript' src='/hr/dwr/util.js'></script>
		<script type="text/javascript" src="/hr/dwr/interface/SystemCode.js"></script>
		<script type="text/javascript" src="/hr/dwr/interface/CscCalendar.js"></script>
		<script type="text/javascript" src="/hr/dwr/interface/Tchangeshift_nstda_dwr.js"></script>
        <script type="text/javascript" src="/hr/dwr/interface/Tchholiday_dwr.js"></script>

		<!--DWR INCLUDE-->
		<SCRIPT LANGUAGE="JavaScript" TYPE="text/JavaScript">
		<!--		
			function preGoWF(){
				var msg="Date is Duplicate.";
				with( document.cscform ){
					if(__language.value == "tha") {msg="วันที่ต้องการเปลี่ยนซ้ำ";}
					if(__wf__employeeid.value != "" && __wf__dateid.value != ""){
						//if(__wf__change_date1.value != __wf__change_date2.value){
							//if(__wf__chkHoliday.value == "true"){
							//if(matchCondition()){
								//__wf__chkHoliday.value = true;
								setMailConfigWorkflow();
								GoWF();
							/*}else{
								if(document.cscform.__language.value == "tha")
								{ alert("ไม่สามารถเปลี่ยนวันหยุดได้ ");}
								else{
									alert(swap2String("Can't Change"));
								}
							}*/
						//}else alert(msg);
					}else alert(MyCode[0]);
				}				
			}
			
			/* check condition is correct before submit form */
			function matchCondition(){
				with(document.cscform){
					if(__isHolidayOK.value == "true" && __isWorkdayOK.value == "true"){
						return true;
					}else{
						return false;
					}
				}
			}

			function chkAdjtime(){
				Tchholiday_dwr.chkChHoliday(new Array(document.cscform.__wf__employeeid.value,document.cscform.__wf__change_date2.value,document.cscform.__wf__change_date1.value),{callback:
					function(data){
						if(data){
							GoWF();
						}else{
							document.cscform.imgSubmit.style.display = "";
							document.cscform.__chkHoliday.value = false;
							var error_mes = "Can Not Change Holiday Because This Day is Request Leave or OT";
							if(document.cscform.__language.value == "tha"){ error_mes = "ไม่สามารถเปลี่ยนวันหยุดได้ เนื่องจากได้มีการลา หรือ มีการขอโอที ในวันดังกล่าวแล้ว";}
							alert(error_mes);
							return false;
						}
					},async:true});
			}
		
			function openHelp(){
				with( document.cscform ){
					window.open("../TA/HELP/Leave.pdf","Help","left=150,top=150,width=700,height=570,toolbar=no,status=yes,scrollbars=yes,resizable=yes");
				}
			}
		
			function goHelp(helpName,inputName,condition){
				with( document.cscform ){
					var helpReturn;
					var temp;
					if( inputName == "sendto" ){
						temp = __fixCon.value;
						//__fixCon.value="job='"+condition+"'";
						if( condition.indexOf(",") > -1 ){
							condition = condition.replace(/,/g,"','");
						}
						__fixCon.value="EMPLOYEEID IN ('"+condition+"')";
					 	helpReturn="wf_next_actor:EMPLOYEEID,sendto:MEMPLOYEE@FULLNAME";
						linkHelp_SendToReturn(helpName,helpReturn);
						__fixCon.value=temp;
					}else if( inputName == "cc" ){
						temp = __fixCon.value;
						helpReturn="wf_cc_actor:EMPLOYEEID,cc:MEMPLOYEE@FULLNAME";
						linkHelp_SendToReturn(helpName,helpReturn);
						__fixCon.value=temp;
					} else if(inputName=="__wf__employeeid"){
						temp = __fixCon.value;
						__fixCon.value = "<%=filters%>";
						helpReturn=inputName+":employeeid,MEMPLOYEE@FULLNAME,__wf__old_shift:time0";
						linkHelp_Return_CallFunction(helpName,helpReturn,"searchEmp");
						__fixCon.value=temp;						
					}else if( inputName=="__employeeid" ){
						temp = __fixCon.value;
						__fixCon.value = "";
						helpReturn="__employeeid:EMPLOYEEID,MEMPLOYEE@FULLNAME,emp_fullname:MEMPLOYEE.FULLNAME";
						linkHelp_Return(helpName,helpReturn);
						__fixCon.value=temp;
					}
				}
			}
			
			function linkHelp_SendToReturn(help,input){
				with( document.cscform ){
					var param = "BROWSE_USER.jsp?__helpName="+help+"&__helpReturn="+input+"&__pageCall="+__screen.value+"&__fixCon="+__fixCon.value+"&__checkVerify=off&__langOn=off";
					window.open(param,"Help","left=150,top=150,width=530,height=370,toolbar=no,status=yes,scrollbars=yes,resizable=yes");
				}
			}

			function linkHelp_Return(help,input){
				with( document.cscform ){
					var param="BROWSE_HELP.jsp?__helpName="+help+"&__helpReturn="+input+"&__pageCall="+__screen.value+"&__fixCon="+__fixCon.value+"&__checkVerify=off&__langOn=off";
					window.open(param,"Help","left=150,top=150,width=530,height=370,toolbar=no,status=yes,scrollbars=yes,resizable=yes");
				}
			}
			
			function linkHelp_Return_CallFunction(help,input,newFunction){
				with( document.cscform ){
					var param="BROWSE_TIMEHELP.jsp?__helpName="+help+"&__helpReturn="+input+"&__pageCall="+__screen.value+"&__fixCon="+__fixCon.value+"&__checkVerify=off&__langOn=off&__callFunction="+newFunction;
					window.open(param,"Help","left=150,top=150,width=530,height=370,toolbar=no,status=yes,scrollbars=yes,resizable=yes");
				}
			}
			
			function linkHelpWF(help,input){
				with(document.cscform){
					var temp = __fixCon.value;
					var fix = "wf_id='"+wf_id.value+"' and wf_ver='"+wf_ver.value+"' and initiator='<%=screenSingle.getUProfile().get("actor")%>' and (wf_status<>'6' and wf_status<>'3' and wf_status<>'8' and wf_status<>'A' and wf_status<>'B' and wf_status<>'')";
					var param="BROWSE_HELP.jsp?__helpName="+help+"&__fieldSearch="+input+"&__pageCall="+__screen.value+"&__fixCon="+fix;
					window.open(param,"Help","left=150,top=150,width=530,height=370,resizable=yes,scrollbars=yes,toolbar=no,status=yes");
					__fixCon.value = temp;
				}
			}
			
		function chk_Time(){
			var count=0;
				with( document.cscform ){
				for (j=0;j<elements.length; j++){
					if(elements[j].name.indexOf("__wf__change_date1") > -1){
						if(!isValidDate(elements[j].value)){
							count+=1;
							elements[j].focus();
							elements[j].select();
							break;
						}
					}
					if(elements[j].name.indexOf("__wf__change_date2") > -1){
						if(!isValidDate(elements[j].value)){
							count+=1;
							elements[j].focus();
							elements[j].select();
							break;
						}
					}
				}//for
				if(count>0){
					return false;
				}else{
					return true;
				}
			}
		}
		
		function chk_Time2(){	
			with(document.cscform){
				return dateDifference(eval("__wf__change_date1.value"),eval("__wf__change_date2.value"));
			}
		}
		
		function viewPages(helppage){
				 var  pam=helppage+".jsp?__fixCon=employeeid='<%= TEMPLATE_WORKFLOW.getUProfile().get("employeeid") %>'";
				window.open(pam,"Help","left=150,top=150,width=800,height=500,toolbar=no,status=yes,scrollbars=yes");
		}
		function goPages(helppage,welid,budid){	
			 var  pam=helppage+".jsp?__fixCon=welid='"+welid+"' and budyear = '"+budid+"' and employeeid='<%= TEMPLATE_WORKFLOW.getUProfile().get("employeeid") %>'";	
			window.open(pam,"Help","left=150,top=150,width=700,height=500,toolbar=no,status=yes,scrollbars=yes");
		}

		function goView() {
			with(document.cscform){
				Tchangeshift_nstda_dwr.getDWRData(new Array(__wf__employeeid.value,__wf__change_date1.value,__wf__change_date2.value,__wf__old_shift.value,__wf__change_date2.value),{callback:
					function(data){
						view.innerHTML=data;
					},async:true});
			}
		}

		function searchEmp(){
			//condition = " and employeeid in ("+document.cscform.__subordinate.value+")";
			condition ="";
			searchDescEmp(eval('document.cscform.__wf__employeeid'), 'memployee.fullname:MEMPLOYEE@FULLNAME,mposition.tdesc:__position,mbu1.tdesc:__bu1,mbu2.tdesc:__bu2,mbu3.tdesc:__bu3,mbu4.tdesc:__bu4,mbu5.tdesc:__bu5,memployee.startdate:__startdate,memployee.tel_ext:__tel_ext', condition);
			//realShift();
		}


		
		function chkIsHoliday(date, isBoolean){
			var imgSubmit = document.getElementById("imgSubmit");
			with(document.cscform){
				imgSubmit.style.display = "none";
				Tchangeshift_nstda_dwr.isHoliday(new Array(__wf__employeeid.value,date.value),{callback:
					function(data){
						if(data == isBoolean){
							imgSubmit.style.display = "";
							__wf__chkHoliday.value = true;
							
							/* update condition before submit */							
							if(isBoolean){
								__isHolidayOK.value = "true";
							}else{
								__isWorkdayOK.value = "true";
							}

							return true;
						}else{
							imgSubmit.style.display = "";
							__wf__chkHoliday.value = false;
							
							if(document.cscform.__language.value == "tha")
								{ alert("ไม่สามารถเปลี่ยนวันหยุดได้ ");}
							else{
								alert(swap2String("Can't Change"));
							}
							if(isBoolean){
								__isHolidayOK.value = "false";
							}else{
								__isWorkdayOK.value = "false";
							}
							return false;
						}
					},async:true});
			}
		}
		
		function setMailConfigWorkflow(){
				  with(document.cscform){
					  var date , month , year;
					  var now =  new Date();
					  date =  now.getDate();
					  month = now.getMonth()+1;
					  year = now.getFullYear();
					  date = (date <10)?('0'+date):date;
					  month = (month<10)?('0'+month):month;
		 	           __wf__start_doc_date.value = date+'/'+month+'/'+year;
					 // alert(__wf__start_doc_date.value );
				  }
			}
	
	//-->
		</SCRIPT>
		<script type="text/javascript" src="../JS/jquery-1.3.2.min.js"></script>
		<script type="text/javascript" >
			$(function(){
				$(".column-label").css("width","25%");
			});
		</script>
	</HEAD>
	<BODY>
	<jsp:include page="../MYNOTE_HEAD.jsp" flush="true"/>
	<div align="center">
	<!--<div align="center" name="wf_detail">-->
	<!-- ImageReady Slices (02.psd) -->
		<FORM NAME="cscform" METHOD="post" ACTION="TAU_CSCWF_018_Center.jsp">
			<INPUT TYPE="hidden" NAME="__screen" VALUE="TAU_CSCWF_018_Center">
			<INPUT TYPE="hidden" NAME="__cmd" VALUE="">
			<INPUT TYPE="hidden" NAME="__help" VALUE="">
			<INPUT TYPE="hidden" NAME="__fixCon" VALUE="">
			<INPUT TYPE="hidden" NAME="__notNull" VALUE="<%=screenSingle.getRequire()%>">
			<INPUT TYPE="hidden" NAME="__language" VALUE="<%=screenSingle.getUProfile().get("lang")%>">
			<INPUT TYPE="hidden" NAME="__companyid" VALUE="<%=screenSingle.getUProfile().get("companyid")%>">
			<INPUT TYPE="hidden" NAME="__calendar" VALUE="">
			
			<SCRIPT LANGUAGE="JavaScript">getInputFormatDate();</SCRIPT>

			<INPUT TYPE="hidden" NAME="wf_id" VALUE="8234">
			<INPUT TYPE="hidden" NAME="__wf_id" VALUE="8234">
			<INPUT TYPE="hidden" NAME="wf_ver" VALUE="<%=chkNull.chkNullString(request.getParameter("wf_ver"),"1")%>">
			<INPUT TYPE="hidden" NAME="__wf_ver" VALUE="<%=chkNull.chkNullString(request.getParameter("__wf_ver"),"1")%>">
			<INPUT TYPE="hidden" NAME="wf_seq_no" VALUE="<%=chkNull.chkNullString(request.getParameter("wf_seq_no"),"0")%>">
			<INPUT TYPE="hidden" NAME="step_id" VALUE="<%=chkNull.chkNullString(request.getParameter("step_id"),"0")%>">
			<INPUT TYPE="hidden" NAME="step_seq_no" VALUE="<%=chkNull.chkNullString(request.getParameter("step_seq_no"),"0")%>">
			<INPUT TYPE="hidden" NAME="wf_return_actor" VALUE="IINIT">
          <!--แก้ไข OldWF-->
          <input type="hidden" name="__oldDocumentID" value="<%=(!screenSingle.getDataLabel("DOC_NO").equals("0")?screenSingle.getDataLabel("DOC_NO"):chkNull.chkNullString(request.getParameter("__oldDocumentID"),"0"))%>">
		  <input type="hidden" name="__oldWF" value="<%=(!screenSingle.getDataLabel("DOC_NO").equals("0")?screenSingle.getDataLabel("WF_STATUS"):chkNull.chkNullString(request.getParameter("__oldWF"),"0"))%>">
       
			<INPUT TYPE="hidden" NAME="__wf" VALUE="<%=wf%>">
			<INPUT TYPE="hidden" NAME="__wfcmd" VALUE="false">		
			<INPUT TYPE="hidden" NAME="remark" VALUE="<%=remark%>">
			<INPUT TYPE="hidden" NAME="wf_default_actor" VALUE="true">

			<INPUT TYPE="hidden" NAME="draft_cmd" VALUE="">              
			<INPUT TYPE="hidden" NAME="draft_no" VALUE="<%=chkNull.chkNullString(request.getParameter("draft_no"),"0")%>">               
			<INPUT TYPE="hidden" NAME="admin_cmd" VALUE="">		
			<INPUT TYPE="hidden" NAME="__checkPage" VALUE="true">
			<INPUT TYPE="hidden" NAME="__wf__day_type" VALUE="T">
			
			<!-- Redirect Page -->
			 <INPUT TYPE="hidden" NAME="isAdminEdit" VALUE="<%=chkNull.chkNullString(request.getParameter("isAdminEdit"))%>">
			 <INPUT TYPE="hidden" NAME="isAdminCancel" VALUE="<%=chkNull.chkNullString(request.getParameter("isAdminCancel"))%>">
			 <INPUT TYPE="hidden" NAME="isAdminClean" VALUE="<%=chkNull.chkNullString(request.getParameter("isAdminClean"))%>">
			 <INPUT TYPE="hidden" NAME="isAdminDelete" VALUE="<%=chkNull.chkNullString(request.getParameter("isAdminDelete"))%>">

			<!-- used for checking condition is correct -->
			 <INPUT TYPE="hidden" NAME="__isHolidayOK" VALUE="<%=chkNull.chkNullString(request.getParameter("__isHolidayOK"))%>">
			 <INPUT TYPE="hidden" NAME="__isWorkdayOK" VALUE="<%=chkNull.chkNullString(request.getParameter("__isWorkdayOK"))%>">

			<%=screenSingle.InitialVariable()%>
			
			<DIV ID="toolTipLayer" STYLE="position:absolute; visibility: hidden"></DIV>
			<SCRIPT LANGUAGE="JavaScript">initToolTips();</SCRIPT>
			
			<TABLE WIDTH=950 BORDER=0 ALIGN="center" CELLPADDING=0 CELLSPACING=0 id="wrapper">
						<DIV ALIGN="right">
<%=md.getStepDocument("8234","1")%>
<%=md.getHeadDocument()%>
                      <br>
<%=md.getHelpDocument("WF8234")%>
                      <br>
<%=md.getSendToDocument("WF8234")%>
					  <br>					
					  <!-- Begin Code -->
							<TABLE WIDTH="95%" BORDER="0" ALIGN="center" CELLPADDING="0" CELLSPACING="0">
								<TR>
									<TD WIDTH="5" HEIGHT="5"><IMG SRC="../IMAGES/MYNOTE/C-T-L.gif" WIDTH="5" HEIGHT="5"></TD>
									<TD HEIGHT="5"><IMG SRC="../IMAGES/MYNOTE/T.gif" WIDTH="100%" HEIGHT="5"></TD>
									<TD WIDTH="5" HEIGHT="5"><IMG SRC="../IMAGES/MYNOTE/C-T-R.gif" WIDTH="5" HEIGHT="5"></TD>
								</TR>
								<TR>
									<TD WIDTH="5" BACKGROUND="../IMAGES/MYNOTE/L2.gif"></TD>
									<TD VALIGN="middle">
										<TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="1" CLASS="txt01">
										<!-- Begin User Code -->
											<INPUT TYPE="hidden" NAME="__wf__chholidayid" VALUE="0">
											<INPUT TYPE="hidden" NAME="__chkHoliday" VALUE="<%=chkNull.chkNullString(request.getParameter("__chkHoliday"),"false")%>" ID="__chkHoliday">
											<tr>
												<td colspan="2" class="column-title"><script language="javascript">swapLang('Employee Details')</script></td>
											</tr>
										  <tr>
										    <td width="25%"  class="column-label"><script language="javascript">swapLang('Employee Code')</script></td>
										    <INPUT TYPE="hidden" NAME="__subordinate" VALUE="<%=screenSingle.getUProfile().get("subordinateall")%>"><INPUT TYPE="hidden" NAME="list_shift" VALUE="<%=chkNull.chkNullString(request.getParameter("list_shift"))%>">
											<td width="75%" class="column-input"></span><input name="__wf__employeeid" type="text" value="<%= chkNull.chkNullString(request.getParameter("__wf__employeeid"),screenSingle.getUProfile().get("employeeid"))%>" size="15" onBlur="javascript:searchEmp();" readonly class="disabled">
											<%if(md.isStep1){%>
												 <A HREF="javascript:goHelp('MEMPLOYEEHELP2','__wf__employeeid');" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('image01','','../IMAGES/BUTTON/SWAP/SEARCH_SWAP20.gif',1)"> <IMG SRC="../IMAGES/BUTTON/MAIN/SEARCH20.gif" ALT="SEARCH" NAME="image01" WIDTH="20" HEIGHT="20" BORDER="0" ALIGN="absmiddle"></A>
											<%}%>
											<input name="MEMPLOYEE@FULLNAME" type="text" size="40" value="<%= chkNull.chkNullString(request.getParameter("MEMPLOYEE@FULLNAME"),"") %>" class="disabled" readonly>
											
											</td></tr>
										  <tr>
										    <td class="column-label"><script language="javascript">swapLang('Position')</script></td>
											<td class="column-input"><input type="text" name="__position" value="<%= chkNull.chkNullString(request.getParameter("__position"),"") %>" size="65" readonly class="disabled"></td></tr>
										  <tr>
										    <td class="column-label"><script language="javascript">swapLang('Business Unit 1')</script></td>
											<td class="column-input"><input type="text" name="__bu1" value="<%= chkNull.chkNullString(request.getParameter("__bu1"),"") %>" size="65" readonly class="disabled"></td></tr>
										  <tr>
										    <td class="column-label"><script language="javascript">swapLang('Business Unit 2')</script></td>
											<td class="column-input"><input type="text" name="__bu2" value="<%= chkNull.chkNullString(request.getParameter("__bu2"),"") %>" size="65" readonly class="disabled"></td></tr>
										  <tr>
										    <td class="column-label"><script language="javascript">swapLang('Business Unit 3')</script></td>
											<td class="column-input"><input type="text" name="__bu3" value="<%= chkNull.chkNullString(request.getParameter("__bu3"),"") %>" size="65" readonly class="disabled"></td></tr>
										  <tr>
										    <td class="column-label"><script language="javascript">swapLang('Business Unit 4')</script></td>
											<td class="column-input"><input type="text" name="__bu4" value="<%= chkNull.chkNullString(request.getParameter("__bu4"),"") %>" size="65" readonly class="disabled"></td></tr>
										  <tr>
										    <td class="column-label"><script language="javascript">swapLang('Business Unit 5')</script></td>
											<td class="column-input">
											<input type="text" name="__bu5" value="<%= chkNull.chkNullString(request.getParameter("__bu5"),"") %>" size="65" readonly class="disabled"></td>
											</tr>
											<input type="hidden" name="__startdate" value="<%= chkNull.chkNullString(request.getParameter("__startdate"),"") %>">
											<input type="hidden" name="__tel_ext" value="<%= chkNull.chkNullString(request.getParameter("__tel_ext"),"") %>" >																  										  
                                                                                    <tr>
                                                                                        <td colspan="2" class="column-title" ><script language="javascript">swapLang('Change Day Off Details')</script></td>
                                                                                    </tr>
                                                                                    <tr>
											<td class="column-label"><script language="javascript">swapLang('Day Off')</script></td>
											<td CLASS="column-input"><input type="text" size="10" name="__wf__dateid" id="__wf__dateid" maxlength=10 value="<%=chkNull.chkNullString(request.getParameter("__wf__dateid"), new CscCalendar().getDDMMYYYY()) %>" class="txt01" onKeyup = "formatDate(this)" onKeypress = "chkIntegerOfDate(this.value)" onBlur = "chkInputDate(this);">&nbsp;<%if(md.isStep1){%><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('chdate2','','../IMAGES/BUTTON/SWAP/CALENDAR_SWAP20.gif',1)"><img src="../IMAGES/BUTTON/MAIN/CALENDAR20.gif" alt="Calendar" name="chdate2" width="20"  border="0" align="absmiddle" id="Image1312" onClick="viewCal('__wf__dateid')"></a><% } %></td>
                                                                                    </tr>
                                                                                    <tr>
											<td class="column-label"><script language="javascript">swapLang('Posting Type')</script></td>
											<td CLASS="column-input">
                                                                                            <input type="radio" name="__wf__format_type" value="0" swlang code="SW011666" checked> Full Day
                                                                                            <input type="radio" name="__wf__format_type" value="2" swlang code="SW011613"> First Half
                                                                                            <input type="radio" name="__wf__format_type" value="3" swlang code="SW011614"> Second Half
                                                                                        </td>
                                                                                    </tr>
                                                                                    <tr>
                                                                                        <td class="column-label"><script language="javascript">swapLang('Reason')</script></td>
                                                                                        <td class="column-input"><textarea name="__wf__remarks" rows="5" cols="70"><%=chkNull.chkNullString(request.getParameter("__wf__remarks"))%></textarea></td>
                                                                                    </tr>
											<%=md.getWF_Remark("8234",screenSingle.getUProfile().get("companyid"))%>
                                         <!--                                           
										<TR BGCOLOR=#EFEFEF>
                                                                                    <td class="column-label"><script language="javascript">swapLang("Priority");</SCRIPT></TD>
										    <TD BGCOLOR="#EFEFEF">
                                                                                        <INPUT TYPE="radio" NAME="priority" VALUE="0"><SCRIPT LANGUAGE="JavaScript">swapLang("Normal")</SCRIPT>
                                                                                        <INPUT TYPE="radio" NAME="priority" VALUE="1"><SCRIPT LANGUAGE="JavaScript">swapLang("High")</SCRIPT>
                                                                                    </TD>
                                                                                </TR>  -->

										<input type="hidden" name="priority" value="0">
										<!-- End User Code -->
										</TABLE>
									</FONT></TD>
									<TD WIDTH="5" BACKGROUND="../IMAGES/MYNOTE/R2.gif"></TD>
								</TR>
								<TR>
									<TD WIDTH="5" HEIGHT="5"><IMG SRC="../IMAGES/MYNOTE/C-B-L.gif" WIDTH="5" HEIGHT="5"></TD>
									<TD HEIGHT="5"><IMG SRC="../IMAGES/MYNOTE/B.gif" WIDTH="100%" HEIGHT="5"></TD>
									<TD WIDTH="5" HEIGHT="5"><IMG SRC="../IMAGES/MYNOTE/C-B-R.gif" WIDTH="5" HEIGHT="5"></TD>
								</TR>
							</TABLE>

						<!-- End Code -->
					  <br>
<%=md.getRemarkDocument()%>
                      <br>
<%=md.getWorkflowCommandDocument()%>
					<br>
<%=md.getReferenceNoteDocument()%>
					<br>
<%=md.getAttachFileDocument()%>
					<br>
					<!-- Begin Workflow Button -->
           				<%
           				if( !md.isStep3 ){
           				%>
           					<TABLE WIDTH="95%" BORDER="0" ALIGN="center" CELLPADDING="0" CELLSPACING="0">
           						<TR>
           				<%
           						if( md.isStep1 || md.isDraft){
           				%>
           							<TD><DIV ALIGN="right">
<!--                                     <A HREF="JavaScript:SaveDraft();">
                                    <IMG SRC="../IMAGES/MYNOTE/BUTTON/BUTTON_SAVE.gif" WIDTH="89" HEIGHT="37" BORDER="0"></A>
						<%   //   if( md.isDraft ){%>
									<A HREF="JavaScript:DelDraft();">
                                    <IMG SRC="../IMAGES/MYNOTE/BUTTON/BUTTON_CANCEL.gif" WIDTH="89" HEIGHT="37" BORDER="0"></A> -->
						<%		//}%>
									<A HREF="JavaScript:preGoWF();">
									<IMG SRC="../IMAGES/MYNOTE/BUTTON/BUTTON_SUBMIT.gif" WIDTH="89" HEIGHT="37" BORDER="0" ID="imgSubmit"></A></DIV></TD>
           				<%
           						}else if( md.isStepCancel || md.isAdminCancel ){
           				%>
           							<TD><DIV ALIGN="right"><A HREF="JavaScript:DelWF();"><IMG SRC="../IMAGES/MYNOTE/BUTTON/BUTTON_CANCEL.gif" WIDTH="89" HEIGHT="37" BORDER="0"></A></DIV></TD>
           				<%
           						}else if( md.isStep2 || md.isStepComment ){
           				%>
           							<TD><DIV ALIGN="right"><A HREF="JavaScript:GoWF();"><IMG SRC="../IMAGES/MYNOTE/BUTTON/BUTTON_SUBMIT.gif" WIDTH="89" HEIGHT="37" BORDER="0"></A></DIV></TD>
           				<%
           						}else if( md.isStepReturn ){
           				%>
           							<TD><DIV ALIGN="right"><A HREF="JavaScript:EditWF();"><IMG SRC="../IMAGES/MYNOTE/BUTTON/BUTTON_EDIT.gif" WIDTH="89" HEIGHT="37" BORDER="0"></A><A HREF="JavaScript:DelWF();"><IMG SRC="../IMAGES/MYNOTE/BUTTON/BUTTON_CANCEL.gif" WIDTH="89" HEIGHT="37" BORDER="0"></A></DIV></TD>
           				<%
           						}else if( md.isStepCopy ){
           				%>
           							<TD><DIV ALIGN="right"><A HREF="JavaScript:CopyWF();"><IMG SRC="../IMAGES/MYNOTE/BUTTON/BUTTON_EDIT.gif" WIDTH="89" HEIGHT="37" BORDER="0"></A></DIV></TD>
           				<%
           						}else if( md.isAdminEdit ){
           				%>
									<TD><DIV ALIGN="right"><A HREF="JavaScript:AdminEditWF();"><IMG SRC="../IMAGES/MYNOTE/BUTTON/BUTTON_SAVE.gif" WIDTH="89" HEIGHT="37" BORDER="0"></A></DIV></TD>
						<%
           						}else if( md.isAdminDelete ){
           				%>
									<TD><DIV ALIGN="right"><A HREF="JavaScript:AdminDeleteWF();"><IMG SRC="../IMAGES/MYNOTE/BUTTON/BUTTON_DELETE.gif" WIDTH="89" HEIGHT="37" BORDER="0"></A></DIV></TD>
						<%
           						}else if( md.isAdminClean ){
           				%>
									<TD><DIV ALIGN="right"><A HREF="JavaScript:AdminCleanWF();"><IMG SRC="../IMAGES/MYNOTE/BUTTON/BUTTON_CLEAN.gif" WIDTH="89" HEIGHT="37" BORDER="0"></A></DIV></TD>
						<%
           						}
           				%>
           			
           						</TR>
           					</TABLE>
							<%}%>
           					<BR>
           				<!-- End Workflow Button -->
					<br>
<%=md.getRoutingDocument()%>
					<br>
<%=md.getCommentDocument()%>
<!-- Begin Set Value -->
           				<%
           			
           				if( md.isStep1 ){
           				%>
           					<!-- Begin Set Value Step1 -->
           					<SCRIPT LANGUAGE="JavaScript">
								setValue('priority','<%=chkNull.chkNullString(request.getParameter("priority"),"0")%>');
								searchEmp();

           					</SCRIPT>
           					<!-- End Set Value Step1 -->
           				<%
           				}else if(md.isStep2 || md.isStepCancel || md.isStepComment || md.isStepReturn || md.isStepCopy || md.isDraft){
           				%>
           					<!-- Begin Set Value Step2 -->
           					<SCRIPT LANGUAGE="JavaScript">
								hideSendTo('<%=step_type%>');
								dwr.util.setValue("__wf__employeeid",'<%=md.getWFDataValue("__wf__employeeid")%>');
								dwr.util.setValue("__wf__dateid",'<%=md.getWFDataValue("__wf__dateid")%>');
								dwr.util.setValue("__wf__format_type",'<%=md.getWFDataValue("__wf__format_type")%>');
								dwr.util.setValue("__wf__remarks",'<%=md.getWFDataValue("__wf__remarks")%>');
								searchDescEmp(document.cscform.__wf__employeeid,  'memployee.fullname:MEMPLOYEE@FULLNAME,mposition.tdesc:__position,mbu1.tdesc:__bu1,mbu2.tdesc:__bu2,mbu3.tdesc:__bu3,mbu4.tdesc:__bu4,mbu5.tdesc:__bu5,memployee.startdate:__startdate,memployee.tel_ext:__tel_ext', "");

								setValue('priority','<%=screenSingle.getDataLabel("VW_INCIDENT","PRIORITY")%>');
								<%
									if(!md.isDraft){
								%>
								setDisabled(true);
								<%
								}else{
								%>
									setValue('__checkPage','false');
								<%
									}
								%>
           					</SCRIPT>
           					<!-- End Set Value Step2 -->
           				<%
           				}else if(md.isStep3 || md.isAdminEdit || md.isAdminCancel || md.isAdminDelete || md.isAdminClean || md.isArchive){
           				%>
           					<!-- Begin Set Value Step3 -->
           					<SCRIPT LANGUAGE="JavaScript">
								dwr.util.setValue("__wf__employeeid",'<%=md.getWFDataValue("__wf__employeeid")%>');
								dwr.util.setValue("__wf__dateid",'<%=md.getWFDataValue("__wf__dateid")%>');
								dwr.util.setValue("__wf__format_type",'<%=md.getWFDataValue("__wf__format_type")%>');
								dwr.util.setValue("__wf__remarks",'<%=md.getWFDataValue("__wf__remarks")%>');
								searchDescEmp(document.cscform.__wf__employeeid,  'memployee.fullname:MEMPLOYEE@FULLNAME,mposition.tdesc:__position,mbu1.tdesc:__bu1,mbu2.tdesc:__bu2,mbu3.tdesc:__bu3,mbu4.tdesc:__bu4,mbu5.tdesc:__bu5,memployee.startdate:__startdate,memployee.tel_ext:__tel_ext', "");
								setValue('__checkPage','false');
								setValue('priority','<%=screenSingle.getDataLabel("VW_INCIDENT","PRIORITY")%>');
								<%
									if(!md.isAdminEdit){
								%>
								setDisabled(true);
								<%
								}
								%>
           					</SCRIPT>
           					<!-- End Set Value Step3 -->
           				<%
           				}
           				%>
           				<!-- End Set Value -->
						</DIV>
					</TD>
					<TD VALIGN="top" BACKGROUND="../IMAGES/MYNOTE/BPM_07.jpg">&nbsp;</TD>
				</TR>
				<TR>
					<TD COLSPAN="2" HEIGHT="20" BACKGROUND="../IMAGES/MYNOTE/BPM_09.jpg"><DIV ALIGN="center"><SPAN CLASS="txt02">&nbsp;</SPAN></DIV></TD>
				</TR>
			</TABLE>
             <INPUT TYPE="hidden" NAME="__wf__chkHoliday" ID ="__wf__chkHoliday" VALUE="<%=(!md.getWFDataValue("__wf__chkHoliday").equals(""))?md.getWFDataValue("__wf__chkHoliday"):chkNull.chkNullString(request.getParameter("__wf__chkHoliday"),"false")%>">
            <INPUT TYPE="hidden" NAME="__wf__start_doc_date" ID ="__wf__start_doc_date" VALUE="<%=(!md.getWFDataValue("__wf__start_doc_date").equals(""))?md.getWFDataValue("__wf__start_doc_date"):request.getParameter("__wf__start_doc_date")%>">
			<%=screenSingle.endJSP()%>
		</FORM>
	</BODY>
	</div>
</HTML>
<%
}
%>