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

📄 prod0.asp

📁 这是一个很漂亮的网站购物系统
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<!--#include file="../include/buyok_shop_30_conn.asp"-->
<!--#include file="checkadmin.asp"-->
<script language=javascript src=../include/mouse_on_title.js></script>
<%
call checkmanage("03")
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="manage.css" type="text/css">
</head>
<BODY background="../images/admin/back.gif">
<%

Set setup = conn.Execute("select * from shopsetup") 
tree_del_yesorno=setup("tree_del_yesorno")
set setup=nothing

action = request("action")
if action="" then
call showclass()
end if

if action="editclass" then
'编辑类别名字
call editclass()
end if

if action="delMidclass" then
'删除二级分类
MidCode=request("MidCode")
LarCode=request("LarCode")
call delmidclass()
end if

if action="addMidclass" then
'增加二级分类
call addmidclass()
end if

if action="addLarclass" then
'增加一级分类
call addlarclass()
end if

if action="delLarclass" then
'删除一级分类
LarCode=request("LarCode")
call dellarclass()
end if


sub addmidclass()
'增加二级分类
LarCode=trim(request("LarCode"))
if request("add")="ok" then
newclass=trim(request("newclass"))
If trim(newclass)="" or instr(newclass,"&")>0 or instr(newclass,"%")>0 or instr(newclass,"'")>0 or instr(newclass,"&quot;")>0 then
response.write "<script language='javascript'>"
response.write "alert('出错了,资料填写不完整或不符合要求,请检查后重新提交。');"
response.write "location.href='javascript:history.go(-1)';"
response.write "</script>"
response.end
response.end
end if
set rs=conn.execute("select * from buyok_class where MidCode='"&newclass&"' and LarCode='"&LarCode&"'")
if not (rs.eof and rs.bof) then
response.write "<script language='javascript'>"
response.write "alert('出错了,已经有一个同名二级分类存在,请使用其它名称吧。');"
response.write "location.href='javascript:history.go(-1)';"
response.write "</script>"
response.end
end if
set rs=nothing
sql="select * from buyok_class where LarCode='"&LarCode&"' order by MidSeq"
set rs=conn.execute(sql)
while Not rs.eof
counter=rs("MidSeq")+1
larseq=rs("LarSeq")
rs.movenext
wend
set rsadd=server.createobject("adodb.recordset")
rsadd.open "buyok_class",conn,1,3
rsadd.addnew
rsadd("LarSeq")=larseq
rsadd("LarCode")=LarCode
rsadd("MidSeq")=counter
rsadd("MidCode")=newclass
rsadd.update
rsadd.close
set rsadd=nothing
rs.close
set rs=nothing
    Set Fso = CreateObject("Scripting.FileSystemObject")
	set buyok_class=Fso.CreateTextFile(Server.MapPath("../include/buyok_class.asp"),true)


	set rs=conn.execute("select * from buyok_class order by LarSeq asc, MidSeq asc")
	if rs.eof and rs.bof then 
		buyok_class.writeline "暂无商品分类"
	else
		Do While Not rs.eof
		if rs("LarCode")<>old then
			buyok_class.writeline "lar:"&rs("LarCode")
		end if
			buyok_class.writeline rs("MidCode")
			old=rs("LarCode")
		rs.movenext
		if rs.eof then exit do
		Loop
	end if
	set rs=nothing

	buyok_class.close
    set fso=nothing

response.write "<script language='javascript'>"
response.write "alert('操作成功,已添加了二级分类“"&trim(request("newclass"))&"”。');"
response.write "location.href='prod0.asp';"
response.write "</script>"
response.end
else
%>
<table width="98%" border="1"  style="border-collapse: collapse; border-style: dotted; border-width: 0px" bordercolor="#333333" cellspacing="0" cellpadding="2">
  <tr> 
    <td colspan=2 class=td height=18> 
      <div align="center"><b><font color="#FF0000"> <font color="#FFFFFF">抱歉,您使用的是未注册版本,未提供本功能. 
        </font></font></b></div>
    </td>
  </tr>
<tr>
    <td width=13% height=25 align=center>&nbsp;</td>
    <td width="87%"><b><font color="#FF0000">客户服务及反馈中心 抱歉,您使用的是未注册版本,未提供本功能.</font></b></td>
  </tr>
<tr>
    <td width=13% height=25 align=center valign=top"><font color="#FF0000">联系方式</font></td>
    <td width="87%"><b><font color="#FF0000">Phone:010-88684912 13366690044 MSN:asp3721@msn.com 
      QQ:88353022  </font></b></td>
  </tr>
<form action='prod0.asp?action=addMidclass' method=post name=addmidclass>
<tr>
      <td width=13% height=25 align=center><font color="#FF0000">备 注</font></td>
      <td width="87%"><b><font color="#FF0000">非在线支付购买的用户,汇完款 请QQ或电话联系管理员</font></b></td>
    </tr>
<tr>
      <td colspan=2> 
        <div align="center"><b><font color="#FF0000"><a href="http://www.asp3721.cn/"><font color="#990000">asp3721软件中心 
          我们将为你提供优质服务,谢谢!http://www.asp3721.cn/</font></a></font></b> </div>
      </td>
    </tr>
</form>
</table>
<%
rs.close
set rs=nothing
end if
end sub

sub addlarclass()
'增加一级分类
if request("add")="ok" then
If trim(request("newclass"))="" or instr(request("newclass"),"&")>0 or instr(request("newclass"),"%")>0 or instr(request("newclass"),"'")>0 or instr(request("newclass"),"&quot;")>0 then
response.write "<script language='javascript'>"
response.write "alert('出错了,资料填写不完整或不符合要求,请检查后重新提交。');"
response.write "location.href='javascript:history.go(-1)';"
response.write "</script>"
response.end
end if
set rs=conn.execute("select * from buyok_class where LarCode='"&trim(request("newclass"))&"'")
if not (rs.eof and rs.bof) then
response.write "<script language='javascript'>"
response.write "alert('出错了,已经有一个同名分类存在,请使用其它名称。');"
response.write "location.href='javascript:history.go(-1)';"
response.write "</script>"
response.end
end if
set rs=nothing
set rs=conn.execute("select * from buyok_class order by larseq desc")
if not (rs.eof and rs.bof) then
count=clng(rs("larseq"))+1
else
count=1
end if
set rs=nothing
set rsadd=Server.CreateObject("ADODB.Recordset")
sql="SELECT * FROM buyok_class"
rsadd.open sql,conn,3,3
rsadd.addnew
rsadd("LarSeq")=count
rsadd("MidSeq")=1
rsadd("LarCode")=trim(request.form("newclass"))
rsadd("MidCode")=trim(request.form("newclass"))
rsadd.update
rsadd.close
set rsadd=nothing
    Set Fso = CreateObject("Scripting.FileSystemObject")
	set buyok_class=Fso.CreateTextFile(Server.MapPath("../include/buyok_class.asp"),true)


	set rs=conn.execute("select * from buyok_class order by LarSeq asc, MidSeq asc")
	if rs.eof and rs.bof then 
		buyok_class.writeline "暂无商品分类"
	else
		Do While Not rs.eof
		if rs("LarCode")<>old then
			buyok_class.writeline "lar:"&rs("LarCode")
		end if
			buyok_class.writeline rs("MidCode")
			old=rs("LarCode")
		rs.movenext
		if rs.eof then exit do
		Loop
	end if
	set rs=nothing

	buyok_class.close
    set fso=nothing
response.write "<script language='javascript'>"
response.write "alert('操作成功,已添加一级分类“"&trim(request.form("newclass"))&"”,及一个同名的二级分类。');"
response.write "location.href='prod0.asp';"
response.write "</script>"
response.end
else
set rs=server.createobject("adodb.recordset")
sql="select distinct LarCode,LarSeq from buyok_class order by LarSeq asc"
rs.open sql,conn,1,1
%>
<table width="98%" border="1"  style="border-collapse: collapse; border-style: dotted; border-width: 0px" bordercolor="#333333" cellspacing="0" cellpadding="2">
  <tr> 
    <td colspan=2 class=td height=18> 
      <div align="center"><b><font color="#FF0000"> <font color="#FFFFFF">抱歉,您使用的是未注册版本,未提供本功能. 
        </font></font></b></div>
    </td>
  </tr>
  <tr> 
    <td width=13% height=25 align=center>&nbsp;</td>
    <td width="87%"><b><font color="#FF0000">客户服务及反馈中心 抱歉,您使用的是未注册版本,未提供本功能.</font></b></td>
  </tr>
  <tr> 
    <td width=13% height=25 align=center valign=top"><font color="#FF0000">联系方式</font></td>
    <td width="87%"><b><font color="#FF0000">Phone:010-88684912 13366690044 MSN:asp3721@msn.com 
      QQ:88353022  </font></b></td>
  </tr>
  <form action='prod0.asp?action=addMidclass' method=post name=addmidclass>
    <tr> 
      <td width=13% height=25 align=center><font color="#FF0000">备 注</font></td>
      <td width="87%"><b><font color="#FF0000">非在线支付购买的用户,汇完款 请QQ或电话联系管理员</font></b></td>
    </tr>
    <tr> 
      <td colspan=2> 
        <div align="center"><b><font color="#FF0000"><a href="http://www.asp3721.cn/"><font color="#990000">asp3721软件中心 
          我们将为你提供优质服务,谢谢!http://www.asp3721.cn/</font></a></font></b> </div>
      </td>
    </tr>
  </form>
</table>
<%
rs.close
set rs=nothing
end if
end sub


sub delmidclass()
'删除二级分类
conn.execute "delete from buyok_class where MidCode='"&request("MidCode")&"' and  larCode='"&request("larCode")&"'" 
'同步删除该分类下的所有商品
if tree_del_yesorno="1" then
conn.execute "delete from buyok_produc where MidCode='"&request("MidCode")&"' and  larCode='"&request("larCode")&"'" 
else
conn.execute "update buyok_produc set MidCode='未归类',Larcode='未归类' where MidCode='"&request("MidCode")&"' and  larCode='"&request("larCode")&"'" 
end if
Set Fso = CreateObject("Scripting.FileSystemObject")
	set buyok_class=Fso.CreateTextFile(Server.MapPath("../include/buyok_class.asp"),true)


	set rs=conn.execute("select * from buyok_class order by LarSeq asc, MidSeq asc")
	if rs.eof and rs.bof then 
		buyok_class.writeline "暂无商品分类"
	else
		Do While Not rs.eof
		if rs("LarCode")<>old then
			buyok_class.writeline "lar:"&rs("LarCode")
		end if
			buyok_class.writeline rs("MidCode")
			old=rs("LarCode")
		rs.movenext
		if rs.eof then exit do
		Loop
	end if
	set rs=nothing

	buyok_class.close
    set fso=nothing
conn.close
response.write "<script language='javascript'>"
if tree_del_yesorno="1" then
response.write "alert('操作成功,所选二级分类已被删除\n\n注意:该分类下的所有商品已被同时删除。');"
else
response.write "alert('操作成功,所选二级分类已被删除\n\n注意:该分类下的所有商品已被设为未归类商品。');"
end if
response.write "location.href='prod0.asp';"	
response.write "</script>"
end sub

sub delLarclass()
'删除一级分类
conn.execute "delete from buyok_class where LarCode='"&request("LarCode")&"'" 
'同步删除该分类下的所有商品
if tree_del_yesorno="1" then
conn.execute "delete from buyok_produc where LarCode='"&request("LarCode")&"'" 
else
conn.execute "update buyok_produc set MidCode='未归类',Larcode='未归类' where larCode='"&request("larCode")&"'" 
end if

Set Fso = CreateObject("Scripting.FileSystemObject")
	set buyok_class=Fso.CreateTextFile(Server.MapPath("../include/buyok_class.asp"),true)


	set rs=conn.execute("select * from buyok_class order by LarSeq asc, MidSeq asc")
	if rs.eof and rs.bof then 
		buyok_class.writeline "暂无商品分类"
	else
		Do While Not rs.eof
		if rs("LarCode")<>old then
			buyok_class.writeline "lar:"&rs("LarCode")
		end if
			buyok_class.writeline rs("MidCode")
			old=rs("LarCode")
		rs.movenext
		if rs.eof then exit do
		Loop
	end if
	set rs=nothing

	buyok_class.close
    set fso=nothing
conn.close
response.write "<script language='javascript'>"
if tree_del_yesorno="1" then
response.write "alert('操作成功,所选一级分类已被删除\n\n注意:该分类下的所有商品已被同时删除。');"
else
response.write "alert('操作成功,所选一级分类已被删除\n\n注意:该分类下的所有商品已被设为未归类商品。');"
end if
response.write "location.href='prod0.asp';"	
response.write "</script>"
response.end
end sub

sub editclass()
'编辑商品分类
if request("MidCode")<>"" then
 sql="select * from buyok_class where MidCode='"&request("MidCode")&"' and  larCode='"&request("larCode")&"'"
 text="MidCode"
elseif request("LarCode")<>"" then
 sql="select * from buyok_class where LarCode='"&request("LarCode")&"'"
 text="LarCode"
end if

if request("edit")="ok" then
'修改二级分类名称
if request("MidCode")<>"" then

'重名处理,检查相同的一级分类下面,是否已经有这个名称的二级分类存在
set rs=conn.execute("select * from buyok_class where MidCode='"&request("MidCode")&"' and  larCode='"&request("larCode")&"'")
if request("old")=request("midcode") then
	response.write "<script language='javascript'>"
	response.write "alert('出错了,新旧名称相同,未作修改。');"
	response.write "location.href='prod0.asp';"
	response.write "</script>"
	response.end
end if

if not ( rs.eof and rs.bof ) then
	response.write "<script language='javascript'>"
	response.write "alert('出错了,已经有这个名称的二级分类,请使用其它名称。');"
	response.write "location.href='javascript:history.go(-1)';"
	response.write "</script>"
	response.end
end if
set rs=nothing
'更新类别名称
conn.execute("update buyok_class set MidCode='"&trim(request("MidCode"))&"' where Midcode='"&request("old")&"' and LarCode='"&request("larcode")&"'")
'同步更新商品资料中的类别
conn.execute("update buyok_produc set MidCode='"&trim(request("MidCode"))&"' where Midcode='"&request("old")&"' and LarCode='"&request("larcode")&"'")


'修改一级分类名称
elseif request("LarCode")<>"" then

set rs=conn.execute("select * from buyok_class where larCode='"&request("larCode")&"'")
if request("old")=request("larcode") then
	response.write "<script language='javascript'>"
	response.write "alert('出错了,新旧名称相同,未作修改。');"
	response.write "location.href='prod0.asp';"
	response.write "</script>"
	response.end
end if

'重名处理,检查是否已经有同名的一级分类存在
if not ( rs.eof and rs.bof ) then
	response.write "<script language='javascript'>"
	response.write "alert('出错了,已经有这个名称的一级分类,请使用其它名称。');"
	response.write "location.href='javascript:history.go(-1)';"
	response.write "</script>"
	response.end
end if
set rs=nothing

'更新类别名称
conn.execute("update buyok_class set LarCode='"&trim(request("LarCode"))&"' where LarCode='"&request("old")&"'")
'同步更新商品资料中的类别
conn.execute("update buyok_produc set LarCode='"&trim(request("LarCode"))&"' where LarCode='"&request("old")&"'")

end if

    Set Fso = CreateObject("Scripting.FileSystemObject")
	set buyok_class=Fso.CreateTextFile(Server.MapPath("../include/buyok_class.asp"),true)


	set rs=conn.execute("select * from buyok_class order by LarSeq asc, MidSeq asc")
	if rs.eof and rs.bof then 
		buyok_class.writeline "暂无商品分类"
	else
		Do While Not rs.eof
		if rs("LarCode")<>old then
			buyok_class.writeline "lar:"&rs("LarCode")
		end if
			buyok_class.writeline rs("MidCode")

⌨️ 快捷键说明

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