📄 info_add.jsp
字号:
<%@ page contentType="text/html;charset=gb2312" %>
<%@include file="InfoComm.jsp"%>
<%
// 取得当前用户名
String userId = (String)session.getValue("user_id");
String pwd = (String)session.getValue("passwd");
// 只有系统用户才可以有权限
if(IsUser(userId,pwd))
{
%>
<%!
String strTitle,sDatetime,strContent,strCate,Filename="",iFrom;
Vector v_Cate;
int cateid,iattpic,InfoId;
%>
<%
// 取得当前时间,按照指定格式显示
java.util.Date dnow = new java.util.Date();
SimpleDateFormat formatter1 = new SimpleDateFormat ("yyyy-MM-dd");
String ShowDate = formatter1.format(dnow);
%>
<html>
<head>
<title>添 加 信 息</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../style.css">
<script Language="JavaScript">
// 提交表单前校验指定域
function checkdata() {
if (document.myform.txttitle.value=='') {
window.alert ("请输入新闻的标题!")
return false
}
if (document.myform.txttitle.value.length > 60) {
window.alert ("标题需短于60个汉字 !")
return false
}
if (document.myform.txtcontent.value=='') {
window.alert ("请输入新闻的详细内容!")
return false
}
return true
}
</script>
</head>
<body>
<form method="POST" action="info_addSave.jsp" name="myform" onSubmit="return checkdata()" >
<table align="center" border="1" cellspacing="0" width="95%" bordercolorlight="#000000" bordercolordark="#FFFFFF" cellpadding="0">
<tr>
<td align=center width="100%" bgcolor="#FEEC85" height="20">添 加 信 息</td>
</tr>
<tr><td width="100%">
<table align=center border="0" cellspacing="1" width="100%">
<tr>
<td width="20%" align="center" height="23" bgcolor="#FFFCD9">信息类别</td>
<td width="80%" valign="center" height="23" bgcolor="#FFFCD9">
<select name="cate" size="1" style='FONT-SIZE: 9pt'>
<%
try
{
Categories o_Cate = new Categories();
v_Cate = o_Cate.getMoreCategories();
for(int m=0;m<v_Cate.size();m++)
{
o_Cate =(Categories)v_Cate.elementAt(m);
cateid = o_Cate.getCateId();
strCate = o_Cate.getCateTitle();
%>
<OPTION value="<%=cateid%>"><%=strCate%></OPTION>
<%
}
}
catch(Exception e)
{ System.out.println(e.toString());}
%>
</SELECT>
提交人 <%=getName(userId)%>
提交日期 <%=ShowDate%>
</td>
</tr>
<tr>
<td align="center" height="23" bgcolor="#FFFCD9">信息主题</td>
<td height="23" bgcolor="#FFFCD9"><input type="text" name="txttitle" size="60">
<input type="checkbox" name="attpic" value="1">附图</td>
</tr>
<tr>
<td align="center" height="23" bgcolor="#FFFCD9">文件上传</td>
<td height="23" bgcolor="#FFFCD9"><iframe frameborder="0" width="100%" height="23" scrolling="no" src="info_upload.jsp"></iframe>
</td>
</tr>
<tr><td align="center" height="23" bgcolor="#FFFCD9">UBB标签</font></td>
<td bgcolor="#FFFCD9">
<%@include file="template.jsp"%>
</td></tr>
<tr>
<td colspan="2" bgcolor="#FFFCD9" align="center"><textarea rows="19" name="txtcontent" cols="100"></textarea></td>
</tr>
<tr>
<td align="center" valign="top" bgcolor="#FFFCD9"></td>
<td bgcolor="#FFFCD9">
<input type="hidden" name="upimages" value="<%=Filename%>"></td>
<input type="hidden" name="userid" value="<%=userId%>"></td>
</tr>
</table>
</td>
</tr>
</table>
<p><center>
<input type="submit" value=" 预 览 " name="cmdok" onclick="myform.action='info_preview.jsp';return true;">
<input type="submit" value=" 提 交 " name="cmsdok" onclick="myform.action='info_addSave.jsp'"></p>
</form>
</BODY>
</HTML>
<%}
else
out.println("你没有添加的权限");
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -