⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 signin.jsp

📁 一个完整的
💻 JSP
字号:
<%@ page contentType="text/html; charset=gb2312" %>
<%@ page import="com.gforce.gfoa.*,com.gforce.currency.*,java.util.*" %>
<jsp:include page="/CheckLogin.jsp" flush="true"/>
<%
Session m_session = new Session(session);
Request m_request = new Request(request);
int iAutoSign = m_request.GetInt("AutoSign");
int iUserID = m_session.GetInt("UserID");
Vector vt = UserManager.getUserInfoByID(iUserID);
int iDepartmentID = Integer.parseInt(((Vector)vt.get(0)).get(5).toString());

String strWeek = StringNew.GetDateString(new Date(),"E");
      strWeek = strWeek.replaceAll("星期日","0");
      strWeek = strWeek.replaceAll("星期一","1");
      strWeek = strWeek.replaceAll("星期二","2");
      strWeek = strWeek.replaceAll("星期三","3");
      strWeek = strWeek.replaceAll("星期四","4");
      strWeek = strWeek.replaceAll("星期五","5");
      strWeek = strWeek.replaceAll("星期六","6");
int iWeekDay = Integer.parseInt(strWeek);
int iPageSize = 18;
int iPage = m_request.GetInt("Page");
vt = new Vector();
//begin****************如果当前时间在签到时间内,则自动签到*********************
if(iAutoSign>0)
{
String strDate = StringNew.GetDateString(new Date(),"HH:mm");
vt = SignTypeManager.getUsefulSignType(iUserID,iWeekDay,strDate);
String strTypeID = "";
if (vt.size() == 1)
{
  strTypeID = ((Vector)vt.get(0)).get(0).toString();
  out.println("<script lanaguage='javascript'>window.location='SignInAction.jsp?Page=" + iPage + "&TypeID=" + strTypeID +"';</script>");
}
}
//end****************如果当前时间在签到时间内,则自动签到***********************
%>
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=gb2312"><META http-equiv="pragma" content="no-cache">
<TITLE>考勤签到-- GForce OA 2.0</TITLE>
<LINK href="/css/txt.jsp" rel="stylesheet" type="text/css">
<SCRIPT language="JavaScript" src="/js/changestyle.js"></SCRIPT>
</HEAD>
<BODY bgcolor="<%=m_session.GetString("BackColor")%>" leftmargin="0" topmargin="0">
<TABLE width="100%" height="100%" border="0" align="center" cellspacing="0">
    <TR>
        <TD align="center" valign="top"><P>&nbsp;</P>

      <TABLE width="90%" border="1" cellpadding="1" bordercolordark="#ffffff" bordercolorlight="#0a0a0a" cellspacing="0" style="">
        <TR align="center" valign="middle" bgcolor="<%=m_session.GetString("TitleColor")%>">
          <TH width="3%" height="24" nowrap><IMG src="/images/white.gif" width="12"></TH>
          <TH width="38%" nowrap><FONT color="#000000">考勤类型名称</FONT></TH>
          <TH width="8%" nowrap><FONT color="#000000">签到开始时间</FONT></TH>
          <TH width="8%" nowrap><FONT color="#000000">签到结束时间</FONT></TH>
          <TH width="31%" nowrap><FONT color="#000000">有效签到工作日</FONT></TH>
          <TH width="6%" nowrap><FONT color="#000000">&nbsp;</FONT></TH>
        </TR>
        <%
vt = SignTypeManager.getUsefulSignType(iUserID,iWeekDay,"");
if(iPage<1)iPage=1;
int iPageCount = StringNew.getPageCount(vt.size(),iPageSize);
if(iPage>iPageCount) iPage=1;
for(int i=(iPage-1)*iPageSize;i<vt.size()&&i<iPage*iPageSize;i++)
{
    String strID = ((Vector)vt.get(i)).get(0).toString();
    if(i % 2 == 0)
        out.println("<tr id=\"Row"+ i+ "\" class=\"DataRowsSingle\" onmouseover=\"mouseon(this,'image" + i + "');\" onmouseout=\"mouseout(this,'image" + i + "','DataRowsSingle');\">");
    else
        out.println("<tr id=\"Row"+ i+ "\" class=\"DataRowsDouble\" onmouseover=\"mouseon(this,'image" + i + "');\" onmouseout=\"mouseout(this,'image" + i + "','DataRowsDouble');\">");
    out.println("<td align=\"right\" valign=\"middle\"><img id=\"image" + i + "\" src=\"../images/lastpost1.gif\" style=\"display:none;\"> </td>");
    out.println("<td align=\"center\" valign=\"middle\" nowrap title=\"" + ((Vector)vt.get(i)).get(1).toString() + "\">" + ((Vector)vt.get(i)).get(1).toString() + "</td>");
    String strWorkDays=((Vector)vt.get(i)).get(7).toString().trim();
    if(strWorkDays.length()>0)
    {
      strWorkDays = strWorkDays.replaceAll("0","星期日");
      strWorkDays = strWorkDays.replaceAll("1","星期一");
      strWorkDays = strWorkDays.replaceAll("2","星期二");
      strWorkDays = strWorkDays.replaceAll("3","星期三");
      strWorkDays = strWorkDays.replaceAll("4","星期四");
      strWorkDays = strWorkDays.replaceAll("5","星期五");
      strWorkDays = strWorkDays.replaceAll("6","星期六");
    }
    else
    {
      strWorkDays = "&nbsp;";
    }
    out.println("<td align=\"center\" valign=\"middle\" nowrap>" + ((Vector)vt.get(i)).get(2).toString() + "</td>");
    out.println("<td align=\"center\" valign=\"middle\" nowrap>" + ((Vector)vt.get(i)).get(3).toString() + "</td>");
    out.println("<td align=\"left\" valign=\"middle\" nowrap>" + strWorkDays + "</td>");
    out.println("<td align=\"center\" valign=\"middle\" nowrap><input type=\"button\" value=\"签到\" onClick=\"window.location='SignInAction.jsp?Page=" + iPage + "&TypeID=" + strID + "';\"  style=\"background-color: #FFFFFF; border: 1 solid #000000\" &nbsp;&nbsp;\"></td>");
    out.println("</tr>");
}
%>
        <TR>
          <TH height="0" colspan="4" align="center" valign="top">
            <%
String strCurrentPageURL = request.getRequestURI();
if(iPage<2)
out.print("首页&nbsp;&nbsp;上页");
else
out.print("<a href=\""+ strCurrentPageURL+"?Page=" + 1 + "\">首页</a>&nbsp;&nbsp;<a href=\""+ strCurrentPageURL+"?Page=" + (iPage-1) + "\">上页</a>");
out.print("&nbsp;&nbsp;当前是第" + iPage + "页,共" + vt.size() + "条记录" + iPageCount + "页&nbsp;&nbsp;");
if(iPage>=iPageCount)
out.print("下页&nbsp;&nbsp;末页");
else
out.print("<a href=\""+ strCurrentPageURL+"?Page=" + (iPage+1) + "\">下页</a>&nbsp;&nbsp;<a href=\""+ strCurrentPageURL+"?Page=" + iPageCount + "\">末页</a>");
%>
          </TH>
          <TH align="center" valign="top" colspan="2">
          <INPUT type="button" value="部门签到统计" onClick="window.location='SignQuery.jsp';" style="background-color: #FFFFFF; border: 1 solid #000000">
          </TH>
        </TR>
      </TABLE>
     </form>
      <HR>
      <STRONG>部门签到情况</STRONG>
      <TABLE width="90%" border="1" cellpadding="1" bordercolordark="#ffffff" bordercolorlight="#0a0a0a" cellspacing="0" style="">
        <TR align="center" valign="middle" bgcolor="<%=m_session.GetString("TitleColor")%>">
          <TH width="3%" height="24" nowrap><IMG src="/images/white.gif" width="12"></TH>
          <TH width="20%" nowrap><FONT color="#000000">签到类型</FONT></TH>
          <TH width="10%" nowrap><FONT color="#000000">员工编号</FONT></TH>
          <TH width="15%" nowrap><FONT color="#000000">姓名</FONT></TH>
          <TH width="15%" nowrap><FONT color="#000000">是否正常</FONT></TH>
          <TH width="20%" nowrap><FONT color="#000000">签到时间</FONT></TH>
          <!--<th width="20%" nowrap><font color="#000000">签到IP</font></th>-->
        </TR>
<%
String str_Date = StringNew.GetDateString(new Date(),"yyyy-MM-dd");
vt = UserManager.getRecordAndPersonnelInfoByDepartmentID(iDepartmentID);
int k=0;
for(int i=0; i<vt.size() ;i++)
{
Vector vSign = SignManager.getSignByUserIDDate(Integer.parseInt(((Vector)vt.get(i)).get(0).toString()),str_Date,str_Date);
for (int j=0; j<vSign.size();j++,k++)
        {
    String strID = ((Vector)vt.get(i)).get(0).toString();
    if( k % 2 == 0)
    out.println("<tr id=\"Row"+ k + "\" class=\"DataRowsSingle\" onmouseover=\"mouseon(this,'imagea" + k + "');\" onmouseout=\"mouseout(this,'imagea" + k + "','DataRowsSingle');\">");
    else
    out.println("<tr id=\"Row"+ k + "\" class=\"DataRowsDouble\" onmouseover=\"mouseon(this,'imagea" + k + "');\" onmouseout=\"mouseout(this,'imagea" + k + "','DataRowsDouble');\">");
    out.println("<td align=\"right\" valign=\"middle\"><img id=\"imagea" + k + "\" src=\"../images/lastpost1.gif\" style=\"display:none;\"> </td>");
    out.println("<td align=\"center\" valign=\"middle\">" + SignTypeManager.getTypeNameByID(Integer.parseInt(((Vector)vSign.get(j)).get(2).toString())) + "</td>");
    out.println("<td align=\"center\" valign=\"middle\">" + ((Vector)vt.get(i)).get(8).toString() + "</td>");
    out.println("<td align=\"center\" valign=\"middle\" nowrap>" + ((Vector)vt.get(i)).get(9).toString() + "</td>");
    if (((Vector)vSign.get(j)).get(5).toString().equalsIgnoreCase("true"))
    out.println("<td align=\"center\" valign=\"middle\"><font color=\"#000000\">正常</font></td>");else
    out.println("<td align=\"center\" valign=\"middle\"><font color=\"#FF0000\">不正常</font></td>");
    out.println("<td align=\"center\" valign=\"middle\">" + StringNew.GetDateString(((Vector)vSign.get(j)).get(3).toString(),"MM月dd日 HH点mm分ss秒") + "</td>");
    //out.println("<td align=\"center\" valign=\"middle\">" + ((Vector)vSign.get(j)).get(4).toString() + "</td>");
    out.println("</tr>");
        }
}

%>
      </TABLE>
      <HR>
      <STRONG>以下人员未签到</STRONG>
      <TABLE width="90%" border="1" cellpadding="1" bordercolordark="#ffffff" bordercolorlight="#0a0a0a" cellspacing="0" style="">
        <TR align="center" valign="middle" bgcolor="<%=m_session.GetString("TitleColor")%>">
          <TH width="3%" height="24" nowrap><IMG src="/images/white.gif" width="12"></TH>
          <TH width="10%" nowrap><FONT color="#000000">员工编号</FONT></TH>
          <TH width="87%" nowrap><FONT color="#000000">姓名</FONT></TH>
        </TR>
<%
vt = UserManager.getRecordAndPersonnelInfoByDepartmentID(iDepartmentID);
for(int i=0; i<vt.size() ;i++)
{
Vector vSign = SignManager.getSignByUserIDDate(Integer.parseInt(((Vector)vt.get(i)).get(0).toString()),str_Date,str_Date);
if (!(vSign.size() > 0))
{
    String strID = ((Vector)vt.get(i)).get(0).toString();
    if( i% 2 == 0)
    out.println("<tr id=\"Row"+ i + "\" class=\"DataRowsSingle\" onmouseover=\"mouseon(this,'imageb" + i + "');\" onmouseout=\"mouseout(this,'imageb" + i + "','DataRowsSingle');\">");
    else
    out.println("<tr id=\"Row"+ i + "\" class=\"DataRowsDouble\" onmouseover=\"mouseon(this,'imageb" + i + "');\" onmouseout=\"mouseout(this,'imageb" + i + "','DataRowsDouble');\">");
    out.println("<td align=\"right\" valign=\"middle\"><img id=\"imageb" + i + "\" src=\"../images/lastpost1.gif\" style=\"display:none;\"> </td>");
    out.println("<td align=\"center\" valign=\"middle\">" + ((Vector)vt.get(i)).get(8).toString() + "</td>");
    out.println("<td align=\"center\" valign=\"middle\" nowrap>" + ((Vector)vt.get(i)).get(9).toString() + "</td>");
    out.println("</tr>");
}
}
%>
      </TABLE>
      </TD>
    </TR>
</TABLE>
<table>
  <tr><td>&nbsp;</td>
  </tr>
</table>
</BODY>
</HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -