📄 editclass.jsp
字号:
<%@ include file="conn.jsp"%>
<%if ((session.getValue("admin")==null)||(session.getValue("admin")=="")){
response.sendRedirect("admin.jsp");
}
request.setCharacterEncoding("GB2312");
String sql;
String parentid=request.getParameter("ParentID");
String classid=request.getParameter("editid");
String classtype=request.getParameter("classtype");
String class1=request.getParameter("class");
String action1=request.getParameter("action");
if(action1.equals("edit")){
sql="select * from scott.class where classid='"+classid+"'";
ResultSet rst=stmt.executeQuery(sql);
if(!rst.next()){
out.print("<script>alert('对不起,你所要操作的对象不存在\n请返回重试');history.back();</script>");
}else{
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>类别管理</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div align="center">
<center>
<table border="0" cellPadding="3" cellSpacing="0" class="border" width="95%" style="border-collapse: collapse" bordercolor="#111111" >
<tr>
<th class="title" colSpan="2" height="25" width="100%">类别管理 </th>
</tr>
<tr>
<td class="tdbg" colSpan="2"><b>注意</b>:<br>
①删除类别同时将删除该类别下所有资料!删除分类同时删除下属分类和其中资料! 操作时请完整填写表单信息。<br>
②如果选择<b>复位所有类别</b>,则所有类别都将作为一级类别分类,这时您需要重新对各个类别进行归属的基本设置,<b>不要轻易使用该功能</b>,仅在做出了错误的设置而无法复原类别之间的关系和排序的时候使用
</td>
</tr>
<tr>
<td class="title"><b>类别操作选项</b></td>
<td class="title"><a href="classmana.jsp"> </a></td>
</tr>
</table>
<p></p>
<form action="editclass.jsp?action=editsavenew" method="post">
<input type="hidden" name="editid" value=<%=classid%>>
<table width="95%" border="0" cellspacing="0" cellpadding="3" class="border" style="border-collapse: collapse" bordercolor="#111111">
<tr>
<th height=24 colspan=2 class="title">修改类别
</tr>
<tr>
<td width="52%" height=30 class="tdbg" align="center">类别名称</td>
<td width="48%" class="tdbg">
<input type="text" name="class" size="35" class="smallinput" value="<%=rst.getString("class")%>">
</td>
</tr>
<tr>
<td width="52%" height=30 class="tdbg" align="center"><U>所属类别</U></td>
<td width="48%" class="tdbg">
<select name=ParentID class="select">
<option value="0">没有父类</option>
<%sql="select classid,class from scott.class where classtype=1 order by rootid,ordersid";
ResultSet rs1=stmt1.executeQuery(sql);
while(rs1.next()){ %>
<option value=<%=rs1.getString("classid")%> ><%=rs1.getString("class")%></option>
<%}%>
</select>
<select size="1" name="classtype" class="select">
<option value="0">栏目</option>
<option value="1">文章</option>
<option value="2">学者/专家</option>
<option value="3">网站连接</option>
</select></td>
</tr>
<tr>
<td width="100%" height=24 class="tdbg" colspan="2" align="center">
<input type="submit" name="Submit" value="添加类别" class="buttonface">
</td>
</tr>
</table></form>
</center>
</div>
</body>
</html>
<% }
}
if(action1.equals("editsavenew")){
stmt.executeUpdate("update scott.class set class='"+class1+"', parentid='"+parentid+"', classtype='"+classtype+"' where classid='"+classid+"'");
out.print("<script>alert('修改成功');document.location='classmana.jsp';</script>");
}
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -