集成公告、新闻发布,新闻、公告均可批量删除
This commit is contained in:
@@ -22,6 +22,13 @@ background-repeat:no-repeat;
|
||||
height:100%;
|
||||
background-size:100% 100%;
|
||||
} */
|
||||
.zczi {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.zczi2 {
|
||||
float: left;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
@@ -133,6 +140,168 @@ String str_date2 = currentTime.toString(); //将Date型日期时间转换成字
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel panel-primary">
|
||||
<div class="panel-heading">新闻专栏</div>
|
||||
<div class="panel-body">
|
||||
<%
|
||||
try {
|
||||
Class.forName("com.mysql.jdbc.Driver");
|
||||
} catch (ClassNotFoundException e) {
|
||||
out.print("驱动异常");
|
||||
}
|
||||
try {
|
||||
Connection con;
|
||||
Statement sql;
|
||||
ResultSet rs;
|
||||
con = DriverManager.getConnection(
|
||||
"jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8", "root", "");
|
||||
sql = con.createStatement();
|
||||
String condition = null;
|
||||
condition = "SELECT newsid,newtitle,addTime FROM tb_news";
|
||||
rs = sql.executeQuery(condition);
|
||||
//String k1=rs.getString(1);
|
||||
out.print("<table class='table table-striped'>");
|
||||
out.print("<tr>");
|
||||
out.print("<th>新闻标题</th>");
|
||||
out.print("<th>新闻时间</th>");
|
||||
out.print("<th>");
|
||||
out.print("</tr>");
|
||||
while (rs.next()) //输出查询结果
|
||||
{
|
||||
|
||||
out.print("<tr>");
|
||||
out.println("<TD><div>" + rs.getString(2) + "</div></TD>");
|
||||
out.print("<TD><div>" + rs.getString(3) + "</div></TD>");
|
||||
out.print("<TD><button type='button' class='btn btn-success pull-right' data-toggle='modal' data-target='.xw"
|
||||
+ rs.getString(1) + "-example-modal-lg'>查看</button></TD>");
|
||||
out.print("</tr>");
|
||||
|
||||
}
|
||||
out.print("</table>");
|
||||
con.close();
|
||||
sql.close();
|
||||
rs.close();
|
||||
} catch (SQLException e1) {
|
||||
out.print("无法查询记录");
|
||||
}
|
||||
%>
|
||||
<!-- <a class="btn btn-default" href=add.html>增加新闻</a> <a
|
||||
class="btn btn-default" href=updatechoose.jsp>修改新闻</a> <a
|
||||
class="btn btn-default" href=deleteinput.jsp>删除新闻</a> -->
|
||||
|
||||
|
||||
|
||||
<%
|
||||
try {
|
||||
Class.forName("com.mysql.jdbc.Driver");
|
||||
} catch (ClassNotFoundException e) {
|
||||
out.print("暂时无法访问");
|
||||
}
|
||||
try {
|
||||
Connection con;
|
||||
Statement sql;
|
||||
ResultSet rs;
|
||||
con = DriverManager.getConnection(
|
||||
"jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8", "root", "");
|
||||
sql = con.createStatement();
|
||||
String condition = null;
|
||||
condition = "SELECT * FROM tb_news";
|
||||
rs = sql.executeQuery(condition);
|
||||
|
||||
while (rs.next()) //输出查询结果
|
||||
{
|
||||
%>
|
||||
<div class="modal fade xw<%=rs.getString(1)%>-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>
|
||||
|
||||
<%
|
||||
out.print("<h4 class='modal-title' id='gridSystemModalLabel'> " + rs.getString(2) + "</h4></div>");
|
||||
|
||||
out.println("<div class='modal-body'><p class='lead'>" + rs.getString(3) + "</p>");
|
||||
|
||||
out.println("<p>来自:" + rs.getString(4) + "</p>");
|
||||
|
||||
out.println("<p>" + rs.getString(5) + "</p>");
|
||||
%>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default "
|
||||
data-dismiss="modal">关闭</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<%
|
||||
}
|
||||
con.close();
|
||||
sql.close();
|
||||
rs.close();
|
||||
} catch (SQLException e1) {
|
||||
out.print("无法查询记录");
|
||||
}
|
||||
%>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel panel-primary">
|
||||
<!-- Default panel contents -->
|
||||
<div class="panel-heading">公告</div>
|
||||
<div class="panel-body">
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th><marquee direction=up height=100 id=m
|
||||
onmouseout=m.start() onMouseOver=m.stop() scrollamount=2
|
||||
align="center">
|
||||
<font size=2>
|
||||
<p>
|
||||
<%
|
||||
Connection con;
|
||||
Statement sql;
|
||||
ResultSet rs;
|
||||
try {
|
||||
Class.forName("com.mysql.jdbc.Driver");
|
||||
} catch (ClassNotFoundException e) {
|
||||
out.print("驱动异常");
|
||||
}
|
||||
try {
|
||||
con = DriverManager.getConnection(
|
||||
"jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8", "root", "");
|
||||
sql = con.createStatement();
|
||||
String condition = null;
|
||||
condition = "SELECT 公告内容,公告时间 FROM notice";
|
||||
rs = sql.executeQuery(condition);
|
||||
while (rs.next()) //输出查询结果
|
||||
{
|
||||
out.print("<div><span class='zczi2'>" + rs.getString(1) + "</span>");
|
||||
|
||||
out.print("<span class='zczi'>" + rs.getString(2) + "</span></div>");
|
||||
out.println("<br/>");
|
||||
out.println("<br/>");
|
||||
}
|
||||
con.close();
|
||||
sql.close();
|
||||
rs.close();
|
||||
} catch (SQLException e1) {
|
||||
out.print("无法查询记录");
|
||||
}
|
||||
%>
|
||||
</p>
|
||||
</font>
|
||||
</marquee></th>
|
||||
</table>
|
||||
<!-- <a class="btn btn-default" href=add.html>增加公告</a> <a class="btn btn-default" href=selectupdate.jsp>修改公告</a> <a
|
||||
class="btn btn-default" href=selectdelete.jsp>删除公告</a> -->
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<%@ include file="module/footer.jsp"%>
|
||||
|
||||
Reference in New Issue
Block a user