📄 editnews.jsp
字号:
<%@ page contentType="text/html;charset=gb2312" %>
<%@ include file="../inc/incdb.jsp"%>
<%@ include file="session.jsp"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="0">
<title>欢迎光临<%=title%></title>
<link rel="stylesheet" href="../css/news.css" type="text/css" media="screen">
</head>
<body>
<script Language="JavaScript">
<!--
function check_input(theForm)
{
if (theForm.subject.value == "")
{
alert("请输入文章标题.");
theForm.subject.focus();
return (false);
}
if (theForm.Content.value == "")
{
alert("请输入贴子的内容.");
theForm.Content.focus();
return (false);
}
if (theForm.classid.value == "")
{
alert("请选择栏目.");
theForm.classid.focus();
return (false);
}
if (theForm.subject.value.length > 100)
{
alert("文章标题长度应小于50个字符或数字.");
theForm.subject.focus();
return (false);
}
if (theForm.pic.value.length > 100)
{
alert("图片链接地址应小于50个字符或数字.");
theForm.pic.focus();
return (false);
}
}
//-->
</script>
<TABLE bgColor=<%=tablebgcolor%> border=0 cellPadding=0 cellSpacing=1 width=<%=tablewidth%> align=CENTER>
<TR><TD align=middle background=../img/index/topback.gif height=10>
</TD></TR>
</TABLE>
<%int id =(null==request.getParameter("id")?1:(Integer.parseInt(request.getParameter("id"))));
DispNews dispnews = new DispNews();
dispnews.setID(id);
News news = dispnews.idToNews(); %>
<%DispMaster dispmaster = new DispMaster();
dispmaster.setUserName(userName);
Master master = dispmaster.nameToMaster();
if(news.getRootID()!=master.getClassid() && !userName.equals("admin")){response.sendRedirect("error1.jsp");}%>
<TABLE border="0" width=<%=tablewidth%> align=center cellpadding=0 cellspacing=1 bgcolor=<%=tablebgcolor%>>
<form method="POST" action="editnewsover.jsp?id=<%=id%>" onsubmit="return check_input(this)">
<TR bgcolor=<%=trbgcolor%> height=25>
<TD colspan=2><FONT COLOR="#ffffff"><FONT SIZE="5" COLOR="#ffcc00"><B>编辑新闻</B></FONT><B> **为必填项目</B></FONT></TD>
</TR>
<TR><TD width="30%" bgColor=<%=tdbgcolor%>> <B>文章标题</B></TD>
<TD width="70%" bgColor=<%=tdbgcolor%>>
<input TYPE="text" name=subject size=70 maxlength=255 value=<%=news.getTopic()%>> **不得超过 50 个汉字</TD>
</TR>
<TR><TD bgColor=<%=tdbgcolor%>> <B>内容</B><BR><BR><li>请在此填写新闻的内容。<BR></TD>
<TD bgColor=<%=tdbgcolor%>><textarea class="smallarea" cols="95%" name="Content" rows="30" wrap="VIRTUAL" title="请在此填写新闻的内容。"><%=news.getBody()%></textarea> **</TD>
</TR>
<TR><TD bgColor=<%=tdbgcolor%>> <B>图片链接地址</B></TD><TD bgColor=<%=tdbgcolor%>>
<input TYPE="text" name=pic size=70 maxlength=100 value=<%=news.getPic()%>></TD>
</TR>
<TR><TD bgColor=<%=tdbgcolor%>> <B>所在栏目</B></TD><TD bgColor=<%=tdbgcolor%>>
<SELECT NAME="classid">
<option value="">请选择新闻所的栏目</option>
<% Vector listclass = new Vector();
DispClass dispclass = new DispClass();
listclass = dispclass.allClass();
for(int i=0;i<listclass.size();i++) {
IClass classinfo = (IClass)listclass.elementAt(i);
if (news.getRootID()==classinfo.getID()){%>
<option value="<%=classinfo.getID()%>" selected><%=classinfo.getName()%></option><%} else{%>
<option value="<%=classinfo.getID()%>"><%=classinfo.getName()%></option>
<%}}%>
</SELECT></TD>
</TR>
<TR><TD bgColor=<%=tdbgcolor%> colspan=2 align=center><FONT color=#000000>
<INPUT name=Submit type=submit value="发 表">
<INPUT name=Submit2 type=reset value="清 除"></FONT></TD>
</TR>
<form>
</TABLE>
<%@ include file="../inc/tail.jsp"%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -