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

📄 editmaster.jsp

📁 《JSP通用模块及典型系统开发实例导航》源代码
💻 JSP
字号:
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="../include.jsp"%>
<%
String userName = (String) session.getAttribute("username");
if (!userName.equals("admin")){ 
	response.sendRedirect("error1.jsp");
}
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<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.name.value == "")
  {
    alert("请输入管理员名称.");
    theForm.name.focus();
    return (false);
  }

   if (theForm.pass.value == "")
  {
    alert("请输入管理员密码.");
    theForm.pass.focus();
    return (false);
  }

   if (theForm.join.value == "")
  {
    alert("请输入管理员加入日期.");
    theForm.join.focus();
    return (false);
  }

   if (theForm.total.value == "")
  {
    alert("请输入管理员发新闻总数.");
    theForm.total.focus();
    return (false);
  }

   if (theForm.login.value == "")
  {
    alert("请输入管理员登陆次数.");
    theForm.login.focus();
    return (false);
  }

  if (theForm.name.value.length > 20)
    {
    alert("管理员名称长度应小于20个字符.");
    theForm.name.focus();
    return (false);
  }

  if (theForm.pass.value.length > 16)
    {
    alert("管理员密码长度应小于16个字符.");
    theForm.pass.focus();
    return (false);
  }

  if (theForm.join.value.length > 10)
    {
    alert("管理员加入日期长度应小于10个字符.");
    theForm.join.focus();
    return (false);
  }

  if (theForm.total.value.length > 10)
    {
    alert("管理员发新闻总数应小于10个字符.");
    theForm.total.focus();
    return (false);
  }

  if (theForm.login.value.length > 10)
    {
    alert("管理员登陆次数应小于10个字符.");
    theForm.login.focus();
    return (false);
  }


   if (theForm.classid.value == "")
  {
    alert("请选择栏目.");
    theForm.classid.focus();
    return (false);
  }

}
//-->
</script>
<TABLE bgColor=<%=tablebgcolor%> border=0 cellPadding=0 cellSpacing=1 width=100% 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"))));
		MasterMgr masterMgr = new MasterMgr();		
		Master master = masterMgr.getById(id);	%>
<TABLE border="0" width=100% align=center cellpadding=0 cellspacing=1  bgcolor=<%=tablebgcolor%>>
<form method="POST" action="/News/EditMasterServlet?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%>>&nbsp;<B>管理员</B></TD>
		<TD width="70%" bgColor=<%=tdbgcolor%>>
		<input TYPE="text" name=name size=20 maxlength=20 value=<%=master.getUsername()%>>&nbsp;**不得超过 10 个字符</TD>
	</TR>
	<TR><TD width="30%" bgColor=<%=tdbgcolor%>>&nbsp;<B>管理员密码</B></TD>
		<TD width="70%" bgColor=<%=tdbgcolor%>>
		<input TYPE="text" name=pass size=20 maxlength=16 value=<%=master.getUserpwd()%>>&nbsp;**不得超过 16 个字符</TD>
	</TR>
	<TR><TD width="30%" bgColor=<%=tdbgcolor%>>&nbsp;<B>加入日期</B></TD>
		<TD width="70%" bgColor=<%=tdbgcolor%>>
		<input TYPE="text" name=join size=20 maxlength=10 value=<%=master.getStrRegistertime()%>>&nbsp;**不得超过 10 个字符</TD>
	</TR>
	<TR><TD width="30%" bgColor=<%=tdbgcolor%>>&nbsp;<B>发新闻总数</B></TD>
		<TD width="70%" bgColor=<%=tdbgcolor%>>
		<input TYPE="text" name=total size=20 maxlength=10 value=<%=master.getTotal()%>>&nbsp;**不得超过 10 个字符</TD>
	</TR>
	<TR><TD width="30%" bgColor=<%=tdbgcolor%>>&nbsp;<B>所管栏目</B></TD>
		<TD width="70%" bgColor=<%=tdbgcolor%>>
			<select name="classid">
			<option value="">请选择管理员所的栏目</option>
			<%CategoryMgr categoryMgr = new CategoryMgr();
			Collection c = categoryMgr.getAll();
			Iterator iterator = c.iterator();
			while (iterator.hasNext()) {
				Category category = (Category) iterator.next();
			if (master.getCategoryid()==category.getId()){%>
			<option value="<%=category.getId()%>" selected><%=category.getName()%></option><%} else{%>
			<option value="<%=category.getId()%>"><%=category.getName()%></option>
			<%}}%>
			</select>&nbsp;**</TD>
	</TR>
	<TR><TD width="30%" bgColor=<%=tdbgcolor%>>&nbsp;<B>登陆次数</B></TD>
		<TD width="70%" bgColor=<%=tdbgcolor%>>
		<input TYPE="text" name=login size=20 maxlength=10 value=<%=master.getLoginnum()%>>&nbsp;**不得超过 10 个字符</TD>
	</TR>
	<TR><TD bgColor=<%=tdbgcolor%> colspan=2 align=center><BR><FONT color=#000000>
		<INPUT name=Submit type=submit value="确 定"> &nbsp;&nbsp;     
		<INPUT name=Submit2 type=reset value="清 除"></FONT><BR></TD>
	</TR>
	<form>
</TABLE>
<%@ include file="foot.jsp"%>

⌨️ 快捷键说明

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