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

📄 boardmanager_jsp.java

📁 论坛源码
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
      out.write("  {\r\n");
      out.write("    if ((istring.substring(i,i+1)!=\" \")&(temp))\r\n");
      out.write("     { temp=false;  }\r\n");
      out.write("  }\r\n");
      out.write(" return temp;\r\n");
      out.write("}\r\n");
      out.write("\r\n");
      out.write("function firstisspace(mystring)\r\n");
      out.write("//检查首字母是否是空格,TRUE首字母为空格;FALSE首字母不为空格\r\n");
      out.write("{ var istring=mystring;\r\n");
      out.write("  var temp,i;\r\n");
      out.write("  temp=true;\r\n");
      out.write("    if (istring.substring(0,1)!=\" \")\r\n");
      out.write("     { temp=false;  }\r\n");
      out.write(" return temp;\r\n");
      out.write("}\r\n");
      out.write("\r\n");
      out.write("function isemail(mystring)\r\n");
      out.write("{\r\n");
      out.write("  var istring=mystring;\r\n");
      out.write("  var atpos=mystring.indexOf(\"@\");\r\n");
      out.write("  var temp=true;\r\n");
      out.write("  if (atpos==-1) //email中没有@符号;不正确的EMAIL\r\n");
      out.write("  {\r\n");
      out.write("     temp=false;\r\n");
      out.write("  }\r\n");
      out.write("  return temp;\r\n");
      out.write("}\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("function check_input(theForm)\r\n");
      out.write("{\r\n");
      out.write("\r\n");
      out.write("     if ((theForm.boardmaster.value == \"\")|(isspacestring(theForm.boardmaster.value)))\r\n");
      out.write("      {\r\n");
      out.write("        alert(\"请输入版主.\");\r\n");
      out.write("        theForm.boardmaster.focus();\r\n");
      out.write("        return (false);\r\n");
      out.write("      }\r\n");
      out.write("\r\n");
      out.write("      if (theForm.boardmaster.value.length > 20)\r\n");
      out.write("      {\r\n");
      out.write("        alert(\"版主名太长了,请重新输入.\");\r\n");
      out.write("        theForm.boardmaster.focus();\r\n");
      out.write("        return (false);\r\n");
      out.write("      }\r\n");
      out.write("\r\n");
      out.write("     if ((theForm.masterpwd.value == \"\")|(isspacestring(theForm.masterpwd.value)))\r\n");
      out.write("      {\r\n");
      out.write("        alert(\"请输入密码.\");\r\n");
      out.write("        theForm.masterpwd.focus();\r\n");
      out.write("        return (false);\r\n");
      out.write("      }\r\n");
      out.write("\r\n");
      out.write("      if (theForm.masterpwd.value.length > 10)\r\n");
      out.write("      {\r\n");
      out.write("        alert(\"密码太长了,请重新输入.\");\r\n");
      out.write("        theForm.masterpwd.focus();\r\n");
      out.write("        return (false);\r\n");
      out.write("      }\r\n");
      out.write("      \r\n");
      out.write("\r\n");
      out.write("     if (!(isemail(theForm.masteremail.value)))\r\n");
      out.write("      {\r\n");
      out.write("        alert(\"请输入正确的EMAIL.\");\r\n");
      out.write("        theForm.masteremail.focus();\r\n");
      out.write("        return (false);\r\n");
      out.write("      }\r\n");
      out.write("    \r\n");
      out.write("//   if (theForm=\"frmAdd\") {\r\n");
      out.write("\r\n");
      out.write("      if ((frmAdd.boardname.value == \"\")|(isspacestring(frmAdd.boardname.value)))\r\n");
      out.write("      {\r\n");
      out.write("        alert(\"请输入版块名.\");\r\n");
      out.write("        frmAdd.boardname.focus();\r\n");
      out.write("        return (false);\r\n");
      out.write("      }\r\n");
      out.write("\r\n");
      out.write("      if (frmAdd.boardname.value.length > 20)\r\n");
      out.write("      {\r\n");
      out.write("        alert(\"太长了,请重新输入.\");\r\n");
      out.write("        frmAdd.boardname.focus();\r\n");
      out.write("        return (false);\r\n");
      out.write("      }\r\n");
      out.write("      \r\n");
      out.write("//  }\r\n");
      out.write("\r\n");
      out.write("       return (true);\r\n");
      out.write("}\r\n");
      out.write("-->\r\n");
      out.write("</script>\r\n");
      out.write("\r\n");
      out.write("</head>\r\n");
      out.write("<body>\r\n");
      out.write("<table border=\"0\" width=\"100%\">\r\n");
      out.write("  <tr>\r\n");
      out.write("    <td width=\"25%\" align=\"center\" bgcolor=\"#99CC66\"><a href=\"boardmanager.jsp\" target=\"_self\">版面管理</a></td>\r\n");
      out.write("    <td width=\"25%\" align=\"center\" bgcolor=\"#99CC66\"><a href=\"usermanager.jsp\" target=\"_self\">注册用户管理</a></td>\r\n");
      out.write("    <td width=\"25%\" align=\"center\" bgcolor=\"#99CC66\"><a href=\"emaillist.jsp\" target=\"_self\">用户邮件列表</a></td>\r\n");
      out.write("    <td width=\"25%\" align=\"center\" bgcolor=\"#99CC66\"><a href=\"boardmanager.jsp?method=6\" target=\"_self\">退出</a></td>\r\n");
      out.write("  </tr>\r\n");
      out.write("  <tr>\r\n");
      out.write("    <td width=\"100%\" colspan=\"4\">\r\n");
      out.write("      <hr>\r\n");
      out.write("    </td>\r\n");
      out.write("  </tr>\r\n");
      out.write("</table>\r\n");
      out.write("    <table border=\"0\" width=\"400\">\r\n");
      out.write("  <tr>\r\n");
      out.write("    <td width=\"100%\">\r\n");
      out.write("    <table border=\"0\" width=\"100%\">\r\n");
      out.write("  <tr>\r\n");
      out.write("    <td width=\"100%\">\r\n");
      out.write("      <p align=\"center\"><b>论坛版面管理</b></p>\r\n");
      out.write("      <p align=\"center\">操作请点击版面&nbsp;&nbsp;&nbsp;&nbsp; <a href=\"boardmanager.jsp?method=4\">增加版面</a></p>                                                                              \r\n");
      out.write("    </td>                                                                     \r\n");
      out.write("  </tr>                                                                     \r\n");
      out.write("</table>                                                                     \r\n");
      out.write("      <table border=\"1\" width=\"100%\" bordercolorlight=\"#000000\" bordercolordark=\"#FFFFFF\" cellspacing=\"0\" cellpadding=\"0\">                                                                         \r\n");
      out.write("        <tr>                                                                              \r\n");
      out.write("          <td width=\"10%\" align=\"center\" bgcolor=\"#99CC66\"><font color=\"#FFFFFF\">ID</font></td>                                                                             \r\n");
      out.write("          <td width=\"50%\" align=\"center\" bgcolor=\"#99CC66\"><font color=\"#FFFFFF\">版面</font></td>                                                                             \r\n");
      out.write("          <td width=\"40%\" align=\"center\" bgcolor=\"#99CC66\"><font color=\"#FFFFFF\">版主</font></td>                                                                             \r\n");
      out.write("        </tr>                                                                             \r\n");

sqlRst=board.listBoard(1);

while (sqlRst.next())
{
boardid=sqlRst.getInt("boardid");
boardname=sqlRst.getString("boardname");
boardmaster=sqlRst.getString("boardmaster");
masteremail=sqlRst.getString("masteremail");

      out.write("                                                                          \r\n");
      out.write("                                                                           \r\n");
      out.write("        <tr>                                                                             \r\n");
      out.write("          <td width=\"10%\" align=\"center\">");
      out.print(boardid);
      out.write("</td>                                                                             \r\n");
      out.write("          <td width=\"50%\" align=\"center\"><a href=\"boardmanager.jsp?method=5&boardid=");
      out.print(boardid);
      out.write('"');
      out.write('>');
      out.print(boardname);
      out.write("</a></td>                                                                            \r\n");
      out.write("          <td width=\"40%\" align=\"center\"><a href=\"mailto:");
      out.print(masteremail);
      out.write('"');
      out.write('>');
      out.print(boardmaster);
      out.write("</a></td>                                                                           \r\n");
      out.write("        </tr>                                                                           \r\n");

}
sqlRst.close();                                                                    

      out.write("                                                                          \r\n");
      out.write("      </table>                                                                      \r\n");
      out.write("  </td>                                                                     \r\n");
      out.write("  </tr>                                                                     \r\n");
      out.write("  </table>                                                               \r\n");
      out.write("                                                              \r\n");

if (method==4) {
//'method=4 显示增加论坛表格                                                               

      out.write("                                   \r\n");
      out.write("<div style=\"width: 214; height: 235; position: absolute; left: 471px; top: 74px\">                                                                         \r\n");
      out.write("<table border=\"0\" width=\"100%\" bgcolor=\"#EFFFCE\">                                                                      \r\n");
      out.write("  <tr>                                                                      \r\n");
      out.write("    <td width=\"100%\">                                                                      \r\n");
      out.write("      <p align=\"center\" bgcolor=\"#99CC66\"><b>版面增加</b></p>                                                                     \r\n");
      out.write("    </td>                                                                     \r\n");
      out.write("  </tr>                                                                     \r\n");
      out.write("  <tr>                                                                     \r\n");
      out.write("    <td width=\"100%\">                                                                     \r\n");
      out.write("      <form method=\"POST\" action=\"boardmanager.jsp?method=1\" onSubmit=\"return check_input(this)\" name=\"frmAdd\">                                                                     \r\n");
      out.write("        <p align=\"left\" style=\"margin-top: 0; margin-bottom: 0\">版名:<input type=\"text\" name=\"boardname\" size=\"20\"></p>                                                                     \r\n");
      out.write("        <p align=\"left\" style=\"margin-top: 0; margin-bottom: 0\">版主:<input type=\"text\" name=\"boardmaster\" size=\"20\"></p>                                                                     \r\n");
      out.write("        <p align=\"left\" style=\"margin-top: 0; margin-bottom: 0\">密码:<input type=\"text\" name=\"masterpwd\" size=\"20\"></p>                                                                     \r\n");
      out.write("        <p align=\"left\" style=\"margin-top: 0; margin-bottom: 0\">EMAIL:</p>                                                                     \r\n");
      out.write("        <p align=\"left\" style=\"margin-top: 0; margin-bottom: 0\"><input type=\"text\" name=\"masteremail\" size=\"26\"></p>                                                                     \r\n");
      out.write("        <p align=\"left\" style=\"margin-top: 0; margin-bottom: 0\">版块说明:</p>                                                                     \r\n");
      out.write("        <p align=\"left\" style=\"margin-top: 0; margin-bottom: 0\"><textarea rows=\"2\" name=\"masterword\" cols=\"22\"></textarea></p>                                                                     \r\n");
      out.write("        <p align=\"center\" style=\"margin-top: 0; margin-bottom: 0\"><input class=\"buttonface\"  type=\"submit\" value=\"增加\" name=\"B1\">&nbsp;&nbsp;&nbsp;&nbsp;                                                                           \r\n");
      out.write("        <input class=\"buttonface\" type=\"reset\" value=\"重写\" name=\"B2\"></p>                                                                          \r\n");
      out.write("      </form>                                                                          \r\n");
      out.write("    </td>                                                                          \r\n");
      out.write("  </tr>                                                                          \r\n");
      out.write("</table>                                                                          \r\n");
      out.write("</div>                                                                  \r\n");
}  //'End if method==4
      out.write("                                                                          \r\n");
                                                                 
if (method==5) {
//'method=5 显示修改删除论坛表格                                                              
tempSTR=request.getParameter("boardid");
boardid=java.lang.Integer.parseInt(tempSTR);

boardname="asfasdf";
boardmaster="";
masteremail="";
masterpwd="";
masterword="";

if (board.getBoardInfo(boardid)) {
  boardname=board.getBoardName();
  boardmaster=board.getBoardMaster();
  masteremail=board.getBoardMasteremail();
  masterpwd=board.getBoardMasterpwd();
  masterword=board.getBoardMasterword();
}

      out.write("                                                                                   \r\n");
      out.write("<div style=\"width: 208; height: 242; position: absolute; left: 469px; top: 72px\">                                                                            \r\n");
      out.write("<table border=\"0\" width=\"89%\" bgcolor=\"#EFFFCE\">                                                                         \r\n");
      out.write("  <tr>                                                                         \r\n");
      out.write("    <td width=\"100%\">                                                                         \r\n");
      out.write("      <p align=\"center\" bgcolor=\"#99CC66\"><b>版面修改、删除</b></p>                                                                        \r\n");
      out.write("    </td>                                                                        \r\n");
      out.write("  </tr>                                                                        \r\n");
      out.write("  <tr>                                                                        \r\n");
      out.write("    <td width=\"100%\">                                                                        \r\n");
      out.write("      <form method=\"POST\" action=\"boardmanager.jsp\" onSubmit=\"return check_input(this)\" name=\"frmUpdate\">                                                                        \r\n");
      out.write("        <input type=\"hidden\" name=\"boardid\" value=\"");
      out.print(boardid);
      out.write("\">                                                                         \r\n");
      out.write("        <input type=\"hidden\" name=\"method\" value=2>                                                                \r\n");
      out.write("        <table border=\"0\" width=\"87%\">                                                   \r\n");
      out.write("          <tr>                                                   \r\n");
      out.write("            <td width=\"50%\">                                                               \r\n");
      out.write("        <p align=\"left\" style=\"margin-top: 0; margin-bottom: 0\">版名:");
      out.print(boardname);
      out.write("</p>                                                                       \r\n");
      out.write("        <p align=\"left\" style=\"margin-top: 0; margin-bottom: 0\">版主:<input type=\"text\" name=\"boardmaster\" size=\"20\" value=\"");
      out.print(boardmaster);
      out.write("\"></p>                                                                       \r\n");
      out.write("        <p align=\"left\" style=\"margin-top: 0; margin-bottom: 0\">密码:<input type=\"text\" name=\"masterpwd\" size=\"20\" value=\"");
      out.print(masterpwd);
      out.write("\"></p>                                                                       \r\n");
      out.write("        <p align=\"left\" style=\"margin-top: 0; margin-bottom: 0\">EMAIL:</p>                                                                       \r\n");
      out.write("        <p align=\"left\" style=\"margin-top: 0; margin-bottom: 0\"><input type=\"text\" name=\"masteremail\" size=\"26\" value=\"");
      out.print(masteremail);
      out.write("\"></p>                                                                       \r\n");
      out.write("        <p align=\"left\" style=\"margin-top: 0; margin-bottom: 0\">版块说明:</p>                                                                       \r\n");
      out.write("        <p align=\"left\" style=\"margin-top: 0; margin-bottom: 0\"><textarea rows=\"2\" name=\"masterword\" cols=\"22\">");
      out.print(masterword);
      out.write("</textarea></p>                                                                       \r\n");
      out.write("        <p align=\"center\" style=\"margin-top: 0; margin-bottom: 0\"><input class=\"buttonface\" type=\"submit\" value=\"修改\" name=\"B1\">&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"boardmanager.jsp?boardid=");
      out.print(boardid);
      out.write("&method=3\">删除</a>                                        \r\n");
      out.write("        </p>                                                                   \r\n");
      out.write("            </td>                                               \r\n");
      out.write("          </tr>                                               \r\n");
      out.write("        </table>                                               \r\n");
      out.write("      </form>                                                    \r\n");
      out.write("    </td>                                               \r\n");
      out.write("   </tr>                                                                   \r\n");
      out.write("</table>                                                                   \r\n");
      out.write("</div>                                                           \r\n");
}  //'End if method==5
      out.write("                                                                         \r\n");
      out.write("</body>                                                                      \r\n");
      out.write("</html> ");
    } catch (Throwable t) {
      if (!(t instanceof SkipPageException)){
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          out.clearBuffer();
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
      }
    } finally {
      if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
}

⌨️ 快捷键说明

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