📄 depplan.jsp
字号:
<%--查看本部门的员工的任务信息--%>
<%@ page language="java" import="java.util.*,java.sql.*" pageEncoding="gb2312"%>
<%--部门管理员在分配任务时将分配给员工的任务插入到mywork表中--%>
<%@ page import="oabean.depPlanBean"%>
<%@ page import="oabean.database"%>
<jsp:useBean id="pagecount" class="oabean.pageInfo" scope="page"/>
<jsp:useBean id="getPages" class="oabean.pages" scope="page"/>
<jsp:useBean id="date" class="oabean.date" scope="page"/>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>show departmentPlan</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
<style type="text/css" media="all">
@import "admin/Upimg/thickbox.css";
@import "css/pages.css";
</style>
<script src="admin/Upimg/jquery-1.1.3.1.pack.js" type="text/javascript"></script>
<script src="admin/Upimg/thickbox-compressed.js" type="text/javascript"></script>
<script src="admin/Upimg/global.js" type="text/javascript"></script>
</head>
<body>
<%
String username=(String)session.getAttribute("user");
// if(username==null) {response.sendRedirect("../index.jsp");}
int pageNow=1;//初始页
int pageSize=4;//一页显示多少条记录
String s="";
ResultSet rs=null;
String pagenow=request.getParameter("pageNow");//接收页码
String sel=request.getParameter("select");
if(pagenow!=null&&pagenow!="")
{
pageNow=Integer.parseInt(pagenow);
}
String sql= "select top "+pageSize+" * from oa_depPlan where wpId not in(select top "+pageSize*(pageNow-1)+" wpId from oa_depPlan )";
String Countsql="select count(*) from oa_depPlan";
//这里是查询具体部门的员工任务信息
if((sel!=null&&sel!=""))
{
if(sel.equals("1"))
{
sql="select top "+pageSize+" * from oa_depPlan where depName='管理部' and wpId not in(select top "+pageSize*(pageNow-1)+" wpId from oa_depPlan where depName='管理部')";
Countsql="select count(*)from oa_depPlan where depName='管理部'";
}
else if(sel.equals("2"))
{
sql="select top "+pageSize+" * from oa_depPlan where depName='财务部' and wpId not in(select top "+pageSize*(pageNow-1)+" wpId from oa_depPlan where depName='财务部')";
Countsql="select count(*)from oa_depPlan where depName='财务部'";
}
else if(sel.equals("3"))
{
sql="select top "+pageSize+" * from oa_depPlan where depName='技术部' and wpId not in(select top "+pageSize*(pageNow-1)+" wpId from oa_depPlan where depName='技术部')";
Countsql="select count(*)from oa_depPlan where depName='技术部'";
}
else if(sel.equals("4"))
{
sql="select top "+pageSize+" * from oa_depPlan where depName='人事部' and wpId not in(select top "+pageSize*(pageNow-1)+" wpId from oa_depPlan where depName='人事部')";
Countsql="select count(*)from oa_depPlan where depName='人事部'";
}
}
int pageCount=pagecount.getpageCount(Countsql,pageSize);//得到总共有多少页
int rowCount=pagecount.getrowCount(Countsql);//得到总共有多少条记录
ArrayList a1=getPages.getDepPlan(sql);//得到分页信息
%>
<form action="admin/depplan.jsp" method="post" name="student">
<table width="100%" class="topList" cellSpacing=1 align="center" border=0>
<tr>
<td align="center" colspan="10"><div align="center" class="STYLE3">
<select name="select" size="1">
<option value="">请选择部门名</option>
<option value="1">管理部</option>
<option value="2">财务部</option>
<option value="3">技术部</option>
<option value="4">人事部</option>
</select>
<input type="submit" name="ns" value="搜索"></div>
</td>
<tr>
<td scope="col"><div align="center" class="STYLE1">任务号</div></td>
<td scope="col"><div align="center" class="STYLE1">部门名</div></td>
<td scope="col"><div align="center" class="STYLE1">任务标题</div></td>
<td scope="col"><div align="center" class="STYLE1">完成时间</div></td>
<%
for(int i=0;i<a1.size();i++)
{
oabean.database db=new oabean.database();
oabean.depPlanBean St=(oabean.depPlanBean)a1.get(i);
int wpid=St.getWpId();
%>
<tr>
<td align="center"><%=St.getWpId()%></td>
<td align="center"><%=St.getDepName()%></td>
<td align="center"><a href="admin/wpplan.jsp?wpid=<%=wpid%>&modal=true" class="thickbox" style="text-decoration:none"><%=St.getTitle()%></a></td>
<td align="center"><%=St.getDateTime().substring(0,10)%></td>
<%
}
%>
<tr>
<td colspan="10">
<ul id="nav">
共有<span class="STYLE2"><%=rowCount%></span>条记录
<%
out.println("<li><a href=admin/depplan.jsp?pageNow=1&&select="+sel+" style='text-decoration:none'>首</a></li>");
if(pageNow!=1)
{
out.println("<li><a href=admin/depplan.jsp?pageNow="+(pageNow-1)+"&&select="+sel+" style='text-decoration:none'>«</a></li>");
}
for(int j=1;j<=pageCount;j++)
{
out.println("<li><a href=admin/depplan.jsp?pageNow="+j+"&&select="+sel+" style='text-decoration:none'>["+j+"]</a></li>");
}
if(pageNow!=pageCount)
{
out.println("<li><a href=admin/depplan.jsp?pageNow="+(pageNow+1)+"&&select="+sel+" style='text-decoration:none'>»</a></li>");
}
out.println("<li><a href=admin/depplan.jsp?pageNow="+pageCount+"&&select="+sel+" style='text-decoration:none'>末</a></li>");
%>
<span class="STYLE2"><% out.println(pageNow+"/"+pageCount);%></span>
</ul>
</td>
</tr>
</table>
</form>
<form action="admin/depplan.jsp"> 跳转到第<input type="text" name="pageNow" size="8">页
<input type="hidden" name="select" value="<%=sel%>">
<input type="submit" value="Go">
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -