TREMP013.jsp 3.13 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
<%@ page contentType="text/html; charset=UTF-8" language="java" %>
<%@ 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="java.util.*"  %>
<% 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);	
	HelpEntry screen = (HelpEntry)EMV.process("HelpEntry", "TREMP013"); 

	if(screen==null){
		return;
	}

	CscCalendar date = new CscCalendar();
	String tmp_date = date.getYYYYMMDD().substring(0, 8);
	String filter = "( resdatefrm between '"+tmp_date+"01' and '"+tmp_date+date.getDayInMonth()+"' or "+
						"resdateto between '"+tmp_date+"01' and '"+tmp_date+date.getDayInMonth()+"' ) and crsid != ''";
	//screen.getInquiry().setFilter(filter);
	
	screen.getInquiry().setOrderBy("create_date desc");
	screen.setMaxLine(5);
	screen.getInquiry().setBetween(0, 5);
	screen.getInquiry().refresh();
	if(screen.getInquiry().recCount()>0) {
%>  
<script type="text/javascript">
	function reservTraining( trainingid, type){
		var tmp = trainingid; 
		var tmp_t = type;
		with(document.cscform){
				action="TREMP010.jsp?__fixCon=trainingid='"+tmp+"'&__myrestype="+tmp_t;
				submit();
		}
	}
</script>

<div class="content-box2">
  <div class="content-header"><h2><script type="text/javascript">swapLang("Training Plan");</script></h2></div>  
    <table width="100%" border="0" cellpadding="3" cellspacing="3" bgcolor="#CADCE6">
      <tr>
        <td width="110" valign="top"><div align="center"><img src="../IMAGES/EMPVIEW/TRAIN1.jpg" alt="" width="100" height="100" align="middle"  /></div></td>
        <td valign="top">
			<ul>
         <%	
				String month="";
				while(screen.nextRec()){
                                screen.referLangOn();
				if(!month.equals(screen.inq.getCurrentDbRecord().getCscCalendar("create_date").getMM())){
					month=screen.inq.getCurrentDbRecord().getCscCalendar("create_date").getMM();
                                %><br><%
                                String lang = EMV.getUProfile().get("lang");
                                if(lang.equals("tha")){%><ui><strong><%=screen.inq.getCurrentDbRecord().getCscCalendar("create_date").getThaiLongMonth()%></strong></ui><%}
                                else {%><ui><strong><%=screen.inq.getCurrentDbRecord().getCscCalendar("create_date").getEngLongMonth()%></strong></ui><%}
				}				
		%>   
				 <li><a href="javascript:reservTraining('<%=screen.getString("trainingid")%>','');"><%=screen.getString("mcourse", "crsdesc")%></a>
                 &nbsp;<em>[<%=screen.inq.getCurrentDbRecord().getCscCalendar("create_date").getDDMMYYYY()%>]</em></li>
		 <%	
				 }
				 screen.referLangOff();
		%>      
			</ul>
        </td>
      </tr>
  </table>
 	<div class="show-all"><a href="TREMP013_1.jsp"><script type="text/javascript">swapLang("View all");</script></a>&nbsp;&raquo;</div>
	<div class="content-footer"><img src="../IMAGES/SPACER.gif" width="3" height="3" /></div>
</div>
<% 
		}
%>