<!--#include file="check.asp"-->
<!--#include file="conn.asp"-->
<%
If Request.QueryString("style")="del" Then
on error resume next
conn.execute("delete * from [classname] where classname='"&Request.Form("classname2")&"'")
conn.execute("delete * from [imgbook] where classname='"&Request.Form("classname2")&"'")
ElseIf Request.QueryString("style")="modify" Then
classname=Trim(Request.Form("newclassname"))
If classname="" Then
Response.Write("<script language=javascript>alert('非法操作!!!');history.back()</script>")
Response.End()
End If
if instr(classname,"'") or instr(classname,"select") or instr(classname,"in") or instr(classname,"from") or instr(classname,"len") or instr(classname,"where") or instr(classname,"or") or instr(classname,"and") then
Response.Write("<script language=javascript>alert('包含非法字符!!!');history.back();</script>")
Response.End
end if
on error resume next
conn.execute("update [classname] set classname='"&classname&"' where classname='"&Request.Form("classname")&"'")
conn.execute("update [imgbook] set classname='"&classname&"' where class='"&Request.Form("classname")&"'")
End If
If Request.QueryString("style")="add" Then
classname=Trim(Request.Form("classname3"))
if instr(classname,"'") or instr(classname,"select") or instr(classname,"in") or instr(classname,"from") or instr(classname,"len") or instr(classname,"where") or instr(classname,"or") or instr(classname,"and") then
Response.Write("<script language=javascript>alert('包含非法字符!!!');history.back();</script>")
Response.End
end if
conn.execute("insert into [classname] (classname) values ('"&classname&"')")
Response.Write("<script language=javascript>alert('成功填加.请返回!');window.location.replace('classmana.asp')</script>")
End If
If Request.QueryString("style")="adds" Then
bigclass=Replace(Trim(Request.Form("bigclass")),"'","")
smallclass=Replace(Trim(Request.Form("smallclass")),"'","")
if instr(smallclass,"'") or instr(smallclass,"select") or instr(smallclass,"in") or instr(smallclass,"from") or instr(smallclass,"len") or instr(smallclass,"where") or instr(smallclass,"or") or instr(smallclass,"and") then
Response.Write("<script language=javascript>alert('包含非法字符!!!');history.back();</script>")
Response.End
end if
if smallclass="" then
Response.Write("<script language=javascript>alert('请填写小类名称!!!');history.back();</script>")
Response.End
end if
conn.execute("insert into [smallclass] (smallclassname,bigclassname) values ('"&smallclass&"','"&bigclass&"')")
Response.Write("<script language=javascript>alert('成功填加.请返回!');window.location.replace('classmana.asp')</script>")
elseif Request.QueryString("style")="modifys" then
bigclass=Replace(Trim(Request.Form("bigclass")),"'","")
smallclass=Replace(Trim(Request.Form("smallclass")),"'","")
smallclassname=Replace(Trim(Request.Form("smallclassname")),"'","")
if instr(smallclass,"'") or instr(smallclass,"select") or instr(smallclass,"in") or instr(smallclass,"from") or instr(smallclass,"len") or instr(smallclass,"where") or instr(smallclass,"or") or instr(smallclass,"and") then
Response.Write("<script language=javascript>alert('包含非法字符!!!');history.back();</script>")
Response.End
end if
if smallclass="" then
Response.Write("<script language=javascript>alert('请选择二级分类!!!');history.back();</script>")
Response.End
end if
if smallclassname="" then
Response.Write("<script language=javascript>alert('请填写新小类名称!!!');history.back();</script>")
Response.End
end if
conn.execute("update [smallclass] set smallclassname='"&smallclassname&"' where bigclassname='"&bigclass&"' and smallclassname='"&smallclass&"'")
Response.Write("<script language=javascript>alert('修改成功.请返回!');window.location.replace('classmana.asp')</script>")
elseif Request.QueryString("style")="dels" then
bigclass=Replace(Trim(Request.Form("bigclass")),"'","")
smallclass=Replace(Trim(Request.Form("smallclass")),"'","")
if instr(smallclass,"'") or instr(smallclass,"select") or instr(smallclass,"in") or instr(smallclass,"from") or instr(smallclass,"len") or instr(smallclass,"where") or instr(smallclass,"or") or instr(smallclass,"and") then
Response.Write("<script language=javascript>alert('包含非法字符!!!');history.back();</script>")
Response.End
end if
if smallclass="" then
Response.Write("<script language=javascript>alert('请选择二级分类!!!');history.back();</script>")
Response.End
end if
conn.execute("delete from [smallclass] where bigclassname='"&bigclass&"' and smallclassname='"&smallclass&"'")
Response.Write("<script language=javascript>alert('删除成功.请返回!');window.location.replace('classmana.asp')</script>")
End If
set rstmp=server.createobject("adodb.recordset")
sql = "select * from SmallClass order by SmallClassID asc"
rstmp.open sql,conn,1,1
%>
<script language = "JavaScript">
var onecount;
subcat = new Array();
<%
count = 0
do while not rstmp.eof
%>
subcat[<%=count%>] = new Array("<%= trim(rstmp("SmallClassName"))%>","<%= trim(rstmp("BigClassName"))%>","<%= trim(rstmp("SmallClassName"))%>");
<%
count = count + 1
rstmp.movenext
loop
rstmp.close
%>
onecount=<%=count%>;
function changelocation(locationid,frm)
{
eval("document."+frm+".SmallClass.length = 1;")
var locationid=locationid;
var i;
for (i=0;i < onecount; i++)
{
if (subcat[i][1] == locationid)
{
eval("document."+frm+".SmallClass.options[document."+frm+".SmallClass.length] = new Option(subcat[i][0], subcat[i][2]);");
}
}
}
</script>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<script language=javascript>
function rusure()
{ question = confirm("此操作会影响到与本分类相关的图片...继续?")
if (question !="0")
{ parent.right.location = "newclassmana.asp" }
}
function xxg()
{
if (form3.classname3.value=="")
{
alert("请写上分类的名字!!!");
form3.classname3.focus();
return false;
}
return true
}
</script>
<body>
<br>
<br>
<%
if session("flag")>0 then
Response.Write("<br><br><br><center>对不起。你没有权限进入此页面!!!</center>")
Response.end
end if
%>
<table width="100%" height="221" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="10%" height="47"> </td>
<td><strong>图片分类管理</strong><br> <br> <font color="#FF0000">注意:分类名称不可包含以下非法字符:
'、@、+、or、from、select、len、where、&、and等</font></td>
</tr>
<tr>
<td height="111" rowspan="2"> </td>
<td><form name="form3" method="post" action="classmana.asp?style=add" οnsubmit="return xxg()">
<table width="100%" height="39" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="11%" height="19"> </td>
<td width="51%" align="center"> </td>
<td width="38%"> </td>
</tr>
<tr>
<td>填加分类</td>
<td> <input name="classname3" type="text" id="classname"> <input type="submit" name="Submit3" value="填加">
</td>
<td> </td>
</tr>
</table>
</form></td>
</tr>
<tr>
<td><form name="form1" method="post" action="classmana.asp?style=modify">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="11%"> </td>
<td width="89%"> </td>
</tr>
<tr>
<td>更改分类</td>
<td><select name="classname" id="select2">
<% sql1="select * from classname"
set rs1=conn.execute(sql1)
do while not rs1.eof %>
<option value=<%=rs1("classname")%>><%=rs1("classname")%></option>
<% i=i+1
rs1.movenext
loop %>
</select>
该名为
<input name="newclassname" type="text" id="newclassname2">
<input type="submit" name="Submit" value="修改" onClick="rusure();return false;">
</td>
</tr>
</table>
</form></td>
</tr>
<tr>
<td> </td>
<td><form name="form2" method="post" action="classmana.asp?style=del">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="11%"> </td>
<td width="89%"> </td>
</tr>
<tr>
<td>删除分类</td>
<td> <select name="classname2" id="select3">
<% sql1="select * from classname"
set rs1=conn.execute(sql1)
do while not rs1.eof %>
<option value=<%=rs1("classname")%>><%=rs1("classname")%></option>
<% i=i+1
rs1.movenext
loop
rs1.close
%>
</select> <input type="submit" name="Submit2" value="删除" onClick="rusure();return false;"></td>
</tr>
</table>
</form></td>
</tr>
</table>
<table width="100%" height="221" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="10%" height="47"> </td>
<td><strong>二级分类管理</strong><br>
<br>
<font color="#FF0000">注意:分类名称不可包含以下非法字符: '、@、+、or、from、select、len、where、&、and等</font></td>
</tr>
<tr>
<td height="111" rowspan="2"> </td>
<td><form name="form4" method="post" action="classmana.asp?style=adds">
<table width="100%" height="39" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="11%" height="19"> </td>
<td width="51%" align="center"> </td>
<td width="38%"> </td>
</tr>
<tr>
<td>填加分类</td>
<td>
一级类别
<select name="bigclass">
<% sql1="select * from classname"
set rs1=conn.execute(sql1)
do while not rs1.eof %>
<option value=<%=rs1("classname")%>><%=rs1("classname")%></option>
<% i=i+1
rs1.movenext
loop
rs1.close
%>
</select>
<input name="smallclass" type="text" id="smallclass">
<input type="submit" name="Submit32" value="填加"> </td>
<td> </td>
</tr>
</table>
</form></td>
</tr>
<tr>
<td><form name="form5" method="post" action="classmana.asp?style=modifys">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="11%"> </td>
<td width="89%"> </td>
</tr>
<tr>
<td>更改分类</td>
<td>一级分类
<select name="BigClass" id="BigClass" onChange="changelocation(document.form5.BigClass.options[document.form5.BigClass.selectedIndex].value,'form5')">
<% sql1="select * from classname"
set rs1=conn.execute(sql1)
do while not rs1.eof %>
<option value=<%=rs1("classname")%>><%=rs1("classname")%></option>
<% i=i+1
rs1.movenext
loop %>
</select>
二级分类
<select name="SmallClass" id="SmallClass">
</select>
该名为
<input name="smallclassname" type="text" id="smallclassname">
<input type="submit" name="Submit4" value="修改">
</td>
</tr>
</table>
</form></td>
</tr>
<tr>
<td> </td>
<td><form name="form6" method="post" action="classmana.asp?style=dels">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="11%"> </td>
<td width="89%"> </td>
</tr>
<tr>
<td>删除分类</td>
<td>
一级分类
<select name="BigClass" id="select4" onChange="changelocation(document.form6.BigClass.options[document.form6.BigClass.selectedIndex].value,'form6')">
<% sql1="select * from classname"
set rs1=conn.execute(sql1)
do while not rs1.eof %>
<option value=<%=rs1("classname")%>><%=rs1("classname")%></option>
<% i=i+1
rs1.movenext
loop %>
</select>
二级分类
<select name="SmallClass" id="select6">
</select>
<input type="submit" name="Submit22" value="删除">
</td>
</tr>
</table>
</form></td>
</tr>
</table>
</body>
</html>