?? 001c7555c32f001e130299acfb2391d0
字號:
<%@page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="err.jsp" %>
<%
if ((session.getValue("UserName")==null)||(session.getValue("UserClass")==null)||(!session.getValue("UserClass").equals("系統(tǒng)管理員")))
{
response.sendRedirect("err.jsp?id=14");
return;
}
%>
<html><script language="JavaScript"></script></html>
<html>
<head>
<link rel='stylesheet' type='text/css' href='inc/FORUM.CSS'>
<META NAME="keywords" CONTENT="溢洋 溢洋論壇 xyworker@163.com java forum jsp forum">
<META NAME="description" CONTENT="溢洋 溢洋論壇 xyworker@163.com java forum jsp forum">
<script language="JavaScript">
function Popup(url, window_name, window_width, window_height)
{ settings=
"toolbar=no,location=no,directories=no,"+
"status=no,menubar=no,scrollbars=yes,"+
"resizable=yes,width="+window_width+",height="+window_height;
NewWindow=window.open(url,window_name,settings); }
function CheckValue()
{
if (form1.title.value=="")
{
alert("公告標(biāo)題不能為空!");
form1.title.focus();
return false;
}
}
function icon(theicon) {
document.input.message.value += " "+theicon;
document.input.message.focus();
}
</script>
<title>溢洋論壇</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<table cellspacing="0" cellpadding="0" border="0" width="99%" align="center">
<tr>
<td bgcolor="#009ACE" width="17">
<jsp:include page="inc/public.jsp" flush="true"/>
<tr>
<td class="tablerow" colspan="7" bgcolor="#FFFFFF" height="16">
<table border="0" cellspacing="0" width="100%" cellpadding="0">
<tr>
<td width="40%" align="right"><font color="#333399"><b><a href='manager.jsp'><font color="red">公告管理</font></a></b></font></td>
<td width="20%" align="center"><font color="#333399"><b><a href='board_manager.jsp'>論壇管理</a></b></font></td>
<td width="40%" align="left"><font color="#333399"><b><a href='user_manager.jsp'>用戶管理</a></b></font></td>
</tr>
</table>
</td>
</tr>
<tr bgcolor="#9CCFFF">
<td width="17" height="14"> </td>
<td width="302" height="14" bgcolor="#9CCFFF">公告標(biāo)題</td>
<td width="172" align="center" height="14">發(fā)布時間</td>
<td width="116" align="center" height="14">修改</td>
<td width="91" align="center" height="14">刪除 </td>
</tr>
<jsp:useBean id="yy" scope="page" class="yy.jdbc"/>
<%! String Notice_Id,sql,Not_Title,Not_Content,Submit_Button;%>
<%
int PageSize=10;
int RecordCount=0;
int PageCount=0;
int ShowPage=1;
Connection con=yy.getConn();
Statement stmt=con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
ResultSet rs=null;
sql="Select * from 公告 order by 公告id desc";
// Statement stmt=con.createStatement();
rs=stmt.executeQuery(sql);
rs.last();
RecordCount=rs.getRow();
PageCount=(RecordCount % PageSize==0)?(RecordCount/PageSize):(RecordCount/PageSize+1);
String Page=request.getParameter("page");
if (Page!=null)
{
ShowPage=Integer.parseInt(Page);
if (ShowPage>PageCount)
ShowPage=PageCount;
else if(ShowPage<0)
ShowPage=1;
}else
ShowPage=1;
if (RecordCount>0)
{
rs.absolute((ShowPage-1)*PageSize+1);
for (int i=1;i<PageSize;i++)
{
Notice_Id=rs.getString("公告id");
%>
<tr bgcolor="#F7FBFF">
<td align="center" height="26" width="17"><img src="image/folder.gif" width="13" height="16"></td>
<td height="26" width="302" bgcolor="#F7FBFF"><a href="manager.jsp?modifyid=<%=Notice_Id%>">
<%=rs.getString("公告標(biāo)題")%> </a> <br />
</td>
<td align="center" height="26" width="172"><%=rs.getString("公告時間")%></td>
<td align="center" height="26" width="116"><a href='manager.jsp?modifyid=<%=Notice_Id%>'>修改</a></td>
<td align="center" height="26" width="91"><a href='querymanager.jsp?deleteid=<%=Notice_Id%>' onclick="{if(confirm('確定刪除選定的紀(jì)錄嗎?')){return true;}return false;}">刪除</a></td>
</tr>
<%
if (!rs.next())
break;
}
}
%>
<tr bgcolor="#F7FBFF">
<form method="POST" action="manager.jsp">
<td align="center" height="10" width="17"> </td>
<td colspan="6" height="10" align="right">
現(xiàn)在是第 <font color=black ><%=ShowPage%></font> 頁 轉(zhuǎn)到
<select size="1" name="page">
<%
for (int i=1;i<=PageCount;i++)
{
out.println(" <option value="+i+">"+i+"頁</option>");
}
%>
</select>
<input type="submit" value="go" name="B1">
</td>
</tr>
</form>
<%
String Modify_Id=request.getParameter("modifyid");
if (Modify_Id!=null)
{
sql="select * from 公告 where 公告id="+Modify_Id;
rs=stmt.executeQuery(sql);
while(rs.next())
{
Not_Title=rs.getString("公告標(biāo)題");
Not_Content=rs.getString("公告內(nèi)容");
Submit_Button="修改";
}
}else
{
Modify_Id="0";
Not_Title="";
Not_Content="";
Submit_Button="新增";
}
%>
<tr bgcolor="#F7FBFF">
<form method="POST" name="form1" action="querymanager.jsp">
<td align="center" height="10" width="17"> </td>
<td colspan="6" height="10" align="right" valign="middle">
<div align="left"></div>
<div align="center">公告標(biāo)題
<input type="text" name="title" value="<%=Not_Title%>">
<input type="hidden" name="noticeid" value="<%=Modify_Id%>">
內(nèi)容:
<textarea name="content" cols="50" rows="3"><%=Not_Content%></textarea>
<input type="submit" name="Submit" onclick='return CheckValue()'; value="<%=Submit_Button%>">
<input type="reset" name="Submit2" value="重置">
</div>
</form>
</td>
</tr>
</table>
<jsp:include page="inc/jumpboard.jsp" flush="true"/>
<html><script language="JavaScript"></script></html>
<jsp:include page="inc/online.jsp" flush="true"/>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -