📄 department.jsp
字号:
<%@ page language="java" import="java.util.*" pageEncoding="gb2312"%>
<%@page import="oabean.departmentBean;"%>
<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 news info</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>
<script type="text/javascript" src="/oa/js/popcalendar.js"></script>
<script language="javascript">
function sty()
{
document.getElementById("add").style.textDecoration="underline";
}
function out()
{
document.getElementById("add").style.textDecoration="blink";
}
</script>
</head>
<body>
<%
String uname=(String)session.getAttribute("user");
if(uname==null)
{
response.sendRedirect("../index.jsp");
}
int pageNow=1;//初始页
int pageSize=4;//一页显示多少条记录
String s="";
String pagenow=request.getParameter("pageNow");//接收页码
if(pagenow!=null&&pagenow!="")
{
pageNow=Integer.parseInt(pagenow);
}
String sql= "select top "+pageSize+" * from oa_department where depId not in(select top "+pageSize*(pageNow-1)+" depId from oa_department )";
String Countsql="select count(*) from oa_department";
int pageCount=pagecount.getpageCount(Countsql,pageSize);//得到总共有多少页
int rowCount=pagecount.getrowCount(Countsql);//得到总共有多少条记录
ArrayList a1=getPages.getDepartment(sql);//得到分页信息
//显示
%>
<form action="admin/department.jsp" method="post">
<table width="100%" class="topList" cellSpacing=1 align="center" border=0>
<tr>
<td scope="col"><div align="center" class="STYLE1">部门号</div></td>
<td scope="col"><div align="center" class="STYLE1">部门名</div></td>
<td scope="col" colspan="3"><div align="center" class="STYLE1">操作</div></td>
</tr>
<%
for(int i=0;i<a1.size();i++)
{
//从a1中取出noticeBean
oabean.departmentBean St=(oabean.departmentBean)a1.get(i);
%>
<tr>
<% int depid=St.getDepId();%>
<td align="center"><%=St.getDepId()%></td>
<td align="center"><%=St.getDepName()%></td>
<td align="center"><img src="images/del.gif"><a href="department/deldep.department?id=<%=depid%>" onclick="return window.confirm('您确认要删除吗?');" style="text-decoration:none">删除</a></td>
<td align="center"><img src="images/mod.gif"><a href="admin/moddep.jsp?id=<%=depid%>&modal=true" class="thickbox" style="text-decoration:none">修改</a></td>
<%
}
%>
<tr>
<td colspan="10">
<ul id="nav">
共有<span class="STYLE2"><%=rowCount%></span>条记录
<%
out.println("<li><a href=admin/department.jsp?pageNow=1 style='text-decoration:none'>首</a>");
if(pageNow!=1)
{
out.println("<li><a href=admin/department.jsp?pageNow="+(pageNow-1)+" style='text-decoration:none'>«</a>");
}
for(int j=1;j<=pageCount;j++)
{
out.println("<li><a href=admin/department.jsp?pageNow="+j+" style='text-decoration:none'>["+j+"]</a>");
}
if(pageNow!=pageCount)
{
out.println("<li><a href=admin/department.jsp?pageNow="+(pageNow+1)+" style='text-decoration:none'>»</a>");
}
out.println("<li><a href=admin/department.jsp?pageNow="+pageCount+" style='text-decoration:none'>末</a>");
%>
<span class="STYLE2"><% out.println(pageNow+"/"+pageCount);%></span>
</ul>
</td>
<td align="left"><img src="images/add.gif"><a href="admin/adddep.jsp?modal=true" class="thickbox" onmouseover="sty();" onmouseout="out();" style='text-decoration:blink'>增加</a></td>
</tr>
</table>
</form>
<form action="admin/department.jsp"> 跳转到第<input type="text" name="pageNow" size="8">页
<input type="submit" value="Go">
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -