<!--#include file = "conn.asp"-->
<!--#include file = "char.asp"-->
<%
Set cc = conn.execute("Select [aname],[pwd] From [manager] Where [aname]='"&session("Jastudiouser")&"' and [pwd] ='"&session("Jastudiopass")&"'")
If cc.Eof and cc.Bof Then%>
用户或者密码错误！请返回重登陆！
<Script Language="JavaScript">
setTimeout("location.replace('admin.htm')",1500)
</Script>
<%
Else
%>
<html><head><title>管理中心</title><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><LINK href="admin/admin.css" type=text/css rel=stylesheet>
<%
If Request.QueryString("action")="add" Then
num = Request.Form("num")
Set Rs =conn.execute("select [lanid] From [menu] Where [lanid]="&num)
If Not (Rs.Eof or Rs.Bof) Then
Response.Write "排序号已经存在，请选择其他不存在号码。"
Else
menuname = strkill(Request.Form("menuname"))
num = Request.Form("num")
info = strkill(Request.Form("info"))
Set Rs = Server.CreateObject("ADODB.RecordSet")
sql = "select * From [menu] where (menuid Is Null)"
Rs.Open sql,conn,1,3
Rs.AddNew
Rs("laname") = menuname
Rs("lanid") = num
Rs("info") = info
Rs.Update
Response.Write "栏目添加成功,请继续其他操作!"
End If
End If
If Request.QueryString("action")="del" Then
lanid = Request.QueryString("id")
laname = strkill(Request.QueryString("name"))
Set Rs = Server.CreateObject("ADODB.RecordSet")
Set Rs = conn.execute("Delete From [menu] Where menuid = "&lanid)
Set Rs = conn.execute("Delete From [pro] Where promenu = '"&laname&"'")
Response.Write "栏目和栏目里的产品已经删除,请继续其他操作"
End If
If Request.QueryString("action")="edit" Then
menuid = Request.Form("id")
num = Request.Form("num")
Set Rs =conn.execute("select lanid From [menu] Where menuid<>"&menuid&" and lanid="&num)
If Not (Rs.Eof or Rs.Bof) Then
Response.Write "排序号已经存在，请选择其他不存在号码。"
Else
menuid = Request.Form("id")
menuname = strkill(Request.Form("menuname"))
num = Request.Form("num")
info = strkill(Request.Form("info"))
Set Rs = Server.CreateObject("ADODB.RecordSet")
Set Rs = conn.execute("Update [menu] Set laname='"&menuname&"',info='"&info&"',lanid='"&num&"' Where menuid="&menuid)
Response.Write "栏目修改成功,请继续其他操作!"
End If
End If
If Request.QueryString("action")="all" Then
laname = strkill(Request.QueryString("name"))
Set Rs = Server.CreateObject("ADODB.RecordSet")
Set Rs = conn.execute("Delete From [pro] Where promenu = '"&laname&"'")
Response.Write "该栏目的产品已经删除,请继续其他操作"
End If
End If
rs.close
set rs = Nothing
cc.close
Set cc =nothing
%>