forked from maxliaops/Java_Web_Examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnewsman.jsp
More file actions
135 lines (129 loc) · 5.39 KB
/
Copy pathnewsman.jsp
File metadata and controls
135 lines (129 loc) · 5.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<%@ page contentType="text/html; charset=gb2312" %>
<%@ page import="java.util.Iterator"%>
<%@ page import="java.util.Collection"%>
<%@ page import="java.sql.*"%>
<%@ page import="java.text.SimpleDateFormat"%>
<%@ page import="electric.dbs.Dbnews"%>
<%@ page import="electric.dbs.news"%>
<%@ page import="electric.dbs.Newsdb"%>
<%@ page import="electric.dbs.Dbshop"%>
<%@ page import="electric.dbs.Shopdb"%>
<%@ page import="electric.dbs.shop"%>
<%@ page import="electric.electricUtils.ParamUtils"%>
<%@ page import="electric.electricUtils.DbConnectionManager"%>
<%
Newsdb newse=new Newsdb();
int countpage=newse.selectsql(5);
shop pt=(shop)session.getAttribute("USERPO");
if(pt==null)
{
response.sendRedirect("login.jsp");
}
int type=pt.getUsertype();
if(type==1)
{
out.print("对不起,您没有这个权限!");
}
else
{
%>
<html>
<head>
<title>公告管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="style.css" rel="stylesheet">
</head>
<body>
<table width="777" height="172" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><table width="777" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><img src="Images/tiring-room/tiring-room_01.gif" width="777" height="125"></td>
</tr>
<tr>
<td height="47" valign="top" background="Images/tiring-room/tiring-room_02.gif"><jsp:include page="H_navigation.jsp"/></td>
</tr>
</table></td>
</tr>
</table>
<table width="777" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="44" height="380" valign="top"><img src="Images/tiring-room/tiring-room_03.gif" width="44" height="248"></td>
<td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="68" colspan="2" background="Images/tiring-room/h_bbs.gif"> </td>
</tr>
<tr>
<td width="4%"> </td>
<td width="96%">
<table width="100%" border="0" cellspacing="-2" cellpadding="-2" height="30">
<tr>
<td width="43%">
</td>
<td width="35%">
</td>
<td width="22%"><div align="right"><a href="news_add.jsp"><img src="Images/list.gif" width="11" height="13" border="0">添加公告</a> </div></td>
</tr>
</table>
<table width="671" height="74" border="1" cellpadding="0" cellspacing="0"
bordercolor="#FFFFFF" bordercolorlight="#FFFFFF" bordercolordark="#82664F">
<td width="54" height="20" align="center">编号</td>
<td width="215" height="20" align="center">公告主题</td>
<td width="94" height="20" align="center">发布人</td>
<td width="88" height="20" align="center">发布时间</td>
<td height="20" width="132" align="center">修改/删除</td>
<%
int pa=ParamUtils.getIntParameter(request,"pa",1);
int spa=pa-1;
if(spa<1)
{
spa=1;
}
int xpa=pa+1;
if(xpa>countpage)
{
xpa=countpage;
}
Newsdb newsdb=new Newsdb();
Collection coll=newsdb.select(5,pa);
if (coll == null || coll.isEmpty()) {
System.out.println("coll is null");
} else {
Iterator it = coll.iterator();
while (it.hasNext()) {
news b2 = (news) it.next();
%>
<tr>
<td height="20" align="center" width="54"><%=b2.getId()%></td>
<td height="20" align="center" width="215"><%=b2.getMotif()%></td>
<td height="20" align="center" width="94"><%=b2.getKithepeople()%></td>
<td height="20" align="center" width="88"><%=b2.getCreateDate().substring(0,4)%>年<%=b2.getCreateDate().substring(4,6)%>月<%=b2.getCreateDate().substring(6,8)%></td>
<td height="20" align="center" width="132"><A
href="modifynews.jsp?id=<%=b2.getId()%>">
<img src="Images/modify.gif" width="20" height="18" border="0">
</a>
<A
href="news_add2.jsp?id=<%=b2.getId()%>&pageaction=delete&responsepage=newsman.jsp"> <img src="Images/del.gif" width="22" height="22" border="0"></a></td>
</tr>
<%}}%>
</table>
<table width="100%" border="0" cellspacing="-2" cellpadding="-2" height="20">
<tr>
<td width="20%"> </td>
<td width="80%"><div align="right">
<a href="newsman.jsp?pa=1">第一页</a>
<a href="newsman.jsp?pa=<%=spa%>">上一页</a>
<a href="newsman.jsp?pa=<%=xpa%>">下一页</a>
<a href="newsman.jsp?pa=<%=countpage%>">最后一页</a></div></td>
</tr>
</table>
</td>
</tr>
</table></td>
<td width="35" valign="top"><img src="Images/tiring-room/tiring-room_05.gif" width="35" height="248"></td>
</tr>
</table>
<jsp:include page="copyright.htm"/>
<%}%>
</body>
</html>