📄 outstatistics.jsp
字号:
<%@ page import="java.util.*"%>
<%@ page contentType="text/html;charset=GB2312" %>
<%@ page import="cn.com.aheadsoft.util.UserInfo"%>
<jsp:useBean id="userPurviewManage" scope="page" class="cn.com.aheadsoft.manage.UserPurviewManage" />
<jsp:useBean id="userInfo" scope="page" class="cn.com.aheadsoft.util.UserInfo" />
<jsp:useBean id="timeManage" scope="page" class="cn.com.aheadsoft.manage.TimeManage" />
<jsp:useBean id="timeOutGoingRecordSet" scope="page" class="cn.com.aheadsoft.recordset.TimeOutGoingRecordSet" />
<jsp:useBean id="userDeptManage" scope="page" class="cn.com.aheadsoft.manage.UserDeptManage" />
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link rel="stylesheet" type="text/css" href="/krm/jsp/css/css.css">
</head>
<%
String userID;
String userName;
String selfDeptID;
String error;
String[] self;
String userNameShow;
String deptIDShow="";
String deptName;
String checked="";
//权限校验
userInfo=(UserInfo)session.getAttribute("userinfo") ;
List userList=userPurviewManage.getUserPurview(userInfo,"7","2","q");
if(userList==null){
response.sendRedirect("/krm/jsp/nologin.htm");
return;
}
String[][] userDept;
int deptNum=1;
String deptID[];
userID=userInfo.GetUserID();
selfDeptID=userInfo.GetDeptID();
userName=userInfo.GetUserName();
userDept=userDeptManage.serReset(userList);
String r1=request.getParameter("r1");
String userIDShow="",dept="";
String year="";
String month="";
String day;
if(r1==null||r1.trim().equals("")){
r1="0";
}
if(r1.equals("1")){
dept=request.getParameter("select1");
userIDShow=request.getParameter("select5");
deptIDShow=dept;
year=request.getParameter("select2");
month=request.getParameter("select3");
}else if(r1.equals("2")){
deptIDShow=request.getParameter("deptSel");
userIDShow=request.getParameter("select5");
year=request.getParameter("select6");
month=request.getParameter("select7");
}
Calendar calendar= Calendar.getInstance();
int nowYear=calendar.get(Calendar.YEAR);
if(!(r1.equals("1")||r1.equals("2"))){
r1="2";//初始值设置为本人信息
userIDShow=userID;
deptIDShow=userInfo.GetDeptID();
year=String.valueOf(nowYear);
month=String.valueOf(calendar.get(Calendar.MONTH)+1);
}
error=request.getParameter("error");
if(error==null){
error="0";
}
error=error.trim();
%>
<script language="JavaScript">
<!--
isNav = (navigator.appName.indexOf("Netscape") != -1) ? true : false;
isIE = (navigator.appName.indexOf("Microsoft") != -1) ? true : false;
function fsubmit(){
document.form2.submit();
}
function sub(id) {
document.form2.diaryDate_ID.value =id;
document.form2.submit();
return true;
}
function useSet(){
var deptID=document.form1.deptSel.value;
//alert("hhhhhh"+deptID);
var deptUser=new Array();
var len=document.form1.select1.options.length;
<%
for(int i=0;i<userDept.length;i++){
out.println("deptUser["+i+"]=new Array();");
for(int j=0;j<4;j++){
out.println("deptUser["+i+"]["+j+"]='"+userDept[i][j]+"'");
}
}
%>
for(var i=len;i>=0;i--){
//alert("jjjjjjj"+i);
document.form1.select5.remove(i);
}
for(i=0;i<deptUser.length;i++){
if(deptID==deptUser[i][0]){
if(isIE){
document.form1.select5.options.add(new Option(deptUser[i][3],deptUser[i][2]));
}else{
infoid=document.createElement("option");
infoid.value=deptUser[i][2];
infoid.text=deptUser[i][3];
document.form1.select5.appendChild(infoid);
}
}
}
}
-->
</script>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="F1F7F9" height="100%">
<tr height="8">
<td></td>
</tr>
<tr>
<td align="center" valign="top">
<fieldset style="width:95%; text-align:center">
<%if(userList.size()!=0){%>
<legend> <img src="/krm/jsp/permanage/image/per_wcdjcx.gif"></legend>
<table border="0" width="100%" height="60%" bordercolor="A1B7DB" class="collapse">
<tr align="center">
<td class="common">机关干部外出情况一览表 </td>
</tr>
<tr>
<td class="common" align="center"><form name="form1" method="post" action="">
<table border="1" width="95%" align="center" bordercolor="A1B7DB" class="collapse">
<tr bgcolor="3366CC">
<td class="common" colspan="7" align="center"><font color="ffffff">
考勤管理</font></td>
</tr>
<TR bgcolor="9BD0F8">
<TD colSpan=2 class="common"><B>请选择查找条件</B>:</TD>
</TR>
<TR >
<%
checked="";
if(r1.equals("1")){
checked=" checked";
}
%>
<TD width="50%" align="left" class="common"> <input name="r1" type="radio" value="1" <%=checked%>>
部 门:
<select name="select1">
<%
checked="";
if(deptIDShow.equals(userDept[0][0])){
checked=" selected";
}
out.println("<option value=\""+userDept[0][0]+"\""+checked+">"+userDept[0][1]+"</option>");
for(int i=0;i<userDept.length-1;i++){
String temp[]=userDept[i];
String deptID1="";
checked="";
deptID1=userDept[i][0];
checked="";
if(deptIDShow.equals(userDept[i+1][0])){
checked=" selected";
}
if(!deptID1.equals(userDept[i+1][0])){
out.println("<option value=\""+userDept[i+1][0]+"\""+checked+">"+userDept[i+1][1]+"</option>");
}
}
%>
</select></TD>
<TD width="50%" class="common"> 月份:
<select name="select2">
<%
checked="";
for(int i=nowYear;i>=2003;i--){
if(year!=null&&year.equals(String.valueOf(i))){
checked=" selected";
}
%>
<option value="<%=i%>"<%=checked%>><%=i%></option>
<%
}
%>
</select>
年
<select name="select3">
<%
for(int i=1;i<=12;i++){
checked="";
if(month!=null&&month.equals(String.valueOf(i))){
checked=" selected";
}
%>
<option value="<%=i%>"<%=checked%>><%=i%></option>
<%
}
%>
</select>
月 </TD>
</TR>
<TR >
<%
checked="";
if(!r1.equals("1")){
checked=" checked";
}
%>
<TD align="left" class="common" > <input type="radio" name="r1" value="2" <%=checked%>>
部 门:
<select name="deptSel" onChange="useSet()">
<%
checked="";
if(deptIDShow.equals(userDept[0][0])){
checked=" selected";
}
out.println("<option value=\""+userDept[0][0]+"\""+checked+">"+userDept[0][1]+"</option>");
for(int i=0;i<userDept.length-1;i++){
String temp[]=userDept[i];
String deptID1="";
checked="";
deptID1=userDept[i][0];
checked="";
if(deptIDShow.equals(userDept[i+1][0])){
checked=" selected";
}
if(!deptID1.equals(userDept[i+1][0])){
out.println("<option value=\""+userDept[i+1][0]+"\""+checked+">"+userDept[i+1][1]+"</option>");
}
}
%>
</select>
<br>
姓 名:
<select name="select5">
<%
for(int i=0;i<userDept.length;i++){
checked="";
if(userIDShow.equals(userDept[i][2])){
checked=" selected";
}else{
checked="";
}
if(deptIDShow.equals(userDept[i][0])){
out.println("<option value=\""+userDept[i][2]+"\""+checked+">"+userDept[i][3]+"</option>");
}
}
%>
</select></td>
<TD class="common"> 月份:
<select name="select6">
<%
checked="";
for(int i=nowYear;i>=2003;i--){
if(year!=null&&year.equals(String.valueOf(i))){
checked=" selected";
}
%>
<option value="<%=i%>"<%=checked%>><%=i%></option>
<%
}
%>
</select>
年
<select name="select7">
<%
for(int i=1;i<=12;i++){
checked="";
if(month!=null&&month.equals(String.valueOf(i))){
checked=" selected";
}
%>
<option value="<%=i%>"<%=checked%>><%=i%></option>
<%
}
%>
</select>
月 </TD>
</TR>
<TR >
<TD colSpan=2 align="center"><input name="imageField" type="image" src="/krm/jsp/permanage/image/search.gif" ></TD>
</TR>
</table>
</form>
</td>
</tr>
<tr>
<td align="center">
<table border="1" width="95%" align="center" height="40%" bordercolor="A1B7DB" class="collapse">
<tr bgcolor="9BD0F8">
<td colspan="7" class="common" >外出统计:<%=year%>年<%=month%>月</td>
</tr>
<tr align="center" bgcolor="F7FDF3">
<td width="10%" class="common">姓名 </td>
<td width="10%" class="common">处室</td>
<td width="15%" class="common">外出时间</td>
<td width="15%" class="common">外出事由</td>
<td width="35%" class="common">外出说明</td>
</tr>
<%
String content,end,memo,start,type;
String t1="",t2="",t3="",t4="",t5="";
int num;
if(r1.equals("1")){
//由部门id获得人员ID
//人员权限校验,用户对该ID有查看权
for(int i=0;i<userDept.length;i++){
if(dept.equals(userDept[i][0])){
userIDShow=userDept[i][2];
userNameShow=userDept[i][3];
deptName=userDept[i][1];
timeOutGoingRecordSet=timeManage.getOutByMonth(userIDShow,year+"-"+month);
while(timeOutGoingRecordSet.next()){
content=timeOutGoingRecordSet.getOUT_content();
end=timeOutGoingRecordSet.getOUT_end();
memo=timeOutGoingRecordSet.getOUT_memo();
start=timeOutGoingRecordSet.getOUT_start();
type=timeOutGoingRecordSet.getOUT_type();
if(start.equals(end)){
if(type==null||type.trim().equals("")){
t3=start.trim().substring(5,10)+"整天";
}else if(type.equals("1")){
t3=start.substring(5,10)+"上午";
}else{
t3=end.substring(5,10)+"下午";
}
}else{
t3=start.trim().substring(5,10)+"到"+end.substring(5,10);
}
t4= content;
t5=memo;
%>
<tr align="center">
<td class="common"><%=userNameShow%></td>
<td class="common"><%=deptName%></td>
<td class="common"><%=t3%></td>
<td class="common"><%=t4%></td>
<td class="common"><%=t5%></td>
</tr>
<%
}
}
}
}else if(r1.equals("2")){
//人员权限校验,用户对该ID有查看权
if(!userPurviewManage.havePurview(userList,userIDShow)){
response.sendRedirect("/krm/jsp/diary/noPopedom.htm");
return;
}
self=userDeptManage.getName(userIDShow);
userNameShow=self[3];
deptName=self[1];
timeOutGoingRecordSet=timeManage.getOutByMonth(userIDShow,year+"-"+month);
while(timeOutGoingRecordSet.next()){
content=timeOutGoingRecordSet.getOUT_content();
end=timeOutGoingRecordSet.getOUT_end();
memo=timeOutGoingRecordSet.getOUT_memo();
start=timeOutGoingRecordSet.getOUT_start();
type=timeOutGoingRecordSet.getOUT_type();
if(start.equals(end)){
if(type==null||type.trim().equals("")){
t3=start.trim().substring(5,10)+"整天";
}else if(type.equals("1")){
t3=start.substring(5,10)+"上午";
}else{
t3=end.substring(5,10)+"下午";
}
}else{
t3=start.trim().substring(5,10)+"到"+end.substring(5,10);
}
t4= content;
t5=memo;
%>
<tr align="center">
<td class="common"><%=userNameShow%></td>
<td class="common"><%=deptName%></td>
<td class="common"><%=t3%></td>
<td class="common"><%=t4%></td>
<td class="common"><%=t5%></td>
</tr>
<%
}
}
%>
</table></td>
</tr>
</table>
<br>
<%}else{%>
<table width="100%" align="center" height="20%" bordercolor="A1B7DB" class="collapse">
<tr bgcolor="3366CC">
<td class="common" align="center"><font color="#FFFFFF">系统信息!</font></td>
</tr>
<tr>
<td class="common" bgcolor="D4E8F4" align="center">您没有可以查看的数据!</td>
</tr>
</table>
<%}%>
</fieldset>
</td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -