OI-HOLIDAY0.jsp 9.62 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
<%@ 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", "OI-HOLIDAYHELP"); 
	if(screen==null){
		return;
	}
	screen.getInquiry().setFilter("hdate", new CscCalendar().getYear()+"-%","","like");
	screen.getInquiry().refresh();	
	CheckNull chk = new CheckNull();
	
	HtmlCalendar htmlCal = new HtmlCalendar();
	
	//htmlCal.setLanguage(HtmlCalendar.THAI);
	htmlCal.setLanguage(screen.getUProfile().get("lang"));
	htmlCal.setHeader("MMMM");
	htmlCal.setWeekEnd(1);
	htmlCal.setWeekEnd(7);
	
	while(screen.nextRec()){
		screen.inq.referLangOn();
		htmlCal.setHoliday(screen.getInquiry().getString("hdate") , screen.getString("edesc"));
 		screen.referLangOff();
   }

%>
<%!
	private String getLongDate(UProfile upf, String date){
    	CscCalendar c = null;
        try{
            c=new CscCalendar(date);
        }catch(Exception ex){
			MyLog.error(this, ex);
            c=new CscCalendar(); 
        }
        if(upf.get("lang").toString().equalsIgnoreCase("ENG")){
            return c.getEngLongMonth()+", "+c.getDate();
        }else{
        	return c.getDate()+" "+c.getThaiLongMonth();
        }      
    }
	
	private String truncate(String msg, int limit) { 
		String pad = "...";
		String saparator = " ";
		if(msg.length() <= limit){
			return msg; 
		}
		msg = msg.substring(0, limit); 
		
		int breakpoint = msg.lastIndexOf( saparator );
		if( breakpoint >0) { 
			msg = msg.substring(0, breakpoint); 
		}
	 	return msg +pad; 
	}
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="../Templates/template-emv-main.dwt.jsp" codeOutsideHTMLIsLocked="false" -->
<head>
<!-- InstanceBeginEditable name="doctitle" -->
<title>Employee View</title>
<!-- InstanceEndEditable -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<!-- InstanceBeginEditable name="head" -->
<!-- Begin CSS Links -->
<link rel="stylesheet" type="text/css" href="../CSS/DDMENU.css" />
<link rel="stylesheet" type="text/css" href="../CSS/EMV_DEFAULT.css" />
<link rel="stylesheet" type="text/css" href="../CSS/EMV_LAYOUT.css" />
<link rel="stylesheet" type="text/css" href="../CSS/EMV_LAYOUT_TWO.css" />
<link rel="stylesheet" type="text/css" href="../CSS/EMV_TEXT.css" />
<style type="text/css">
	#holiday {
		margin: 5px 20px 10px 5px;
	}
	#holidaylist {
		margin: 0;
		padding: 0;
		list-style: none;
	}
	#holidaylist li {
		margin: 0;
		padding: 0;
		text-indent: 5px;
		height: 18px;
	}

	#table-calendar .header{
		padding: 5px;
		font-weight: bold;
		text-align: center;
		color: #0045D5;
	}
	#table-calendar .calendar {
		margin: 0 auto 5px;
	}
	#table-calendar td {
		text-align: center;
		vertical-align: middle;	
	}
	.calendar th, .calendar td {
		width: 20px;
		line-height: 18px;
	}
	.calendar th{
		text-align: center;
		white-space: nowrap;
		background: #fff;
		color: #000;
		font-weight: bold;
		font-size: 11px;
	}
	.calendar td {
		font-size: 11px;
		color: #666;
	}
	.calendar .normal {
	}
	.calendar .today {
		background:  #efefef;
		font-weight: bold;
		color: #000;
	}
	.calendar .disable {
	}
	.calendar .weekend {
		color:#F00 !important;
	}
	.calendar .holiday {
		color:#F00 !important;
		font-weight: bold;
	}
</style>
<!-- End CSS Links -->
<!-- Begin Scripts -->
<script language="JavaScript"  type="text/javascript"src="../JS/EVENTS.js"></script>
<!-- Begin script for Dropdown Menu -->
<!-- DO NOT EDIT -->
<script language="JavaScript"  type="text/javascript" src="../JS/DDMENU.js"></script>
<!--[if lt IE 7]><script language="JavaScript" type="text/javascript" src="../JS/IEHOVER-FIX.js"></script><![endif]-->
<!-- DO NOT EDIT -->
<!-- End script for Dropdown Menu -->
<script language="JavaScript"  type="text/javascript" src="../JS/UTILITIES.js"></script>
<script language="JavaScript"  type="text/javascript"src="../JS/ACTIVE_OBJECT.js"></script>
<script language="JavaScript"  type="text/javascript"src="../JS/SCREEN.js"></script>
<script language="JavaScript" type="text/javascript">
	setLang("<%=screen.getUProfile().get("lang")%>");
	setPageTitle(swap2String("Annual Holiday"));
	
</script>
<style type="text/css">
#header {
 	background: #FFFFFF ;
}
</style>
<!-- End Scripts -->
<!-- Begin Head -->

<!-- End Head -->
<!-- InstanceEndEditable -->
</head>
<body>
<div id="wrapper">
  <div id="header"><!-- InstanceBeginEditable name="header" -->
    <jsp:include page="EMV_HEADER.jsp" flush="true" />
   <!-- InstanceEndEditable -->  </div>
  <div id="topnav"><!-- InstanceBeginEditable name="top_navigation" -->
  	<jsp:include page="EMV_TOPMENU.jsp" flush="true" />
    <!-- InstanceEndEditable -->  </div>
  <div id="container">
    
    <div id="content"><!-- InstanceBeginEditable name="main_content" -->
    <!-- Begin Main Content -->
      <jsp:include page="EMV_HELPBAR.jsp" flush="true" />
      <div class="content">
        <form name="cscform" method="post" action="?">
          <!-- BEGIN CSC INITIAL ZONE -->
          <%=screen.InitialVariable()%>
          <!-- END CSC INITIAL ZONE -->
          <input type="hidden" name="__cmd" value="">
          <input type="hidden" name="__screen" value="OI_HOLIDAY">
          <input type="hidden" name="__language" value ="<%=screen.getUProfile().get("lang")%>">
		  
      <div class="content-box1">
        <div class="content-header"><h2><script language="JavaScript" type="text/javascript">swapLang("Annual Holiday");</script></h2></div>

        <table width="728" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td width="235" height="22" background="../IMAGES/EMPVIEW/CALENDAR/CALENDAR_01.jpg">&nbsp;</td>
            <td height="22" background="../IMAGES/EMPVIEW/CALENDAR/CALENDAR_02.jpg">&nbsp;</td>
            <td width="22" height="22" background="../IMAGES/EMPVIEW/CALENDAR/CALENDAR_03.jpg">&nbsp;</td>
          </tr>
          <tr>
            <td width="235" height="160" valign="top" background="../IMAGES/EMPVIEW/CALENDAR/CALENDAR_06.jpg"><img src="../IMAGES/EMPVIEW/CALENDAR/CALENDAR_04.jpg" width="235" height="160" /></td>
            <td rowspan="3" valign="top" bgcolor="#B4E6FF">
            
            <table id="table-calendar"  width="100%" border="0" align="center" cellpadding="10" cellspacing="0">
              <tr>
                <td align="center" valign="top"><% htmlCal.setMonth(1);%><%=htmlCal.getHtml()%> </td>
                <td align="center" valign="top"><% htmlCal.setMonth(2);%><%=htmlCal.getHtml()%></td>
                <td align="center" valign="top"><% htmlCal.setMonth(3);%><%=htmlCal.getHtml()%></td>
              </tr>
              <tr>
                <td align="center" valign="top"><% htmlCal.setMonth(4);%><%=htmlCal.getHtml()%></td>
                <td align="center" valign="top"><% htmlCal.setMonth(5);%><%=htmlCal.getHtml()%></td>
                <td align="center" valign="top"><% htmlCal.setMonth(6);%><%=htmlCal.getHtml()%></td>
              </tr>
              <tr>
                <td align="center" valign="top"><% htmlCal.setMonth(7);%><%=htmlCal.getHtml()%></td>
                <td align="center" valign="top"><% htmlCal.setMonth(8);%><%=htmlCal.getHtml()%></td>
                <td align="center" valign="top"><% htmlCal.setMonth(9);%><%=htmlCal.getHtml()%></td>
              </tr>
              <tr>
                <td align="center" valign="top"><% htmlCal.setMonth(10);%><%=htmlCal.getHtml()%></td>
                <td align="center" valign="top"><% htmlCal.setMonth(11);%><%=htmlCal.getHtml()%></td>
                <td align="center" valign="top"><% htmlCal.setMonth(12);%><%=htmlCal.getHtml()%></td>
              </tr>
            </table>

            </td>
            <td width="22" rowspan="3" background="../IMAGES/EMPVIEW/CALENDAR/CALENDAR_05.jpg">&nbsp;</td>
          </tr>
          <tr>
            <td width="235" valign="top" background="../IMAGES/EMPVIEW/CALENDAR/CALENDAR_06.jpg">
            <div id="holiday">
            	<ul id="holidaylist">
                <%
					MyHashMap holiday = htmlCal.getHoliday();
					for( Iterator it = holiday.getKeySortIterator(); it.hasNext(); ){
						String key = it.next().toString();
				%>
                	<li><%=getLongDate(screen.getUProfile(), key )%> <%=truncate(holiday.get( key ).toString(), 30) %></li>
                <%}	%>
                  </ul>
              </div>
            </td>
          </tr>
          <tr>
            <td height="160" valign="bottom" background="../IMAGES/EMPVIEW/CALENDAR/CALENDAR_06.jpg"><img src="../IMAGES/EMPVIEW/CALENDAR/CALENDAR_07.jpg" width="235" height="160" /></td>
          </tr>
          <tr>
            <td height="22" background="../IMAGES/EMPVIEW/CALENDAR/CALENDAR_08.jpg">&nbsp;</td>
            <td height="22" background="../IMAGES/EMPVIEW/CALENDAR/CALENDAR_09.jpg">&nbsp;</td>
            <td width="22" height="22" background="../IMAGES/EMPVIEW/CALENDAR/CALENDAR_10.jpg">&nbsp;</td>
          </tr>
        </table>

        </div>
		 </form>
      </div>
      <!-- End Main Content -->
      <!-- InstanceEndEditable -->    </div>
  </div>
  <div id="footer"><!-- InstanceBeginEditable name="footer" -->
  <jsp:include page="EMV_FOOTER.jsp" flush="true" />
  <!-- InstanceEndEditable -->  </div>
</div>
</body>
<!-- InstanceEnd --></html>