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

📄 showdept.jsp

📁 实现统一的人员日志管理系统管理后台
💻 JSP
字号:
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="com.tb.log.model.po.Dept"%>
<%@page import="com.tb.log.util.pages.PageBean"%>
<%@ taglib uri="/WEB-INF/c-rt.tld" prefix="c" %>
<%
	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>My JSP 'showdept.jsp' starting page</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<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>
<!--
BODY {
	FONT-SIZE: 14px;
	FONT-FAMILY: 宋体;
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
}

A {
	FONT: 12px 宋体;
	COLOR: #000000;
	TEXT-DECORATION: none
}

A:hover {
	COLOR: #428eff
}

TD {
	FONT-SIZE: 12px;
	LINE-HEIGHT: 15px;
	FONT-FAMILY: 宋体
}

TH {
	FONT-WEIGHT: bold;
	FONT-SIZE: 12px;
	BACKGROUND-IMAGE: url(images/admin_bg_1.gif);
	COLOR: white;
	BACKGROUND-COLOR: #4455aa
}



.tableBorder {
	BORDER-RIGHT: #6595d6 1px solid;
	BORDER-TOP: #6595d6 1px solid;
	BORDER-LEFT: #6595d6 1px solid;
	BORDER-BOTTOM: #6595d6 1px solid;
	BACKGROUND-COLOR: #BAD6EE
}

INPUT {
	FONT-SIZE: 12px;
	LINE-HEIGHT: 15px;
	FONT-FAMILY: Tahoma, Verdana, 宋体
}

SELECT {
	FONT-SIZE: 12px;
	LINE-HEIGHT: 15px;
	FONT-FAMILY: Tahoma, Verdana, 宋体
}

.div_navi {
	background-image: url(left.files/pic90.gif);
	width: 1025px;
	font-size: 14px;
	font-weight: normal;
	position: absolute;
	height: 30px;
	text-align: left;
	line-height: 30px;
}

TEXTAREA {
	FONT-SIZE: 12px;
	LINE-HEIGHT: 15px;
	FONT-FAMILY: Tahoma, Verdana, 宋体;
}

.STYLE3 {
	font-size: 18px;
}

.div_body {
	font-family: "宋体";
	font-size: 16px;
	font-weight: normal;
	color: #FFFFFF;
	background-color: #FFFFFF;
	position: absolute;
	width: 90%;
	left: 32px;
	top: 88px;
	text-align: center;
}

.div_body_table {
	height: 100%;
	width: 100%;
	border: 1px solid #003366;
}

.STYLE4 {
	font-size: 18
}

.table {
	font-family: "宋体";
	font-size: 14px;
	text-align: center;
	height: 100%;
	width: 100%;
	border: 1px;
	background: #CCCCCC;
}

.submit_text {
	height: 100%;
	width: 100%;
}

.div_find {
	height: 38px;
	width: 90%;
	position: absolute;
	font-size: 16px;
	top: 45px;
	vertical-align: middle;
	left: 33px;
}

.div_find_table {
	height: 100%;
	width: 100%;
}
-->
</STYLE>

		<META content="MSHTML 6.00.2900.2180" name=GENERATOR>
	</HEAD>
<script type="text/javascript">
	function submitByPage(n){
	document.getElementById('page').value=n;
 	 document.getElementById('form1').submit();
  } 
</script>
	<BODY bottomMargin=0 gcolor="#EEF4FF" gColor=#ddeeff>
		
		<div class="div_navi">
			&nbsp;当前位置:部门管理&gt;&gt;查看部门
		</div>
		<div class="div_find ">
			<form method="post" action="dept.do?type=findByCon" id="form1" name="form1">
			<!-- 该表单用于模糊查询及条件查询 -->
				<table bgcolor="#D6DFF7" class="div_find_table">
					<tr>
						<td width="125">
							<span class="STYLE5">请选择查询条件:</span>
						</td>
						<td width="154">
							<span class="STYLE5">部门级数
									<select name="dept_grade">
										<option value="">所有</option>
										<%
										 String grade[] = {"1","2","3"}; 
										String dept_grade =(String)request.getAttribute("dept_grade");
										
									//	System.out.println(dept_grade);
										for(int i=0;i<grade.length;i++){
										 %>
										<option value="<%=grade[i] %>" 
										<% if(grade[i].equals(dept_grade)){out.print("selected");} %>
										><%=grade[i] %></option>
										<%
										 }%>
									</select>
								</span>
						</td>
						<td width="129">
							<span class="STYLE5">部门状态 <label>
									<select name="dept_state">
										<option value="">所有</option>
										<% String state[] = {"标一","标二","标三","标四"}; 
										
										for(int i=0;i<state.length;i++){ %>
										<option value="<%=state[i] %>"
										<%if(state[i].equals(request.getAttribute("dept_state"))){out.print("selected");} %>><%=state[i] %></option>
										<% }%>
									</select>
								</label> </span>
						</td>
						<td width="358">
							<span class="STYLE5">父部门 <label>
									<input name="supper_id" type="text" id="supper_id" size="17" value="${supper_id }">
									本部门
									<input name="dept_name" type="text" id="dept_name" size="17" value="${dept_name }">
								</label> </span>
						</td>
						<td width="210">
							<span class="STYLE5"> <label>
							<input  type="hidden" value="${pg.currentPage }" id="page" name=page>
									<input type="submit" value="搜索">
								</label> </span>
								
						</td>
					</tr>
				</table>
			</form>
		</div>
		<div class="div_body">
			<form action="" method="post">
				<table border="1" align="right" cellspacing="" class="table">

					<tr>
						<td height="38" colspan="6" align="center" bgcolor="#D6DFF7">
							<p align="center" class="STYLE3">
								部门列表
							</p>
						</td>
					</tr>
					<tr>
						<td width="14%" height="38" bgcolor="#799AE1">
							<p>
								部门名称
							</p>
						</td>
						<td width="12%" bgcolor="#799AE1">
							<p>
								部门级数
							</p>
						</td>
						<td width="12%" bgcolor="#799AE1">
							<p>
								所属部门
							</p>
						</td>
						<td width="22%" bgcolor="#799AE1">
							<p>
								部门介绍
							</p>
						</td>
						<td width="13%" bgcolor="#799AE1">
							<p>
								当前状态
							</p>
						</td>
						<td width="16%" bgcolor="#799AE1">
							<p>
								相关操作
							</p>
						</td>
					</tr>

					<%
						List deptList = (List) request.getAttribute("deptList");
						Dept dept = null;
						String color[] = { "#FFFFFF", "#EDF5FD" };
						for (int i = 0; i < deptList.size(); i++) {
							dept = (Dept) deptList.get(i);
							//int dept_grade = dept.getDept_grade();
							//System.out.println("dept:"+dept_grade);
					%>
					<tr>
						<td height="38" bgcolor=<%=color[i % 2]%>><%=dept.getDept_name()%></td>
						<td bgcolor="<%=color[i % 2]%>"><%=dept.getDept_grade()%></td>
						<td bgcolor="<%=color[i % 2]%>"><%=dept.getSupper_id()%></td>
						<td bgcolor="<%=color[i % 2]%>"><%=dept.getDept_desc()%></td>
						<td bgcolor="<%=color[i % 2]%>"><%=dept.getDept_state()%></td>
						<td bgcolor="<%=color[i % 2]%>">
							<A
								href="dept.do?type=subDept&dept_id=<%=dept.getDept_id() %>">创建子部门</A>&nbsp;/&nbsp;
							<a href="dept.do?type=delete&dept_id=<%=dept.getDept_id()%>"
								onclick='return window.confirm("您真的要删除吗?");'>删除</a>&nbsp;/&nbsp;
							<a
								href="dept.do?type=getedit&dept_id=<%=dept.getDept_id() %>">查看
							</a>
						</td>
					</tr>
					<%}%>
					<tr>
						<%PageBean pg = (PageBean) request.getAttribute("pg");%>
						<td height="38" colspan="6" bgcolor="#D6DFF7">
							<div align="right">
								当前第${pg.currentPage }页/总共${pg.totalPages}页&nbsp;&nbsp;共${pg.totalResults}条记录
								<a href="javascript:void(-1)" onclick="submitByPage(1)">首页</a>&nbsp;&nbsp;
								<%if (pg.hasPreviousPage()) {%>
								<a href="dept.do?type=findByCon&page=${pg.currentPage-1 }&dept_state=${dept_state }&dept_grade=${dept_grade }&dept_name=${dept_name }&supper_id=${supper_id }">上一页</a>&nbsp;&nbsp;
								<%}if (pg.hasNextPage()){%>
								<a href="dept.do?type=findByCon&page=${pg.currentPage+1 }&dept_state=${dept_state }&dept_grade=${dept_grade }&dept_name=${dept_name }&supper_id=${supper_id }">下一页</a>
								&nbsp;&nbsp;<%}%>
								<a href="dept.do?type=findByCon&page=${pg.totalPages}&dept_state=${dept_state }&dept_grade=${dept_grade }&dept_name=${dept_name }&supper_id=${supper_id }">尾页</a>&nbsp;
								到第
								<select name="currentPage" id="currentPage" onchange="nextPage()">
								  <c:forEach var="i" begin="0" end="${pg.totalPages}">
								  <c:choose>
									 <c:when test="${pg.currentPage==i}">
									 <option value="${i}" selected>${i}</option></c:when>
									 <c:otherwise>
									 <option value="${i}">${i}</option>
									 </c:otherwise>
								  </c:choose> 
								  </c:forEach>
								</select>
							</div>
						</td>
					</tr>
				</table>
			</form>
		</div>
	</BODY>
</HTML>

⌨️ 快捷键说明

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