.
This commit is contained in:
@@ -14,11 +14,23 @@
|
||||
<link rel="stylesheet" href="css/bootstrap.min.css" type="text/css">
|
||||
<link rel="stylesheet" href="css/footer.css" type="text/css">
|
||||
<script src="js/ie-emulation-modes-warning.js"></script>
|
||||
<style type="text/css">
|
||||
.main_content {
|
||||
text-indent: 2em
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<%@ include file="/module/top.jsp"%>
|
||||
<div class="container">
|
||||
<%
|
||||
if (session.getAttribute("actualuser") == null) {
|
||||
out.println("<script>alert('登录超时 (1440 秒未活动)或未登录,请重新登录。');window.location.href='index.html';</script>");
|
||||
return;
|
||||
}
|
||||
Object actualuser = session.getAttribute("actualuser");
|
||||
%>
|
||||
<h1 class="heading_title_text text-center">查看管理员</h1>
|
||||
<div class="row">
|
||||
<%@ include file="module/sidebar.jsp"%>
|
||||
@@ -40,7 +52,7 @@
|
||||
</tr>
|
||||
<%
|
||||
String driverClass = "com.mysql.jdbc.Driver";
|
||||
String url = "jdbc:mysql://localhost:3306/db_school";
|
||||
String url = "jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8";
|
||||
String user = "root";
|
||||
String password = "";
|
||||
ResultSet rs = null;
|
||||
@@ -67,11 +79,7 @@
|
||||
ex.printStackTrace();
|
||||
}
|
||||
%>
|
||||
<%
|
||||
sql.close();
|
||||
rs.close();
|
||||
conn.close();
|
||||
%>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
<div class="admin_btn pull-right">
|
||||
@@ -80,25 +88,76 @@
|
||||
</a> <a href="change_admin.jsp">
|
||||
<button type="button" class="btn btn-primary">修改管理员</button>
|
||||
</a>
|
||||
<!-- Button trigger modal -->
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal"
|
||||
data-target=".bs-example-modal-lg">查看总表</button>
|
||||
|
||||
<!-- Modal -->
|
||||
<div class="modal fade bs-example-modal-lg" tabindex="-1"
|
||||
role="dialog" aria-labelledby="myLargeModalLabel">
|
||||
<div class="modal-dialog modal-lg" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal"
|
||||
aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="myModalLabel">管理员与职责总表</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped">
|
||||
<tr>
|
||||
<td class="col-md-1">管理员号</td>
|
||||
<td class="col-md-2">管理员名</td>
|
||||
<td class="col-md-1">性别</td>
|
||||
<td class="col-md-2">岗位</td>
|
||||
<td class="col-md-6">职责</td>
|
||||
</tr>
|
||||
<%
|
||||
try {
|
||||
Class.forName(driverClass);
|
||||
conn = DriverManager.getConnection(url, user, password);
|
||||
Statement stmt = conn.createStatement();
|
||||
sql = conn.prepareStatement("select * from admin_view");
|
||||
rs = sql.executeQuery();
|
||||
while (rs.next()) {
|
||||
%>
|
||||
<tr>
|
||||
<td><%=rs.getString("AdminNo")%></td>
|
||||
<td><%=rs.getString("AdminName")%></td>
|
||||
<td><%=rs.getString("AdminSex")%></td>
|
||||
<td><%=rs.getString("AdminJob")%></td>
|
||||
<td class="main_content"><%=rs.getString("AdminDuty")%></td>
|
||||
</tr>
|
||||
<%
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
%>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default"
|
||||
data-dismiss="modal">关闭</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Footer -->
|
||||
<div class="footer">
|
||||
|
||||
<!-- Copyright -->
|
||||
<div class="copyright">
|
||||
<p>
|
||||
© 2016 学生信息管理系统. All Rights Reserved | Design by <a
|
||||
href="http://blog.sina.com.cn/u/2007780675">F嘉阳</a>
|
||||
</p>
|
||||
</div>
|
||||
<!-- //Copyright -->
|
||||
|
||||
</div>
|
||||
<!-- //Footer -->
|
||||
<%
|
||||
sql.close();
|
||||
rs.close();
|
||||
conn.close();
|
||||
%>
|
||||
<%@ include file="module/footer.jsp"%>
|
||||
</div>
|
||||
</div>
|
||||
<script src="js/jquery-1.11.2.min.js" type="text/javascript"></script>
|
||||
|
||||
Reference in New Issue
Block a user