TAU353_ADMIN.jsp 12.6 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
<%@page contentType="text/html; charset=UTF-8"%>
<%@page import="com.csc.library.entry.*,com.csc.library.utilities.*"%>
<%@page import="com.csc.library.session.*"%>
<%@page import="java.util.HashMap"%>
<%@page import="java.util.Random" %>
<%@page import="java.text.DecimalFormat" %>
<%@page import="com.csc.library.dwr.ManageOTIDS_dwr"%>
<%@page import="com.csc.library.database.StaticConfig" %>
<%@page import="com.csc.library.database.*"%>
<%response.setHeader("X-XSS-Protection","0");%>
<jsp:useBean id="CREATEGROUPHELP" class="com.csc.library.system.Task" scope="page"/>

<%
	CREATEGROUPHELP.setChannel(request, response);
	HelpEntry screen = (HelpEntry) CREATEGROUPHELP.process("HelpEntry","MEMPL_VACATIONHELP");
	screen.setMaxLine(2000);
	screen.process();
	screen.referLangOff();

	CheckNull chkNull = new CheckNull();
	String pathname = chkNull.chkNullString( request.getParameter("__wf__pathname"));
	String filename = chkNull.chkNullString( request.getParameter("__wf__filename"));
	String empListid = chkNull.chkNullString( request.getParameter("__empListid"));
%>

<HTML>
	<HEAD>
		<TITLE>myNOTE : Business Process Management Service</TITLE>
		<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
		<LINK HREF="../CSS/MYNOTE.css" REL="stylesheet" TYPE="text/css">
		<SCRIPT TYPE='text/JavaScript' SRC='../JS/MYNOTE_SCREEN.js'></SCRIPT>
		<SCRIPT TYPE='text/JavaScript' SRC='../JS/SCREEN.js'></SCRIPT>
        <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/Createemployeelist_dwr.js'></script>
		<SCRIPT LANGUAGE="JavaScript">setLang('<%=screen.getUProfile().get("lang")%>');</SCRIPT>
		<SCRIPT LANGUAGE="JavaScript" TYPE="text/JavaScript"></SCRIPT>

		<STYLE TYPE="text/css">
		<!--
			.style1 {
				color: #FFFFFF;
				font-weight: bold;
			}
		-->
		</STYLE>

		<style type="text/css">

#hintbox{ /*CSS for pop up hint box */
position:absolute;
top: 0;
background-color: lightyellow;
width: 150px; /*Default width of hint.*/ 
padding: 3px;
border:1px solid black;
font:normal 11px Verdana;
line-height:18px;
z-index:100;
border-right: 3px solid black;
border-bottom: 3px solid black;
visibility: hidden;
}

.hintanchor{ /*CSS for link that shows hint onmouseover*/
font-weight: bold;
color: navy;
margin: 3px 8px;
}
.earthAlert tr td { 
	padding: 5px;
}

</style>

<script type="text/javascript">

	
var horizontal_offset="9px" //horizontal offset of hint box from anchor link

/////No further editting needed

var vertical_offset="0" //horizontal offset of hint box from anchor link. No need to change.
var ie=document.all
var ns6=document.getElementById&&!document.all

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=(whichedge=="rightedge")? parseInt(horizontal_offset)*-1 : parseInt(vertical_offset)*-1
if (whichedge=="rightedge"){
var windowedge=ie && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-30 : window.pageXOffset+window.innerWidth-40
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure+obj.offsetWidth+parseInt(horizontal_offset)
}
else{
var windowedge=ie && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetHeight
}
return edgeoffset
}

function showhint(menucontents, obj, e, tipwidth){
if ((ie||ns6) && document.getElementById("hintbox")){
dropmenuobj=document.getElementById("hintbox")
dropmenuobj.innerHTML=menucontents
dropmenuobj.style.left=dropmenuobj.style.top=-500
if (tipwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=tipwidth
}
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+obj.offsetWidth+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+"px"
dropmenuobj.style.visibility="visible"
obj.onmouseout=hidetip
}
}

function hidetip(e){
dropmenuobj.style.visibility="hidden"
dropmenuobj.style.left="-500px"
}

function createhintbox(){
var divblock=document.createElement("div")
divblock.setAttribute("id", "hintbox")
document.body.appendChild(divblock)
}

if (window.addEventListener)
window.addEventListener("load", createhintbox, false)
else if (window.attachEvent)
window.attachEvent("onload", createhintbox)
else if (document.getElementById)
window.onload=createhintbox

</script>
	</HEAD>
	<BODY>
		<FORM NAME="cscform" METHOD="post" ACTION="CREATEGROUPHELP.jsp">		
			<INPUT TYPE="hidden" NAME="__screen" VALUE="CREATEGROUPHELP">
			<INPUT TYPE="hidden" NAME="__cmd" VALUE="">
			<INPUT TYPE="hidden" NAME="__help" VALUE="">
			<INPUT TYPE="hidden" NAME="__goPage" VALUE="">
			<INPUT TYPE="hidden" NAME="__orderBy" VALUE="<%=request.getParameter("__orderBy")%>">
			<%-- <INPUT TYPE="hidden" NAME="__helpReturn" VALUE="<%=helpReturn%>"> --%>
			<INPUT TYPE="hidden" NAME="__helpName" VALUE="<%=request.getParameter("__helpName")%>">
			<INPUT TYPE="hidden" NAME="__pageCall" VALUE="<%=request.getParameter("__pageCall")%>">
			<INPUT TYPE="hidden" NAME="__fixCon" VALUE="<%=request.getParameter("__fixCon")%>">
            <INPUT TYPE="hidden" NAME="__GROUPNAME" VALUE="<%=request.getParameter("__GROUPNAME")%>">
            <INPUT TYPE="hidden" NAME="__weekid" VALUE="<%//=weekid%>">
			<input type="hidden" id="__isRed" name="__isRed" value="0">
			
			<TABLE WIDTH="100%" 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"><FONT COLOR="#FFFFFF"></FONT></TD>
    				<TD VALIGN="middle" align="center"><FONT FACE="MS Sans Serif" SIZE="1" COLOR="#FFFFFF">
      					<TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="1" CLASS="txt01">
       					  <TR BGCOLOR="#FFFFFF"> </TR>
      					</TABLE>
      					<TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="1" CLASS="txt01">
        					<TR BGCOLOR="#FFFFFF"> </TR>
      					</TABLE>
      					<TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="1" CLASS="txt01" align="center">
        					<TR BGCOLOR="#FFFFFF">
          						<TD HEIGHT="15" COLSPAN="2" BGCOLOR="#0099CC">
								<SPAN CLASS="style1">&nbsp;หน้าจอการ Import สิทธิการลาเข้าระบบ&nbsp;Mempl_vacation</SPAN></TD>
        					</TR>
      					</TABLE>
      					<TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="1" CLASS="txt01">
      					</TABLE>
      					<TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="1" CLASS="txt01 earthAlert" align="center">
                        <tr bgcolor="#eff7fa">
							<td width="3%" BGCOLOR="#0099CC" nowrap align="center" CLASS="style1"><%=screen.getUProfile().get("lang").equalsIgnoreCase("THA")?"ลำดับ":"No."%></td>
							<td width="17%" BGCOLOR="#0099CC" nowrap align="center" CLASS="style1"><%=screen.getUProfile().get("lang").equalsIgnoreCase("THA")?"สถานะ":"Status"%></td>
							<td width="15%" BGCOLOR="#0099CC" nowrap align="center" CLASS="style1"><%=screen.getInquiry().getCurrentDbRecord().getField("employeeid").getDescription()%></td>
							<td width="15%" BGCOLOR="#0099CC" nowrap align="center" CLASS="style1"><%=screen.getInquiry().getCurrentDbRecord().getField("companyid").getDescription()%></td>
							<td width="15%" BGCOLOR="#0099CC" nowrap align="center" CLASS="style1"><%=screen.getInquiry().getCurrentDbRecord().getField("yearid").getDescription()%></td>
							<td width="15%" BGCOLOR="#0099CC" nowrap align="center" CLASS="style1"><%=screen.getInquiry().getCurrentDbRecord().getField("vacation1").getDescription()%></td>
							<td width="15%" BGCOLOR="#0099CC" nowrap align="center" CLASS="style1"><%=screen.getInquiry().getCurrentDbRecord().getField("eventgrp").getDescription()%></td>
                        </tr>
                       <%
					   			int num = 0;
								String isview = "";
								String fullpath = pathname + filename;
								String[] empArrList = empListid.split(",");
								ReadFile rf = new ReadFile(fullpath);

								try {
									if (rf.hasMoreData()) {
										rf.readLine(); // อ่าน header เฉยๆ ไม่ได้ทำอะไรกับมัน
									}

								if(rf.hasMoreData()) {
									while (rf.hasMoreData()) {
										try {
											String[] colum = rf.readLine().split(",");

											String employeeid = colum[0];
											String companyid = colum[1];
											String yearid = colum[2];
											String vacation1 = colum[3];
											String eventgrpid = colum[4];

											String[] empEvent = empArrList[num].split(":");
											String empEventEmployeeID = empEvent[0];
											String hasEmployee = empEvent[1];
											String hasEventgrp = empEvent[2];
										
											String color = "";
											String status = "";

											if(hasEmployee.equals("0") || hasEventgrp.equals("0")){
												color = "red";
												%>
												<script type="text/javascript">document.cscform.__isRed.value = "1";</script>
												<%

												if(hasEmployee.equals("0") || hasEventgrp.equals("0")){
													status = "ไม่มีรหัสพนักงาน และ รหัสกลุ่มประเภทวันในระบบ";
												} else if(hasEmployee.equals("0")) {
													status = "ไม่มีรหัสพนักงานในระบบ";
												} else if(hasEventgrp.equals("0")) {
													status = "ไม่มีรหัสกลุ่มประเภทวันในระบบ";
												}
											}

											if(hasEmployee.equals("1") && hasEventgrp.equals("1")){
												status = "ผ่าน";
											}
							%>
											<tr bgcolor="">
												<td class="row-data" nowrap><div align="center"><font color="<%=color%>"><%=++num%>
												<td class="row-data" nowrap><div align="center"><font color="<%=color%>"><%=status%>
												<td class="row-data" nowrap><div align="center"><font color="<%=color%>"><%=employeeid%></font></div></td>
												<td class="row-data" nowrap><div align="center"><font color="<%=color%>"><%=companyid%></font></div></td>
												<td class="row-data" nowrap><div align="center"><font color="<%=color%>"><%=yearid%></font></div></td>
												<td class="row-data" nowrap><div align="center"><font color="<%=color%>"><%=vacation1%></font></div></td>
												<td class="row-data" nowrap><div align="center"><font color="<%=color%>"><%=eventgrpid%></font></div></td>
											</tr>
							<%		
										} catch (Exception e) {
											System.out.println(e);
											MyLog.error(">>>>>>>>> employee null <<<<<<<<<<<");
										}
									}
								isview= "1";
								}else{
							%>
							<tr bgcolor="#eff7fa">
								<td class="txt01" colspan="39" ><div align=""><SCRIPT LANGUAGE="JavaScript">swapLang('Not Found Data')</SCRIPT></div></td>
							</tr>

							<%
								}

								} catch (Exception e) {
									System.out.println(e);
									MyLog.error(">>>>>>>>> ImportUnsuccess <<<<<<<<<<<");
								}
							%>
                        </TABLE>
    				</FONT></TD>
    				<TD WIDTH="5" BACKGROUND="../IMAGES/MYNOTE/R2.gif"><FONT COLOR="#FFFFFF"></FONT></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>
			<input type="hidden" id="__wf__view" name="__wf__view" value="<%=isview%>">
		</FORM>
	</BODY>
</HTML>