⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 adminedit.jsp

📁 这个是使用JSP、JDBC技术构架一个关于JAVA语言的BBS讨论区
💻 JSP
字号:
<%--
File Name:edit.jsp
Author:fancy
Date:2001.6.1
Usage:edit this topic
Address:Peking University 37#215,62762526,fancyrainbow@263.net,bbs.pku.edu.cn(id:javalover)
Note:1.这是一个Open Source项目,你可以自由的获取,修改,传播本项目的代码,无需经过本人的同意。
     2.你不可以将本项目的源代码用于商业应用,除非获得本人的书面允许。
     3.本项目的核心源代码所有权归原开发者所有,如果需要获取最新的核心代码,请与本人联系
--%>
<%@ include file="requirelogin.jsp"%>
<%@ include file="database.jsp" %>

<%
//设定Session,可能用不上
session.putValue("prevlink","");
session.putValue("nextlink","");
session.putValue("firstlink","");
session.putValue("lastlink","");
session.putValue("editlink","");
session.putValue("deletelink","");
session.putValue("backlink","");
%>

<%
String _tempgroup=(String)session.getValue("admingroup");
String _engroup=request.getParameter("engroup");
if(_tempgroup.equals("SYSOP")==true)
{
	_tempgroup=_engroup;
}
if(_engroup.equals(_tempgroup)!=true)//如果管理员的权限不包括当前的讨论区
{
	response.sendRedirect("i_admin.jsp");
	//out.println(tempgroup);
}
%>

<%
String username=request.getParameter("username");
String password=request.getParameter("password"); 
String content=request.getParameter("content"); 
String id=request.getParameter("id");
content=content+"\r\n (modify-by-"+username+")";
%>

<%
java.sql.Statement stmttemp=conn.createStatement();
String _SQL="SELECT * FROM forumgroup where adminusername='"+username+"'";
ResultSet rstemp=stmttemp.executeQuery(_SQL);
rstemp.last();
int _lastrow=rstemp.getRow();
if(_lastrow!=0)//是版主,获取部分Admin权限
{
}
else
{
	response.sendRedirect("i_admin.jsp");
	//out.println(tempgroup);
}
stmttemp.close();
%>

<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>Java论坛</title>
</head>
<%@ include file="defaultcss.jsp"%>
<%@ include file="menuaction.jsp"%>


<%
java.sql.Statement stmtlist=conn.createStatement(ResultSet.TYPE_FORWARD_ONLY,ResultSet.CONCUR_UPDATABLE);
//String SQL="SELECT * FROM data where author='"+username+"'"+" and password='"+password+"' and id="+id;
String SQL="SELECT * FROM data where id="+id;
//out.println(strSQL);
boolean booCanEdit=false;
ResultSet rslist=stmtlist.executeQuery(SQL);
String groupname="";
String groupenname="";
if(rslist!=null)
{
	booCanEdit=true;
	rslist.next();
	groupname=rslist.getString(2);
	groupenname=rslist.getString(3);
	rslist.updateString(6,content);
	java.util.Date date=new java.util.Date();
	rslist.updateObject(8,date);
	rslist.updateRow();
	rslist.close();	
}
stmtlist.close();
%>

<body LANGUAGE=javascript onload="return window_onload()">
<table border="0" width="100%" height="139" cellspacing="0" cellpadding="0">
  <%@ include file="admintoptable.jsp"%>
  <tr>
    <td width="2%" height="13"></td>
    <td width="92%" height="32" colspan="5" rowspan="2">
      <div align="center">
        <center>
        <table border="0" cellpadding="0" cellspacing="0" width="80%" height="26">
          <tr bgcolor="#efefef">
            <td width="25%" height="24"></td>
            <td width="50%" height="24"  align="center"><font color="red" size="2">Java技术讨论区(发表文章)</font></td>
            <td width="25%" height="24"></td>
          </tr>
        </table>
        </center>
      </div>
    </td>
  </tr>
  <tr><td width="2%" height="13"></td></tr>
  <tr>
    <td width="2%" height="16"></td>
    <td width="2%" height="1" rowspan="18" background="img/shu.gif"></td>
    <td width="92%" height="1" colspan="5" rowspan="18">
      <div align="center">
        <center>
        <table border="0" cellpadding="0" cellspacing="1" width="99%" height="47">
	  <tr bgcolor='#DCEDED'>
	    <td width='100%' height='1' align="center">
	    <%
	    if (booCanEdit==true)
	    {
	    %>
	      <font color="red" size="2">祝贺您,<%=username%>:您已经成功地在<%=groupname%>信区修改了编号为<%=id%>的文章!</font>
	    <%
	    }
	    else
	    {
	    %>
	      <font color="red" size="2">对不起,<%=username%>:您的输入可能有误,请再试一下好吗?</font>	
	    <%
	    }
	    %>
	    </td>
	    
	  </tr>
	  <tr bgcolor='#DCDDED'>
	    <td width='100%' height='1' align="center">
	    <font color="red" size="2">回到<a href="adminlist.jsp?key=<%=groupenname%>"><%=groupname%></a>信区</font>
	    </td>
	  </tr>
        </table>
        </center>
      </div>
    </td>     
    <td width="2%" height="1" rowspan="18"></td>     
    <td width="2%" height="1" rowspan="18" background="img/shu.gif"> </td>
  </tr>
  <tr><td width="2%" height="16"></td></tr>
  <tr><td width="2%" height="16"></td></tr>
  <tr><td width="2%" height="16"></td></tr>
  <tr><td width="2%" height="16"></td></tr>
  <tr><td width="2%" height="16"></td></tr>
  <tr><td width="2%" height="16"></td></tr>
  <tr><td width="2%" height="16"></td></tr>
  <tr><td width="2%" height="16"></td></tr>
  <tr><td width="2%" height="16"></td></tr>
  <tr><td width="2%" height="16"></td></tr>
  <tr><td width="2%" height="16"></td></tr>
  <tr><td width="2%" height="16"></td></tr>
  <tr><td width="2%" height="16"></td></tr>
  <tr><td width="2%" height="16"></td></tr>
  <tr><td width="2%" height="16"></td></tr>
  <tr><td width="2%" height="16"></td></tr>
  <tr><td width="2%" height="1"></td></tr>
  <tr>
    <td width="2%" height="41" rowspan="2"></td>
    <td width="2%" height="41" background="img/shu.gif" rowspan="2"></td>
    <td width="92%" height="27" colspan="5"></td>
    <td width="2%" height="41" rowspan="2" background="img/shu.gif"></td>
    <td width="2%" height="41" background="img/shu.gif" rowspan="2"></td>
  </tr>
  <tr align="center">
    <td width="92%" height="18" colspan="5" background="img/bottom.gif"> </td>
  </tr>
</table> 
<%@ include file="adminmenu.jsp"%>
<%
conn.close();
%>
</body>                                                     
</html>                                                     

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -