You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gzf/WebRoot/admin/adslist.jsp

157 lines
4.5 KiB

5 years ago
<%@ page language="java" import="com.app.utils.DB" pageEncoding="UTF-8"%>
<%@ page language="java" import="java.sql.ResultSet" %>
<%@ page language="java" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
DB db = new DB();
db.open();
ResultSet rs = db.executeQuery("SELECT * FROM ads");
Object message = request.getAttribute("message");
%>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>公共租赁住房租赁管理系统</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<!-- App favicon -->
<link rel="shortcut icon" href="<%=basePath %>static/assets/images/favicon.ico">
<!-- plugins -->
<link href="<%=basePath %>static/assets/libs/flatpickr/flatpickr.min.css" rel="stylesheet" type="text/css" />
<!-- App css -->
<link href="<%=basePath %>static/assets/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<link href="<%=basePath %>static/assets/css/icons.min.css" rel="stylesheet" type="text/css" />
<link href="<%=basePath %>static/assets/css/app.min.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="box">
<h2>滚播图管理</h2>
<% if(message!=null){ %>
<div class="nNote nInformation hideit">
<p>
<strong>SUCCESS: </strong><%=message %>.
</p>
</div>
<% } %>
<div class="widget">
<table cellpadding="0" cellspacing="0" width="100%" class="sTable">
<thead>
<tr>
<td>编号</td>
<td>广告名称</td>
<td>广告URL</td>
<td>图片</td>
<td>添加时间</td>
<td>操作</td>
</tr>
</thead>
<tbody>
<%
while(rs.next())
{
%>
<tr>
<td><%=rs.getString("id") %></td>
<td><%=rs.getString("title") %></td>
<td><%=rs.getString("URL") %></td>
<td>
<a target="_blank" href="<%=basePath%><%=rs.getString("thumb") %>">
查看
</a>
</td>
<td><%=rs.getString("created") %></td>
<td>
<a href="<%=basePath%>admin/ads/edit.do?id=<%=rs.getString("id")%>">
更新
</a>
<a href="<%=basePath%>admin/ads/delete.do?id=<%=rs.getString("id")%>">
删除
</a>
</td>
</tr>
<% } %>
</tbody>
</table>
</div>
</div> <!-- Vendor js -->
<script src="<%=basePath %>static/assets/js/vendor.min.js"></script>
<!-- optional plugins -->
<script src="<%=basePath %>static/assets/libs/moment/moment.min.js"></script>
<script src="<%=basePath %>static/assets/libs/apexcharts/apexcharts.min.js"></script>
<script src="<%=basePath %>static/assets/libs/flatpickr/flatpickr.min.js"></script>
<!-- page js -->
<script src="<%=basePath %>static/assets/js/pages/dashboard.init.js"></script>
<!-- App js -->
<script src="<%=basePath %>static/assets/js/app.min.js"></script>
<script src="<%=basePath %>static/js.js"></script>
<script>
$(document).ready(function(){
loadRegion("province",1);
loadRegion("city",${user.pid});
loadRegion("area",${user.cid});
$("#province,#city,#area").change(function(){
sel = $(this).next("select").attr("id");
loadRegion(sel,$(this).val());
});
})
function loadRegion(sel,parentId)
{
//sel=="city"?$("#area").html(""):false
$("#"+sel).html("");
$.get("<%=basePath%>rg.sl?id="+parentId,function(e){
$("#"+sel).html(e);
sel=="city"?reload():false;
})
}
function reload()
{
sel = "area";
loadRegion(sel,$("#city").val());
}
</script>
<link href="<%=basePath %>static/toastr-master/toastr.min.css" rel="stylesheet" type="text/css" />
<script src="<%=basePath %>static/toastr-master/toastr.min.js"></script>
<script>
<c:if test="${!empty state }">
toastr.${state}('${message}', '提示');
setTimeout(function(){
window.location.href = "<%=basePath%>${url}";
},1500)
</c:if>
</script>
</body>
</html>