<%@page contentType="text/html; charset=UTF-8"%>
<%@page import="com.csc.library.entry.HelpEntry,com.csc.library.system.*,com.csc.library.utilities.*"%>
<%@ page import="com.csc.library.entry.*,com.csc.library.database.*,com.csc.library.session.*"  %>
<%@ page import="com.csc.library.databean.*"  %>
<jsp:useBean id="TRA02525_PHATRA" class="com.csc.library.system.Task" scope="page"/>
<%
	TRA02525_PHATRA.setChannel(request,response);
	UIManager screen = (UIManager)TRA02525_PHATRA.process("MultiEntry","TRA0252_PHATRA",true);
	CheckNull chk = new CheckNull();
	CscCalendar date1 = new CscCalendar();

	String trainDateSearch = chk.chkNullString(request.getParameter("__trainDateSearch"));
	MultiLine multi = screen.getMultiLine("TTRAINEETIME");

	DbInquiry dbtime = (DbInquiry) screen.getRecord().getChild("TTRAININGTIME");
	screen.referLangOn();
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html ng-app="myHR">
<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/MISC.js'></script>
<script type='text/javascript' src='../JS/SCREEN.js'></script>
<script src="../JS/angular-1.3.15/angular.js" type="text/javascript"></script>
<script src="../JS/ANGULAR/SCREEN_ANGULAR.js" type="text/javascript"></script>
<script type='text/javascript' src='../JS/ICONSMENU.js'></script>

<script language='javascript'>setLang('<%=screen.getUProfile().get("lang")%>');</script>
<script  type='text/javascript'  src="../JS/VIEWCALENDAR.js"></script>
<script language="JavaScript" >
function goSave(){confirmSave();}
function goSearch(){search();}
function goDelete(){edelete();}
function goUpdate(){update();}
function checkCF() {checkConfirm();}

function childMulti(record,traineeid,traindate){
	with(document.cscform){
	 window.open(__childMulti.value+".jsp?__cmd=&__gorec="+record+"&__ack=edit"+
	 		"&__traineeid="+traineeid+
			"&__traindate="+traindate+
			"&__fixDate="+__fixDate.value+
			"&__trainingid="+window.parent.document.forms[0].__trainingid.value+
			"&__headMulti="+cscform.__screen.value+
			"&__companyid="+window.parent.cscform.__companyid.value,"TraineeTime","left=150,top=150,width=700,height=280,toolbar=no,status=yes,scrollbars=yes,resizable=yes");
	 	}
}
function addMulti(){
	if(window.parent.document.forms[0].__trainingid.value==""){
		alert("กรุณาเลือกเลขที่เอกสารก่อน");
	}else{
		with(document.cscform){
			 window.open(__childMulti.value+".jsp?__cmd=&__gorec=&__ack=add"+
			 "&__RecNo="+__maxrec.value+
			 "&__trainingid="+window.parent.document.forms[0].__trainingid.value+
			  "&__headMulti="+cscform.__screen.value+
			  "&__companyid="+window.parent.cscform.__companyid.value,"Trainresponse","left=150,top=150,width=700,height=280,toolbar=no,status=no,scrollbars=yes,resizable=yes");
		}
	}
}

function deleteMulti(){
	with(document.cscform){
      bCon=confirm("ต้องการลบข้อมูลหรือไม่ ?");
		if (bCon==true){	
			__cmd.value="DelChild";
			submit();
		}	
	}
}
	function chkTrain(){												
		with(document.cscform){
			for(i=0;i<elements.length;i++){
					elements[i].checked=false;
			}
		}
	}
	function deleteRec(){											
		var  recDelete = "";
		with(window.document.cscform){
			bCon=confirm(MyCode[4]);
			if (bCon==true){			
				for(i=0;i<elements.length;i++){
					if(elements[i].type=="checkbox"&&elements[i].name!="listmail"){
						if (elements[i].checked==true){
							recDelete = recDelete+ "#"+elements[i].value;	               	
						}
					}
				}		
				__reccordDelete.value=recDelete;		
				__cmd.value="save";
				__confirm.value="s";
				submit();
			}
		}
	}
	function checkupdate(){										
	with(document.cscform){
		for(i=0;i<elements.length;i++){
					if(elements[i].name.indexOf("$")>-1){
						if(elements[i].value==""){
							alert(MyCode[26]);
							break;				
						}else{
							update();
							break;
						}
					}
		}
	}
}
function goSearchDate(){
	with(document.cscform){			
			setFixDate();
			submit();
	}
	
}
function setFixDate(){
	with(document.cscform){
		if(__traindate.options[__traindate.selectedIndex].value!=""){
			__trainDateSearch.value = __traindate.options[__traindate.selectedIndex].value;
			__fixDate.value = __traindate.options[__traindate.selectedIndex].value;
		}else{
			__trainDateSearch.value = "";
			__fixDate.value = "";
		}
	}
}
function setChkBoxValue(line){
	with(document.cscform){
		staTime = eval("__TTRAINEETIME$STATUS$"+line);
		chkBox = eval("chk$"+line);
		if(chkBox.checked){
			staTime.value = "1";
		}else{
			staTime.value = "0";
		}
	}
}
function checkAll(){
	with(document.cscform){
		for(i=0;i<elements.length;i++){
			if(elements[i].type=="checkbox"&&elements[i].name!="listmail"){
				elements[i].checked=true;
				staTime = eval("__TTRAINEETIME$STATUS$"+elements[i].value);
				staTime.value = "1";
			}
		}
		setTypeMail("0");
	}
}
function decheckAll(){
	with(document.cscform){
		for(i=0;i<elements.length;i++){
			if(elements[i].type=="checkbox"&&elements[i].name!="listmail"){
				elements[i].checked=false;
				staTime = eval("__TTRAINEETIME$STATUS$"+elements[i].value);
				staTime.value = "0";
			}
		}
		setTypeMail("1");
	}
}
function setTypeMail(type){
	with(document.cscform){ //0 สาย 1ขาด 
		if(typeof listmail!="undefined"){
				if(typeof listmail.length=="undefined"){
					listmail.value = type;
				}else{
					for(i=0;i<listmail.length;i++){
						listmail[i].value = type;
					}
				}
		}
	}
}
function getAllDate(){
	if(getLang()=="tha"){
		document.write("ทั้งหมด");
	}else{
		document.write("all date");
	}
}
function refreshMyPage(){
	with(document.cscform){
		__chkDefault.value = "chk"
		submit();	
	}
}
	function sendMail() {
		var emp_id = "";
		with(document.cscform){
			if(typeof listmail!="undefined"){
				if(typeof listmail.length!="undefined"){
					for(i=0;i<listmail.length;i++){
						if(listmail[i].checked&&listmail[i].value!=""){
							if(emp_id!=""){
								emp_id += ",";
							}
							emp_id += listmail[i].id+"$"+listmail[i].value;
						}
					}
				}else{
					if(listmail.checked&&listmail.value!=""){
						emp_id += listmail.id+"$"+listmail.value;
					}
				}
			}
		}
		if(emp_id!=""){
			var user = '<%=screen.getUProfile().getUserId()%>';
			var crs = '<%=screen.getDataLabel("MCOURSE","CRSDESC")%>';
			var trnid = '<%=screen.getDataLabel("TRAININGID")%>';
			var trn = '<%=screen.getDataLabel("TRTITLE")%>';
			var sttime = '<%=screen.getDataLabel("TIMESTART")%>';
			var entime = '<%=screen.getDataLabel("TIMESTOP")%>';
			var loc = '<%=screen.getDataLabel("MTRLOCATION","LOCDESC")%>';
			window.open("TRA02525M_PHATRA.jsp?emp_id="+emp_id+"&crs="+crs+"&trn="+trn+"&trnid="+trnid+"&sttime="+sttime+"&entime="+entime+"&loc="+loc+"&tmp_date="+document.cscform.__tmpDate.value+"&__language="+document.cscform.__language.value+"&__companyid="+document.cscform.__companyid.value+"&__user="+user,"mail","left=150,top=20,width=650,height=350,toolbar=no,status=yes,scrollbars=yes,resizable=yes");
		}else{
			if(getLang()=="tha"){
				alert("ไม่มีอีเมล์ที่จะส่ง");
			}else{
				alert("not have email for send.");
			}
		}
	}
	function setTypeMyMail(chkb2,chkb1){
		if(chkb1.checked){
			chkb2.value = "1";
		}else{
			chkb2.value = "0";
		}
	}
	function setTypeMyMail2(chkb1,chkbid){
		if(chkb1.checked){
			document.getElementById(chkbid).value = "1";
		}else{
			document.getElementById(chkbid).value = "0";
		}
	}
	function chkTimeOver(time,maxhour,minhour){
		var hour;
		if(time.value!=""&&time.value!=0){
			if(time.value.length<3){
				alert(MyCode[153]); time.value = "0.00"; time.select();
			}else{
				if(parseInt(time.value.substring((time.value.length-2),time.value.length))>=60){
					alert(MyCode[154] + " <= 59"); time.value = "0.00"; time.select();
				}else{
					hour = parseFloat(time.value.substring(0,(time.value.length-2)));
					time.value = ""+parseFloat(time.value.substring(0,(time.value.length-2)))+"."+time.value.substring((time.value.length-2),time.value.length);
					if(hour > maxhour){
						alert(MyCode[155] + " <= "+maxhour); time.value = "0.00"; time.select();
					}else{
						if(hour < minhour){
						alert(MyCode[155] + " >= "+minhour); time.value = "0.00"; time.select();
						}else{
							if(time.name=="__start_time"){
								document.cscform.__timebreak.select();
							}
						}
					}
				}
			}
		}else{
			time.value = "0.00";
		}
	}
	function chkFreeTime(tar,start,stop){
		with(document.cscform){
			var tmp = parseFloat(stop.value) - parseFloat(start.value);
			if(parseFloat(tar.value)>=tmp){
				if(getLang()=="tha"){
					alert("เวลาพักมากกว่า หรือ เท่ากับชั่วโมงอบรม กรุณาตรวจสอบเวลาเริ่ม - สิ้นสุด");
				}else{
					alert("Relax Time is morethan or equals Train Time. Please Check Start Time - End Time.");
				}
				tar.value = "0.00";
			}else{
				calTwoTime_Break(__start_time,__end_time,__t_hour,__timebreak);
			}
		}
	}
	function calTwoTime_Break(time1,time2,ttime,bt){
		if(time1.value!=""&&time2.value!=""){
			if(parseFloat(time1.value)<=parseFloat(time2.value)){
				var tmp = time1.value.split(".");
				var tm1 = (tmp[0]*60)+parseInt(tmp[1]);
					tmp = time2.value.split(".");
				var tm2 = (tmp[0]*60)+parseInt(tmp[1]);
					tmp = bt.value.split(".");
				var tm3 = (tmp[0]*60)+parseInt(tmp[1]);
				var total = (tm2 - tm1)-tm3;
				var tmpMin = (total%60)+"";
				if(tmpMin.length<2){tmpMin = "0"+tmpMin;}
				var tmpMax = parseInt((total/60))+"";
				ttime.value = tmpMax+"."+tmpMin;
			}else{ttime.value = "0.00";}
		}else{
			ttime.value = "0.00";
		}
		if(parseFloat(ttime.value)<0.00){
			ttime.value  =  "0.00";
		}
	}
	function updateAmount(total){
		with(window.parent.document.cscform){
			__neeTimeCount.value = total;
		}
	}
	function genTrneeTime(){
		with(document.cscform){
			if(window.parent.document.cscform.__recTTime.value>0){
				with(document.cscform){
					//window.parent.restTabPages();
					__isgen.value = "1";
					__cmd.value = "ack";
					submit();
				}
			}else{
				if(getLang()=="tha"){
					//alert("ไม่สามารถทำแบบบันทึกวันเวลาเข้าอบรมของพนักงานได้\nกรุณาเพิ่มข้อมูลของวันที่และเวลาการอบรมของรุ่น "+__crsid.value);
					alert("ไม่สามารถทำแบบบันทึกวันเวลาเข้าอบรมของพนักงานได้\nกรุณาเพิ่มข้อมูลของวันที่และเวลาการอบรมของรุ่น ");
				}else{
					//alert("   con't generate form training time   \nplease insert date and time for trainingid "+__crsid.value)
					alert("Can not generate Employee training record   \nplease insert date and time of trainingid ");
				}
			}
		}
	}
</script>
<%
	String tmpDate = "";
	String tmpD[];
	tmpD = screen.getDataLabel("CLASSDATEFRM").split("-");
	date1.setDate(tmpD[2]+"-"+tmpD[1]+"-"+tmpD[0]);
	if(screen.getUProfile().get("lang").equals("tha")){
			tmpDate = date1.getDDThaiYYYY();
	}else{
			tmpDate = date1.getDDThaiYYYY();
	}
	if(!screen.getDataLabel("CLASSDATEFRM").equals(screen.getDataLabel("CLASSDATETO"))){
		tmpD = screen.getDataLabel("CLASSDATETO").split("-");
		date1.setDate(tmpD[2]+"-"+tmpD[1]+"-"+tmpD[0]);
		if(screen.getUProfile().get("lang").equals("tha")){
			tmpDate += " ถึงวันที่ "+date1.getDDThaiYYYY();
		}else{
			tmpDate += " to "+date1.getDDThaiYYYY();
		}
	}
%>
</head>
<body  leftmargin="0" topmargin="0"  onLoad="MM_preloadImages('addswap.gif','editswap.gif','deleteswap.gif','helpmenuswap.gif','exitswap.gif','searchmenuswap.gif','../IMAGES/BUTTON/SWAP/SEARCH_SWAP20.gif')" >
<div id="toolTipLayer" style="position:absolute; visibility: hidden"></div>
<script language="javascript">initToolTips();</script>
<form name="cscform" method="post" action="?">
 

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

<%=screen.InitialVariable()%>

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

  <input type="hidden" name="__cmd" value="ack">
  <input type="hidden" name="__screen" value="TRA0252_PHATRA">
  <input type="hidden" name="__childMulti" value="TRA02525E_PHATRA">
  <input type="hidden" name="__help" value="">
  <input type="hidden" name="__gorec" value="">
  <input type="hidden" name="__ack" value="">
  <input type="hidden" name="__fixDate" value="<%=chk.chkNullString(request.getParameter("__fixDate"))%>">
  <input type="hidden" name="__trainDateSearch" value="<%=chk.chkNullString(request.getParameter("__trainDateSearch"))%>">
  <input type="hidden" name="__childFilter" value="">
  <input type="hidden" name="__trainingid" value="<%=screen.getDataLabel("trainingid")%>">
  <input type="hidden" name="__multiTable" value="TTRAINEETIME">
  <input type="hidden" name="__companyid" value="<%=screen.getUProfile().get("companyid")%>">
  <input type="hidden" name="__language" value="<%=screen.getUProfile().get("lang")%>">
  <input type="hidden" name="__notNull"  value="<%=screen.getRequire()%>">
  <input type="hidden" name="__fixCon" value="">
  <input type="hidden" name="__confirm" value="0">
  <input type="hidden" name="__chkDefault" value="">
  <input type="hidden" name="__tmpMail" value="">
  <input type="hidden" name="__tmp_head" value="">
  <input type="hidden" name="__listmail" value="">
  <input type="hidden" name="__tmpDate" value="<%=tmpDate%>">

  <input type="hidden" name="__isgen" value="0">
  <table border="0" cellpadding="0" cellspacing="0" bordercolor="#3366CC" class="maxsize">
	<tr > 
      <td class="header">TRA02525_PHATRA, 
          <script language="javascript">swapLang('To record training time of Trainee');</script>
          &nbsp;</td>
    </tr>
	<tr> 
      <td  class="blankspace"></td>
    </tr>
	<tr>
      <td>
	  	<table cellpadding="0" cellspacing="0" class="maxsize">
			<tr>
				<td width = "80%" align = "right"><%=multi.getLabel("TTRAINEETIME","TRAINDATE")%>&nbsp;
					<select name="__traindate">
						<option value="" <%=(trainDateSearch.equals(""))?"selected":""%> ><script language="javascript">getAllDate();</script></option>
						<%
							dbtime.refresh();
							if(dbtime.recCount()>0){
								while(dbtime.next()){	
						%>
							<option value="<%=dbtime.getCurrentDbRecord().getCscCalendar("start_date").getDDMMYYYY()%>" <%=(trainDateSearch.equals(dbtime.getString("start_date")))?"selected":""%> >
								<%=dbtime.getCurrentDbRecord().getCscCalendar("start_date").getDDMMYYYY()+" : "+dbtime.getString("start_time")+"-"+dbtime.getString("end_time")%>
							</option>
						<%
								}
							}
						%>
					</select>
				</td>



					<td align = "left">&nbsp;&nbsp;
						<button type="button" class="btn btn-primary width100" swlang code="SW013170" onClick="goSearchDate();">VIEW</button>&nbsp;
						<button type="button" class="btn btn-primary width100" swlang code="SW013260" onClick="genTrneeTime();">BACK</button>
					</div>
					</td>
				</tr>
			<tr> 
				<td  class="blankspace" colspan = "2"></td>
		    </tr>
		 </table>
		 <table border="0" cellpadding="0" cellspacing="1" id="rsTable" name="rsTable" bgcolor="#333333" class="maxsize tablewithborder" cols="10">
          <tr align="center">
			<td class="row3" width = "10%"><a href="javascript:sortTable(0, rsTable);"><script language="JavaScript">swapLang('Date');</script></a></td>
            <td class="row3" width = "5%"><%=multi.getLabel("TTRAINEETIME","STATUS")%></td>
            <td class="row3" width = "12%"><a href="javascript:sortTable(1, rsTable);"><%=multi.getLabel("TTRAINEETIME","TRAINEEID")%></a></td>
            <td class="row3" width = "25%"><script language="JavaScript">swapLang('Name Surname');</script></td>
            <td class="row3" width = "10%"><%=multi.getLabel("TTRAINEETIME","START_TIME")%></td>
            <td class="row3" width = "10%"><%=multi.getLabel("TTRAINEETIME","END_TIME")%></td>
            <td class="row3" width = "10%"><%=multi.getLabel("TTRAINEETIME","TIMEBREAK")%></td>
            <td class="row3" width = "8%"><%=multi.getLabel("TTRAINEETIME","T_HOUR")%></td>
            <td class="row3" width = "10%"><%=multi.getLabel("TTRAINEETIME","REMARK")%></td>
			<td nowrap width="6%" class="row3"><div align="center"><script language='javascript'>swapLang('Send to');</script></a></div></td>
          </tr>
			<%	
				String isgen = chk.chkNullString(request.getParameter("__isgen"));
				if(isgen.equals("1")){
					Simttraining training = (Simttraining)screen.getRecord("Ttraining");
					training.genTraineeTime();
				}
				 String fixDate = chk.chkNullString(request.getParameter("__fixDate"));
				 int total = screen.getTable("TTRAINEETIME").recCount();
				 multi.goFirst();
				 int amount = 0;
		  		 for(;!multi.eof();amount++){
					 multi.getTable().referLangOn();
					 if(fixDate.equals("")){			
							%>
							 <tr align="center"> 
								<td class="inframe"><div align = "center"><%=multi.getData("TRAINDATE")%></div></td>
								<td class="inframe"><div align = "center">
									<input name="__TTRAINEETIME$STATUS$<%=multi.getDataLabel("line_no")%>" type="hidden" value = "<%=multi.getDataLabel("STATUS")%>">
									<input name="chk$<%=multi.getDataLabel("line_no")%>" type="checkbox" <%=(multi.getDataLabel("STATUS").equals("1"))?"checked":""%> onclick = "setChkBoxValue('<%=multi.getDataLabel("line_no")%>');setTypeMyMail2(this,'<%=multi.getData("TRAINEEID")%>$<%=multi.getData("TRAINDATE")%>');"  value="<%=multi.getDataLabel("line_no")%>">
								</div></td>
								<td class="inframe"><div align = "center"><%=multi.getDataLabel("TRAINEEID")%></div></td>
								<td class="inframe"><div align = "left">&nbsp;<%=multi.getDataLabel("V3MPREFIX","TDESC")+multi.getDataLabel("V3MEMPLOYEE","FNAME")+"  "+multi.getDataLabel("V3MEMPLOYEE","LNAME")%></div></td>
								<td class="inframe"><div align = "center"><INPUT TYPE='text' Name='__TTRAINEETIME$START_TIME$<%=multi.getDataLabel("line_no")%>' SIZE='5' MAXLENGTH='4' VALUE='<%=multi.getDataLabel("START_TIME")%>'  onClick="" onChange="" onKeyPress="chkInteger();" onKeyUp="sysIsEdit();" dir="" onBlur="chkTimeOver(this,23,0);chkTwoTime(this,__TTRAINEETIME$END_TIME$<%=multi.getDataLabel("line_no")%>,1);calTwoTime_Break(this,__TTRAINEETIME$END_TIME$<%=multi.getDataLabel("line_no")%>,__TTRAINEETIME$T_HOUR$<%=multi.getDataLabel("line_no")%>,__TTRAINEETIME$TIMEBREAK$<%=multi.getDataLabel("line_no")%>);" onFocus="delDot(this);" class="numeric"  ></div></td>
								<td class="inframe"><div align = "center"><INPUT TYPE='text' Name='__TTRAINEETIME$END_TIME$<%=multi.getDataLabel("line_no")%>' SIZE='5' MAXLENGTH='4' VALUE='<%=multi.getDataLabel("END_TIME")%>'  onClick="" onChange="" onKeyPress="chkInteger();" onKeyUp="sysIsEdit();" dir="" onBlur="chkTimeOver(this,23,0);chkTwoTime(__TTRAINEETIME$START_TIME$<%=multi.getDataLabel("line_no")%>,this,2);calTwoTime_Break(__TTRAINEETIME$START_TIME$<%=multi.getDataLabel("line_no")%>,this,__TTRAINEETIME$T_HOUR$<%=multi.getDataLabel("line_no")%>,__TTRAINEETIME$TIMEBREAK$<%=multi.getDataLabel("line_no")%>);" onFocus="delDot(this);" class="numeric"  ></div></td>
								<td class="inframe"><div align = "center"><INPUT TYPE='text' Name='__TTRAINEETIME$TIMEBREAK$<%=multi.getDataLabel("line_no")%>' SIZE='5' MAXLENGTH='4' VALUE='<%=multi.getDataLabel("TIMEBREAK")%>'  onClick="" onChange="" readonly onKeyPress="chkInteger();" onKeyUp="sysIsEdit();" dir=""  class="numeric"  ></div></td>
								<td class="inframe"><div align = "center"><INPUT TYPE='text' Name='__TTRAINEETIME$T_HOUR$<%=multi.getDataLabel("line_no")%>' SIZE='5' MAXLENGTH='5' VALUE='<%=multi.getDataLabel("T_HOUR")%>'  onClick="" onChange="" readonly onKeyPress="checkWordNumber(this.value);" onKeyUp="checkComma(this,2);sysIsEdit();" dir="" class="numeric"  ></div></td>
								<td class="inframe"><div align = "center"><a href="javaScript:childMulti('<%=multi.getData("LINE_NO")%>','<%=multi.getData("TRAINEEID")%>','<%=multi.getData("TRAININGID")%>');"><img src="../IMAGES/BUTTON/MAIN/EDIT24.gif" border="0"></a></div></td>
								<td class="inframe" ><div align="center"><input type="checkbox" name="listmail" value="<%=multi.getDataLabel("STATUS")%>" id="<%=multi.getData("TRAINEEID")%>$<%=multi.getData("TRAINDATE")%>" onclick="setTypeMyMail(this,chk$<%=multi.getDataLabel("line_no")%>);" <%=(multi.getDataLabel("V3MEMPLOYEE","EMAIL").equals(""))?"disabled":""%>></div></td>
							 </tr>
							<%		
					}else{
						if(fixDate.equals(multi.getData("TRAINDATE"))){
							%>
							  <tr align="center"> 
								<td class="inframe"><div align = "center"><%=multi.getData("TRAINDATE")%></div></td>
								<td class="inframe"><div align = "center">
									<input name="__TTRAINEETIME$STATUS$<%=multi.getDataLabel("line_no")%>" type="hidden" value = "<%=multi.getDataLabel("STATUS")%>">
									<input name="chk$<%=multi.getDataLabel("line_no")%>" type="checkbox" <%=(multi.getDataLabel("STATUS").equals("1"))?"checked":""%> onclick = "setChkBoxValue('<%=multi.getDataLabel("line_no")%>');setTypeMyMail2(this,'<%=multi.getData("TRAINEEID")%>$<%=multi.getData("TRAINDATE")%>');"  value="<%=multi.getDataLabel("line_no")%>" >
								</div></td>
								<td class="inframe"><div align = "center"><%=multi.getDataLabel("TRAINEEID")%></div></td>
								<td class="inframe"><div align = "left">&nbsp;<%=multi.getDataLabel("V3MPREFIX","TDESC")+multi.getDataLabel("V3MEMPLOYEE","FNAME")+"  "+multi.getDataLabel("V3MEMPLOYEE","LNAME")%></div></td>
								<td class="inframe"><div align = "center"><INPUT TYPE='text' Name='__TTRAINEETIME$START_TIME$<%=multi.getDataLabel("line_no")%>' SIZE='5' MAXLENGTH='4' VALUE='<%=multi.getDataLabel("START_TIME")%>'  onClick="" onChange="" onKeyPress="chkInteger();" onKeyUp="sysIsEdit();" dir="" onBlur="chkTimeOver(this,23,0);calTwoTime_Break(this,__TTRAINEETIME$END_TIME$<%=multi.getDataLabel("line_no")%>,__TTRAINEETIME$T_HOUR$<%=multi.getDataLabel("line_no")%>,__TTRAINEETIME$TIMEBREAK$<%=multi.getDataLabel("line_no")%>);" onFocus="delDot(this);" class="numeric"  ></div></td>
								<td class="inframe"><div align = "center"><INPUT TYPE='text' Name='__TTRAINEETIME$END_TIME$<%=multi.getDataLabel("line_no")%>' SIZE='5' MAXLENGTH='4' VALUE='<%=multi.getDataLabel("END_TIME")%>'  onClick="" onChange="" onKeyPress="chkInteger();" onKeyUp="sysIsEdit();" dir="" onBlur="chkTimeOver(this,23,0);calTwoTime_Break(__TTRAINEETIME$START_TIME$<%=multi.getDataLabel("line_no")%>,this,__TTRAINEETIME$T_HOUR$<%=multi.getDataLabel("line_no")%>,__TTRAINEETIME$TIMEBREAK$<%=multi.getDataLabel("line_no")%>);" onFocus="delDot(this);" class="numeric"  ></div></td>
								<td class="inframe"><div align = "center"><INPUT TYPE='text' Name='__TTRAINEETIME$TIMEBREAK$<%=multi.getDataLabel("line_no")%>' SIZE='5' MAXLENGTH='4' VALUE='<%=multi.getDataLabel("TIMEBREAK")%>'  onClick="" onChange="" readonly onKeyPress="chkInteger();" onKeyUp="sysIsEdit();" dir="" class="numeric"  ></div></td>
								<td class="inframe"><div align = "center"><INPUT TYPE='text' Name='__TTRAINEETIME$T_HOUR$<%=multi.getDataLabel("line_no")%>' SIZE='5' MAXLENGTH='5' VALUE='<%=multi.getDataLabel("T_HOUR")%>'  onClick="" readonly onChange="" onKeyPress="checkWordNumber(this.value);" onKeyUp="checkComma(this,2);sysIsEdit();" dir=""  class="numeric"  ></div></td>
								<td class="inframe"><div align = "center"><a href="javaScript:childMulti('<%=multi.getData("LINE_NO")%>','<%=multi.getData("TRAINEEID")%>','<%=multi.getData("TRAININGID")%>');"><img src="../IMAGES/BUTTON/MAIN/EDIT24.gif" border="0"></a></div></td>
								<td class="inframe" ><div align="center"><input type="checkbox" name="listmail" value="<%=multi.getDataLabel("STATUS")%>" id="<%=multi.getData("TRAINEEID")%>$<%=multi.getData("TRAINDATE")%>" onclick="setTypeMyMail(this,chk$<%=multi.getDataLabel("line_no")%>);" <%=(multi.getDataLabel("V3MEMPLOYEE","EMAIL").equals(""))?"disabled":""%>></div></td>
							  </tr>
							<%	
						}
					}
					multi.next();
				}
			%>
			<script language="javascript">updateAmount(<%=amount%>);</script>
        </table>
	  </td>
    </tr>
    <tr> 
      <td  class="blankspace"></td>
    </tr>
    <tr> 

		<tr>
			<td  class="buttonline" colspan="7"><div align="center">
				<button type="button" class="btn btn-primary width100" swlang code="SW013163" onClick="checkAll();">Select All</button>&nbsp;
				<button type="button" class="btn btn-primary width100" swlang code="SW013164" onClick="decheckAll();">Deselect All</button>&nbsp;
				<button type="button" class="btn btn-primary width100" swlang code="SW006761" onClick="sendMail();">MAIL</button>&nbsp;
			</div>
			</td>
		</tr>
    <tr> 
      <td  class="blankspace"></td>
    </tr>
  </table>
    <input type="hidden" name="__maxrec" value="<%=total%>">
</form>
  <script language="javascript">window.parent.setTabPages();</script>
</body>
</html>