admin_link.jsp
上传用户:toby834
上传日期:2013-10-21
资源大小:2613k
文件大小:9k
源码类别:

Jsp/Servlet

开发平台:

Java

  1. <%@ page contentType="text/html;charset=GBK"%>
  2. <%@ include file="INC/const.jsp"%>
  3. <%@ page import = "java.util.Vector,
  4. net.acai.forum.admin.*"%>
  5. <title><%=forumName%>--管理页面</title>
  6. <link rel="stylesheet" type="text/css" href="forum.css">
  7. <BODY bgcolor="#ffffff" alink="#333333" vlink="#333333" link="#333333" topmargin="20">
  8. <%
  9. try{
  10. if(session.getAttribute("adminFlag")==null)
  11. throw new Exception("本页面为管理员专用,请<a href=elogin.jsp>登陆管理</a>后进入。");
  12. String action=ParamUtil.getString(request,"action");
  13. %>
  14. <table cellpadding=0 cellspacing=0 border=0 width=95% bgcolor=<%=aTableBackColor%> align=center>
  15.   <tr>
  16.     <td>
  17.       <table cellpadding=3 cellspacing=1 border=0 width=100%>
  18.         <tr bgcolor='<%=aTableTitleColor%>'>
  19.         <td align=center colspan="2">欢迎<b><%=session.getAttribute("adminName")%></b>进入管理页面
  20.         </td>
  21.         </tr>
  22.             <tr bgcolor=<%=tableBodyColor%>>
  23.               
  24.           <td width="20%" valign=top> 
  25.              <%@include file="admin_left.jsp"%>
  26.             </td>
  27.               
  28.           <td width="80%" valign=top>
  29. <%
  30. /*if request("action") = "add" then 
  31. call addlink()
  32. elseif request("action")="edit" then
  33. call editlink()
  34. elseif request("action")="savenew" then
  35. call savenew()
  36. elseif request("action")="savedit" then
  37. call savedit()
  38. elseif request("action")="del" then
  39. call del()
  40. elseif request("action")="orders" then
  41. call orders()
  42. elseif request("action")="updateorders" then
  43. call updateorders()
  44. else
  45. call linkinfo()
  46. }*/
  47. %>     
  48.    
  49. <%
  50. if(action==null||"".equals(action)){
  51. %>
  52.  <table width="100%" border="0" cellspacing="3" cellpadding="0">
  53.               <tr>
  54.                 <td>注意事项: <br>
  55.                   在下面,您将看到目前所有的联盟论坛。您可以编辑联盟论坛名或是增加一个新的联盟论坛。 也可以编辑或删除目前存在的联盟论坛。您可以对目前的联盟重新进行排列。 
  56.                 </td>
  57.               </tr>
  58.             </table>
  59. <%
  60. Vector forumLinkVector=new Vector();
  61. forumLinkVector=ForumLinkFactory.getForumLinks();
  62. %> 
  63. <br>
  64.             <table width="100%" border="0" cellspacing="3" cellpadding="0">
  65.               <tr bgcolor="<%=aTableTitleColor%>"> 
  66.                 <td height="22"><a href="admin_link.jsp?action=add">增加新的联盟论坛</a></td>
  67.               </tr>
  68.             </table>
  69. <%
  70. for(i=0;i<forumLinkVector.size();i++){
  71. ForumLink forumLink=(ForumLink)forumLinkVector.get(i);
  72. %>
  73. <hr width=60% align=left color=black height=1>
  74.             <table width="100%" border="0" cellspacing="3" cellpadding="0">
  75.               <tr> 
  76.                 <td>联盟论坛名称:<%=forumLink.getForumName()%></td>
  77.               </tr>
  78.               <tr> 
  79.                 <td>联盟论坛 URL:<%=forumLink.getForumURL()%></td>
  80.               </tr>
  81.               <tr> 
  82.                 <td>联盟论坛简介:<%=forumLink.getReadMe()%></td>
  83.               </tr>
  84.               <tr align="left" valign="bottom"> 
  85.                 <td height="27"><a href="admin_link.jsp?action=edit&id=<%=forumLink.getLinkID()%>">编辑此联盟论坛</a> | <a href="admin_link.jsp?action=del&id=<%=forumLink.getLinkID()%>">删除此联盟论坛</a> | <a href="admin_link.jsp?action=orders&id=<%=forumLink.getLinkID()%>">联盟论坛重新排序</a></td>
  86.               </tr>
  87.             </table>
  88. <%
  89. }
  90. %>
  91. <hr width=60% align=left color=black height=1>
  92.             <table width="100%" border="0" cellspacing="3" cellpadding="0">
  93.               <tr bgcolor=<%=aTableTitleColor%>> 
  94.                 <td height="20"><a href="admin_link.jsp?action=add">增加新的联盟论坛</a></td>
  95.               </tr>
  96.             </table>
  97.             <br>
  98.             <br>
  99.           </td>
  100.             </tr>
  101.         </table>
  102. <%
  103. }
  104. else if(action.equals("add")){
  105. %>
  106. <form action="admin_link.jsp?action=savenew" method = post>
  107. <table width="100%" border="0" cellspacing="0" cellpadding="0">
  108.   <tr> 
  109.     <td width="30%">论坛名称: </td>
  110.     <td width="70%"> 
  111.       <input type="text" name="name" size=40>
  112.     </td>
  113.   </tr>
  114.   <tr> 
  115.     <td width="30%">连接URL: </td>
  116.     <td width="70%"> 
  117.       <input type="text" name="url" size=40>
  118.     </td>
  119.   </tr>
  120.   <tr> 
  121.     <td height="15" width="30%">论坛简介: </td>
  122.     <td height="15" width="70%"> 
  123.       <input type="text" name="readme" size=40>
  124.     </td>
  125.   </tr>
  126.   <tr> 
  127.     <td height="15" colspan="2"> 
  128.       <div align="center"> 
  129.         <input type="submit" name="Submit" value="添加">
  130.       </div>
  131.     </td>
  132.   </tr>
  133. </table>
  134. </form>
  135. <%
  136. }
  137. else if(action.equals("edit")){
  138. int forumLinkID=ParamUtil.getInt(request,"id",0);
  139. ForumLink forumLink=ForumLinkFactory.getForumLink(forumLinkID);
  140. %>
  141. <form action="admin_link.jsp?action=savedit" method=post>
  142. <input type=hidden name=id value=<%=forumLinkID%>>
  143. <table width="100%" border="0" cellspacing="0" cellpadding="0">
  144.   <tr> 
  145.     <td width="30%">论坛名称: </td>
  146.     <td width="70%"> 
  147.       <input type="text" name="name" size=40 value=<%=forumLink.getForumName()%>>
  148.     </td>
  149.   </tr>
  150.   <tr> 
  151.     <td width="30%">连接URL: </td>
  152.     <td width="70%"> 
  153.       <input type="text" name="url" size=40 value=<%=forumLink.getForumURL()%>>
  154.     </td>
  155.   </tr>
  156.   <tr> 
  157.     <td height="15" width="30%">论坛简介: </td>
  158.     <td height="15" width="70%"> 
  159.       <input type="text" name="readme" size=40 value=<%=forumLink.getReadMe()%>>
  160.     </td>
  161.   </tr>
  162.   <tr> 
  163.     <td height="15" colspan="2"> 
  164.       <div align="center"> 
  165.         <input type="submit" name="Submit" value="修改">
  166.       </div>
  167.     </td>
  168.   </tr>
  169. </table>
  170. </form>
  171. <%
  172. }
  173. else if(action.equals("savenew")){
  174. ForumLinkAdmin.saveNew(request);
  175. out.println("操作成功!");
  176. }
  177. else if(action.equals("savedit")){
  178. ForumLinkAdmin.saveEdit(request);
  179. out.println("操作成功!");
  180. }
  181. else if(action.equals("del")){
  182. ForumLinkAdmin.del(request);
  183. out.println("操作成功!");
  184. }
  185. else if(action.equals("orders")){
  186. %><br>
  187.             <table width="95%" border="0" cellspacing="3" cellpadding="0" align=center>
  188.               <tr> 
  189.                 <td height="22"><b>联盟论坛重新排序</b><br>
  190. 注意:请在相应论坛的排序表单内输入相应的排列序号,注意不能和别的联盟论坛有相同的排列序号。
  191. </td>
  192.               </tr>
  193.       <tr>
  194.               <tr bgcolor="<%=aTableTitleColor%>"> 
  195.                 <td height="22" align=center><a href="admin_link.jsp?action=add">增加新的联盟论坛</a></td>
  196.               </tr>
  197.       <tr>
  198. <td>
  199. <%
  200. int forumLinkID=ParamUtil.getInt(request,"id",0);
  201. ForumLink forumLink=ForumLinkFactory.getForumLink(forumLinkID);
  202. out.println( "<form action=admin_link.jsp?action=updateorders method=post>");
  203. out.println( forumLink.getForumName()+"  <input type=text name=newid size=2 value="+forumLink.getLinkID()+">");
  204. out.println( "<input type=hidden name=id value="+forumLink.getLinkID()+">");
  205. out.println( "<input type=submit name=Submit value=修改></form>");
  206. %>
  207. </td>
  208.       </tr>
  209.               <tr bgcolor="<%=aTableTitleColor%>"> 
  210.                 <td height="22" align=center><a href="admin_link.jsp?action=add">增加新的联盟论坛</a></td>
  211.               </tr>
  212.             </table>
  213. <%
  214. }
  215. else if(action.equals("updateorders")){
  216. ForumLinkAdmin.updateOrders(request);
  217. out.println("操作成功!");
  218. }
  219. else{
  220. %>  <table width="100%" border="0" cellspacing="3" cellpadding="0">
  221.               <tr>
  222.                 <td>注意事项: <br>
  223.                   在下面,您将看到目前所有的联盟论坛。您可以编辑联盟论坛名或是增加一个新的联盟论坛。 也可以编辑或删除目前存在的联盟论坛。您可以对目前的联盟重新进行排列。 
  224.                 </td>
  225.               </tr>
  226.             </table>
  227. <%
  228. Vector forumLinkVector=new Vector();
  229. forumLinkVector=ForumLinkFactory.getForumLinks();
  230. %> 
  231. <br>
  232.             <table width="100%" border="0" cellspacing="3" cellpadding="0">
  233.               <tr bgcolor="<%=aTableTitleColor%>"> 
  234.                 <td height="22"><a href="admin_link.jsp?action=add">增加新的联盟论坛</a></td>
  235.               </tr>
  236.             </table>
  237. <%
  238. for(i=0;i<forumLinkVector.size();i++){
  239. ForumLink forumLink=(ForumLink)forumLinkVector.get(i);
  240. %>
  241. <hr width=60% align=left color=black height=1>
  242.             <table width="100%" border="0" cellspacing="3" cellpadding="0">
  243.               <tr> 
  244.                 <td>联盟论坛名称:<%=forumLink.getForumName()%></td>
  245.               </tr>
  246.               <tr> 
  247.                 <td>联盟论坛 URL:<%=forumLink.getForumURL()%></td>
  248.               </tr>
  249.               <tr> 
  250.                 <td>联盟论坛简介:<%=forumLink.getReadMe()%></td>
  251.               </tr>
  252.               <tr align="left" valign="bottom"> 
  253.                 <td height="27"><a href="admin_link.jsp?action=edit&id=<%=forumLink.getLinkID()%>">编辑此联盟论坛</a> | <a href="admin_link.jsp?action=del&id=<%=forumLink.getLinkID()%>">删除此联盟论坛</a> | <a href="admin_link.jsp?action=orders&id=<%=forumLink.getLinkID()%>">联盟论坛重新排序</a></td>
  254.               </tr>
  255.             </table>
  256. <%
  257. }
  258. %>
  259. <hr width=60% align=left color=black height=1>
  260.             <table width="100%" border="0" cellspacing="3" cellpadding="0">
  261.               <tr bgcolor=<%=aTableTitleColor%>> 
  262.                 <td height="20"><a href="admin_link.jsp?action=add">增加新的联盟论坛</a></td>
  263.               </tr>
  264.             </table>
  265.             <br>
  266.             <br>
  267.           </td>
  268.             </tr>
  269.         </table>
  270. <%
  271. }
  272. %>
  273. <%
  274. }
  275. catch(Exception e){
  276. e.printStackTrace();
  277. String errMsg=e.getMessage();
  278. %>
  279. <%@include file="INC/error.jsp"%>
  280. <%
  281. }%>
  282.      </td>
  283.     </tr>
  284. </table>
  285. <%@ include file="foot.jsp"%>