TRE005_5C.jsp 8.63 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
<%@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.*"  %>
<jsp:useBean id="TRE005_5C" class="com.csc.library.system.Task" scope="page"/>
<%
TRE005_5C.setChannel(request,response);
UIManager screen = (UIManager) TRE005_5C.process("ChildEntry","HTRAININGTIME");
CheckNull chk = new CheckNull();
String checksave=request.getParameter("__checksave");
String ack = chk.chkNullString(request.getParameter("__ack"));
String goRec = chk.chkNullString(request.getParameter("__gorec"));
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title></title>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="../CSS/TISCO.css" rel="stylesheet" type="text/css">
<script type='text/javascript' src='../JS/SCREEN.js'></script>
<script language='javascript'>setLang('<%=screen.getUProfile().get("lang")%>');</script>
<script language="javascript">getTitleName();</script>
<script src="../JS/VIEWCALENDAR.js"></script>
<script language="JavaScript" src='../JS/ICONSMENU.js'></script>
<script language='javascript' src='../JS/HOTKEY.js'></script>
<script language="javascript">

function GoSave() {confirmSave();}
function GoSearch() {search();}
function GoDelete() {edelete();}
function GoUpdate() {update();}
function checkCF() {checkConfirm();}

	function setcmd1(acktion){	
		with(document.cscform){
			if(notBlankOnThisPage()){
				bCon=confirm(MyCode[1]);
				if (bCon==true){	
					__cmdchild.value="save";
				}
				submit();
			}
		}	
	}
	function back(){
		with(window.opener.cscform){
			__cmd.value="ack";
			submit();
		}
		if(document.cscform.__gorec.value!=""){
			window.close();
		}
	}
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";
		}
	}
</script>

</head>

<body  leftmargin="0" topmargin="0">
<div id="toolTipLayer" style="position:absolute; visibility: hidden"></div>
<script language="javascript">initToolTips();</script>
<form name="cscform" method="post" action="TRE005_5C.jsp">

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

<%=screen.InitialVariable()%>

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

<input type="hidden" name="__checksave" value="">
<input type="hidden" name="__cmd" value="">
<input type="hidden" name ="__headMulti" value="TRE005">
<input type="hidden" name ="__ack" value="<%=request.getParameter("__ack")%>">
<input	name="__screen" type="hidden" value="TRE005_5C">
<input type="hidden" name ="__cmdchild" value="">
<input type="hidden" name="__cmdChild" value="">
<input type="hidden" name="__help" value="">
<input type="hidden" name="__sysisedit" >
<input type="hidden" name="__user" value="<%=screen.getUProfile().getUserId()%>">
<input type="hidden" name="__maxrec" value="<%=screen.getTable("HTRAININGTIME").recCount()%>">
<input type="hidden" name="__gorec" value="<%=goRec%>">
<input type="hidden" name="__confirm" value="">
<input type="hidden" name="__fixCon" value="">
<input type="hidden" name="__backpage" value="TRE005_5">
<input name="__notNull" type="hidden" value="<%=screen.getRequire()%>">



<%if(goRec.equalsIgnoreCase("")){%>
	<input type="hidden" name="__line_no" value="<%=screen.getTable("HTRAININGTIME").recCount()+1%>">
<%}else{%>
	<input type="hidden" name="__line_no" value="<%=screen.getDataLabel("LINE_NO")%>">
<%}%>

<input type="hidden" name="__companyid"  value="<%=request.getParameter("__companyid")%>">
<input type="hidden" name="__trainingid"  value="<%=request.getParameter("__trainingid")%>">
<input type="hidden" name="__calendar"><script language="javascript">getInputFormatDate();</script>
<input type="hidden" name="__language" value="<%=screen.getUProfile().get("lang")%>">
<input type="hidden" name="__end_date" value="<%=screen.getDataLabel("START_DATE")%>">
  <br>
  <div align="center">
    <table  cellpadding="0"  cellspacing="0">
      <tr > 
		<td class="header"> TRE005_5C, 
          <script language="javascript">swapLang('Date');</script>&nbsp;-&nbsp;<script language="javascript">swapLang('Training Time');</script>&nbsp;&nbsp;</td>
      </tr>
      <tr > 
        <td  colspan="2"> 
          <div align="center"> 
            <table  cellpadding="0" cellspacing="0" >
              <tr> 
                <td colspan="2"  class="blankspace"></td>
              </tr>
              <tr> 
                <td class="columnlabel"><%=screen.getLabel("START_DATE")%>&nbsp;</td>
                <td nowrap >
					<%=screen.getInput("START_DATE")%>					
					<a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image21','','../IMAGES/BUTTON/SWAP/CALENDAR_SWAP20.gif',1)"><img src="../IMAGES/BUTTON/MAIN/CALENDAR20.gif" alt="Calendar" name="Image21" border="0" align="absmiddle" id="Image21" onClick="viewCal('__start_date')"></a> 
				</td>
              </tr>
              <tr> 
                <td  class="columnlabel"><script language="javascript">swapLang('Time Between');</script></td>
                <td nowrap ><font class="normal"><%=screen.getInput("START_TIME")%>-<%=screen.getInput("END_TIME")%> </td>
              </tr>
            <tr> 
                <td  class="columnlabel"><script language="javascript">swapLang('Relax Hour');</script>&nbsp;</td>
                <td nowrap class="columnlabelFree" ><div align="left"><%=screen.getInput("timebreak")%></div></td>
              </tr>	
              <tr> 
                <td  class="columnlabel"><script language="javascript">swapLang('Total Hour');</script>&nbsp;</td>
                <td nowrap class="columnlabelFree" ><div align="left"><%=screen.getInput("T_HOUR")%></div></td>
              </tr>			  
              <tr> 
                <td nowrap  class="columnlabel">&nbsp;</td>
                <td >&nbsp;</td>
              </tr>
              <tr> 
                <td  class="columnlabel">&nbsp;</td>
                <td ><div align="left"><a href="javascript:setcmd1('save');"><img src="../IMAGES/BUTTON/SAVE.gif" border="0"></a>&nbsp;<a  href="javascript:backhead();"><img src="../IMAGES/BUTTON/BACK.gif" border="0"></a></div></td>
              </tr>
              <tr > 
                <td colspan="2" class="blankspace"></td>
              </tr>
            </table>
          </div></td>
      </tr>
      <tr> 
        <td  class="bottom"></td>
      </tr>
    </table>
  </div>
   <% 
	if((request.getParameter("__cmdchild")!=null)&&(!request.getParameter("__cmdchild").equals(""))){%>
		<script language="javascript">back();</script>
<%}%>
</form>
</body>
</html>