productsort.asp
来自「1. 硬件环境:MS WINDOWS NT PACK 4 OR LATER /W」· ASP 代码 · 共 410 行 · 第 1/2 页
ASP
410 行
<!-- #include file="setup.asp" -->
<!-- #include file="inc/upfile.asp" -->
<%
validate "Login.asp",5
'----------------------------------------------读取价格名称--------------------------------------------
sql="Select FunctionInfo From Functions where FunctionID Between 13 and 15"
Set Rs = Conn.Execute(sql)
ProductI=Rs("FunctionInfo")
rs.movenext
ProductII=Rs("FunctionInfo")
rs.movenext
ProductIII=Rs("FunctionInfo")
rs.close
Set Rs = Nothing
if Request.ServerVariables("request_method")="POST" then
SortCnName=trim(Request.Form("SortCnName"))
SortEnName=trim(Request.Form("SortEnName"))
SortNum=trim(Request.Form("SortNum"))
DadID=trim(Request.Form("DadID"))
editid=Request.Form("editid")
SortPwd=Request.Form("SortPwd")
SortMan=Request.Form("SortMan")
ason=Request.Form("ason")
if isnumeric(SortNum)=false then error 2,"排列序号输入错误!",""
if SortCnName="" and SortEnName="" then error 2,"请输入类别名称!",""
if editid<>"" then
if DadID=editid then error 2,"类别ID设定非法!",""
Set rs = Server.CreateObject("ADODB.Recordset")
did=conn.execute("Select SortDad From Product_Sort where SortID="&editid)(0)
conn.execute("update Product_Sort set SortSon=SortSon-1 where SortID="&did)
sql="Select SortID,SortCnName,SortMan,SortEnName,SortNum,SortPwd,SortDad From Product_Sort where SortID="&editid
rs.open sql,conn,1,3
else
Set rs = Server.CreateObject("ADODB.Recordset")
Sql="Select SortID,SortCnName,SortMan,SortEnName,SortNum,SortPwd,SortDad From Product_Sort"
rs.open Sql,conn,1,3
rs.addnew
end if
SortMan=","&SortMan&","
SortMan=Replace(SortMan,",,",",")
rs("SortCnName")=SortCnName
rs("SortEnName")=SortEnName
rs("SortNum")=SortNum
rs("SortPwd")=SortPwd
rs("SortMan")=SortMan
if DadID<>"" then rs("SortDad")=DadID
rs.update
if DadID<>"" then conn.execute("update Product_Sort set SortSon=SortSon+1 where SortID="&DadID)
TSID=rs("SortID")
if ason = "Yes" Then AsLev TSID,SortMan
rs.close
Set Rs = Nothing
Conn.Close
Set Conn = Nothing
Application(registered&"SortTop")=""
response.redirect "ProductSort.asp"
Response.end
end if%>
<style>
<!--
TABLE{BORDER-TOP:0px;BORDER-LEFT:0px;BORDER-BOTTOM:1px}TD{BORDER-RIGHT:0px;BORDER-TOP:0px}
-->
</style>
<body topmargin=0>
<%
Call top
Call table()%>
<br>
<table borderColor="#a4b6d7" cellSpacing="0" cellPadding="0" width="100%" border="1" style="border-left: 0px none; border-top: 0px none; border-bottom: 1px none; border-collapse:collapse">
<tr>
<td height="25" background=images/title_sub.gif style="border-right: 0px none; border-top: 0px none">
<b> ■ </b><%=Community%>订单管理中心。</td>
</tr>
</table>
<TABLE borderColor=#a4b6d7 cellSpacing=0 cellPadding=3 width=100% border=1 style="border-collapse: collapse">
<form method="POST">
<TR>
<TD height=25 width="60%" > <img src="images/2.gif" width="60" height="9"><a href=ProductSort.asp >[全部类别]</a> <a href=?menu=spreads>[零散类别]</a> <a href=?menu=addsort>[新增主类]</a> <a href=?menu=FsoWrite>[生成报价]</a></TD>
<TD height=25 width="40%" >
</TD>
</TR>
</form>
</TABLE>
<TABLE borderColor=#a4b6d7 cellSpacing=0 cellPadding=3 width=100% border=1 style="border-collapse: collapse">
<TR><TD height=25 width="100%" >
<% Select case Request("menu")
case ""
listsort ""
case "addsort"
addsort ""
case "edit"
addsort(Request("editid"))
case "delsort"
dels Request("id"),Request("dadid")
case "dels"
if Request("R1")="V3" then
delsort Request("id")
else
conn.execute("delete from Product_Sort where SortID="&Request("id"))
if Request("dadid")>0 then
conn.execute("update Product_Sort set SortSon=SortSon-1 where SortID="&Request("dadid"))
end if
error 3,"删除完成!","ProductSort.asp"
end if
case "spreads"
spreads
Case "FsoWrite"
Set fso= CreateObject("Scripting.FileSystemObject")
If Err <> 0 Then Error 2,"报价生成失败!\n对不起,您的空间并不支持FSO组件!",""
set fs=fso.OpenTextFile(Server.Mappath("inc/Sort.asp"),2,True)
FsOWrite
fs.close : set fs=nothing : set fso=nothing
Error 2,"产品报价生成完毕!",""
Case Else
Error 1,"参数非法传递!\n您的IP已被纪录!",""
end Select
Response.write "</TD></TR></TABLE>"
htmlend
sub addsort(editid)
if Request("DadID")="" then
sql="Select SortNum From Product_Sort where SortDad=0 order by SortID desc"
Set Rs = Conn.Execute(sql)
if rs.eof then
sortnu=1
else
sortnu=rs("SortNum")+1
end if
rs.close
Set Rs = Nothing
else
sql="Select SortNum From Product_Sort where SortDad="&Request("DadID")&" order by SortID desc"
Set Rs = Conn.Execute(sql)
if rs.eof then
sortnu=1
else
sortnu=rs("SortNum")+1
rs.close
Set Rs = Nothing
end if
end if
if editid<>"" then
titlen="产品类别资料修改"
sql="Select SortNum,SortCnName,SortEnName,SortPwd,SortDad,SortMan From Product_Sort where SortID="&editid
Set Rs = Conn.Execute(sql)
sortnu=rs("SortNum")
SortCnName=rs("SortCnName")
SortEnName=rs("SortEnName")
SortPwd=Rs("SortPwd")
did=rs("SortDad")
SortMan=rs("SortMan")
'Set Rs = Nothing
rs.close
else
titlen="新增产品分类"
end if
%>
<center>
<form method="POST" name="form">
<table width="100%" border="0" cellspacing="1" cellpadding="4" height="116">
<tr align="left">
<td colspan="2" height="16" align="center" width="975"><%=titlen%></td>
</tr>
<tr>
<td width="492" align="right" height="19">分类名称[CN]</td>
<td width="492" height="19" align="left">
<input type="text" name="SortCnName" size="20" value=<%=SortCnName%>>
</td>
</tr>
<tr>
<td width="492" align="right" height="19">[EN]</td>
<td width="492" height="19" align="left">
<input type="text" name="SortEnName" size="20" value=<%=SortEnName%>>
</td>
</tr>
<tr>
<td width="492" align="right" height="19">类别密码</td>
<td width="492" height="19" align="left">
<input type="text" name="SortPwd" size="10" maxlength="11" value="<%=SortPwd%>" >
<br>[如为公开类别请留空,如为VIP类别请输入"vip"。]</td>
</tr>
<tr>
<td width="492" align="right" height="1">排列序号</td>
<td width="492" height="1" align="left">
<input type="text" name="SortNum" size="3" maxlength="2" value=<%=sortnu%>>
</td>
</tr>
<%
if editid="" then
Response.write "<input name=DadID type=hidden value="&Request("DadID")&">"
end if
if editid<>"" then
Set rsl = Server.CreateObject("ADODB.Recordset")
sql="Select SortCnName,SortID From Product_Sort where SortID="&did
rsl.open sql,conn,1
if rsl.eof then
sortname="TOP类"
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?