USERONLINE.jsp 3.11 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
<%@ page contentType="text/html; charset=UTF-8"%>
<%@ page import="com.csc.library.system.*,com.csc.library.utilities.*,com.csc.library.cscimport.*,java.util.*"%>
<%@ page import="com.csc.library.entry.*,com.csc.library.database.*,com.csc.library.session.*"  %>
<jsp:useBean id="useronline" class="com.csc.library.system.Task" scope="page"/>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<META http-equiv="Content-Style-Type" content="text/css">
<TITLE>TEST.jsp</TITLE>

<link href="CSS/MYNOTE.css" rel="stylesheet" type="text/css">
<script language="javascript">
		function logOut(empid){
				with(document.cscform){
						__employeeid.value=empid;
						submit();
				}
		}
</script>
</HEAD>
<BODY>
<%
		HashMap conMap=StaticProperties.employeeOnline;
		 if(request.getParameter("__employeeid")!=null && request.getParameter("__employeeid").length()>0){
				conMap.remove(request.getParameter("__employeeid"));			
		 }
        useronline.setChannel(request,response);
		useronline.checkProfile();		
		 if(useronline.getUProfile()==null){
		 %>
		 <script language="javascript">window.location=INDEX.jsp;</script>
		 <%
		 }else{
		Iterator it=conMap.keySet().iterator();
		 UProfile u=useronline.getUProfile();
		DbRecord rec=new InitialRecord(u).getDbRecord("memployee",false);
		rec.setColumn("employeeid,fname,lname,emp_prefix,efname,elname,companyid");
	CscCalendar nowCs=new CscCalendar();
	out.println("Start Time :"+nowCs.getHHMMSSFULL());
%>
<form name="cscform" action="USERONLINE.jsp">
	<input type="hidden" name="__employeeid" value="">
  <table width="50%" border="0" align="center" cellpadding="1" cellspacing="0" bgcolor="#000000">
    <tr>
      <td><table width="100%" border="0"  align="center" cellpadding="0" cellspacing="1" bordercolor="#000000">
        <tr>
          <td width="92" class="title1"><div align="center">No</div></td>
          <td width="396" class="title1"><div align="center">EMPLOYEE</div></td>
          <td width="396" class="title1"><div align="center">LOGINTIME</div></td>
          <!--td width="396" class="title1"><div align="center">LOGOUT</div></td-->
          </tr>
        <%
		CscCalendar cs=null;

nowCs =nowCs.decHour();
  int runno=0;
  String employee="";
		while(it.hasNext()){	

			employee =(String)it.next();		
			cs=new CscCalendar(((Long)conMap.get(employee)).longValue());	
			rec.set("employeeid",employee);
			rec.set("companyid",(String)u.get("companyid"));
			rec.search();
			if(cs.afterEquals(nowCs)){
							runno++;
  %>
        <tr>
          <td align="right" bgcolor="#FFFFFF"><%=runno%>&nbsp;</td>
          <td bgcolor="#FFFFFF" class="desc2"><%=employee%>&nbsp;<%=rec.getString("fullname")%></td>
          <td bgcolor="#FFFFFF" class="desc2"><%=cs.getDDMMYYYYHHMMSS()%></td>
          <!--td bgcolor="#FFFFFF" class="desc2"><input type="button" value=" logout "  onClick="javascript:logOut('<%=employee%>')"></td-->
          </tr>
        <%}
  }
%>
      </table></td>
    </tr>
  </table>
</form>
<%
	nowCs=new CscCalendar();
	out.println("End Time :"+nowCs.getHHMMSSFULL());
		 }
%>
</BODY>
</HTML>