?? forum_add.jsp
字號:
<%@ page contentType="text/html;charset=gbk" errorPage="../error.jsp"%>
<%@ page import="java.util.ArrayList"%>
<%@ page import="com.hongshee.ejforum.util.PageUtils"%>
<%@ page import="com.hongshee.ejforum.common.CacheManager"%>
<%@ page import="com.hongshee.ejforum.data.UserDAO.UserInfo"%>
<%@ page import="com.hongshee.ejforum.data.SectionDAO.SectionVO"%>
<%
UserInfo userinfo = PageUtils.getAdminUser(request, response);
if (userinfo == null) return;
String fromPath = request.getContextPath() + "/admin/forums/forum_edit.jsp";
CacheManager cache = CacheManager.getInstance();
ArrayList sections = cache.getSections();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML xmlns="http://www.w3.org/1999/xhtml"><HEAD>
<META http-equiv=Content-Type content="text/html; charset=gbk">
<LINK href="../style/admin.css" type=text/css rel=stylesheet>
<SCRIPT src="../../js/common.js" type=text/javascript></SCRIPT>
<SCRIPT src="../js/admin.js" type=text/javascript></SCRIPT>
</HEAD>
<BODY topMargin=10>
<TABLE cellSpacing=6 cellPadding=2 width="100%" border=0>
<TBODY>
<TR>
<TD>
<TABLE class=guide cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD><A onclick="parent.location='../index.htm';return false;" href="#">后臺管理首頁</A> » 添加版塊
</TD></TR></TBODY></TABLE><BR>
<FORM id=frmsection name=frmsection onSubmit="checkfields(this); return false;" action="../perform.jsp" method=post>
<INPUT type=hidden name="act" value="forums_section_add">
<INPUT type=hidden name="fromPath" value="<%= fromPath %>">
<TABLE class=info_tb cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR class=header>
<TD colSpan=3>添加新分區</TD></TR>
<TR align=middle>
<TD class=altbg1 width="45%"><B>分區名稱:</B></TD>
<TD class=altbg2><INPUT size=50 value="新分區名稱" name="sectionName"></TD></TR>
<TR>
<TD class=altbg1 width="45%"><B>下級子版塊橫排:</B><BR><SPAN
class=smalltxt>設置下級子版塊橫排時每行版塊數量,如果設置為"0",則按正常方式排列</SPAN></TD>
<TD class=altbg2><INPUT size=50 value="0" name="cols"> </TD></TR>
</TBODY></TABLE><BR>
<CENTER><INPUT class=button type=submit value="提 交"></CENTER></FORM>
<BR>
<FORM id=frmboard name=frmboard onSubmit="checkfields2(this); return false;" action="../perform.jsp" method=post>
<INPUT type=hidden name="act" value="forums_forum_add">
<INPUT type=hidden name="fromPath" value="<%= fromPath %>">
<TABLE class=info_tb cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR class=header>
<TD colSpan=2>添加新版塊</TD></TR>
<TR align=middle>
<TD class=altbg1 width="45%"><B>版塊名稱:</B></TD>
<TD class=altbg2><INPUT size=50 value="新版塊名稱" name="boardName"></TD></TR>
<TR align=middle>
<TD class=altbg1 width="45%"><B>上級分區:</B></TD>
<TD class=altbg2>
<SELECT name="sectionID">
<%
if (sections != null)
{
SectionVO aSection = null;
for (int i=0; i<sections.size(); i++)
{
aSection = (SectionVO)sections.get(i);
%>
<OPTION value="<%= aSection.sectionID %>"><%= aSection.sectionName %></OPTION>
<%
}
}
%>
</SELECT></TD></TR>
</TBODY></TABLE>
<BR>
<CENTER><INPUT class=button type=submit value="提 交"></CENTER></FORM><BR>
</TD></TR></TBODY></TABLE><BR><BR>
<script language="javascript">
function checkfields(theform) {
if (trim(theform.sectionName.value) == '') {
alert('新分區名稱不能為空');
theform.sectionName.focus();
return;
}
var filter = /^\d+$/;
if (!filter.test(trim(theform.cols.value))) {
alert('下級子版塊橫排數必須為整數');
theform.cols.focus();
return;
}
theform.submit();
}
function checkfields2(theform) {
if (trim(theform.boardName.value) == '') {
alert('新版塊名稱不能為空');
theform.boardName.focus();
return;
}
if (trim(theform.sectionID.value) == '') {
alert('上級分區不能為空');
theform.sectionID.focus();
return;
}
theform.submit();
}
</script>
</BODY></HTML>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -