cxsort_edit.asp
来自「能进行网上购物的需求」· ASP 代码 · 共 238 行
ASP
238 行
<!--#include file="conn.asp" -->
<%
if session("admin_name")="" then
response.redirect "error.asp?error=001"
end if
%>
<%
'开始添加操作
if request("action")="add" then
sort_name=trim(request("sort_name"))
csort_name=trim(request("csort_name"))
cxsort_name=trim(request("cxsort_name"))
cxsort_ename=trim(request("cxsort_ename"))
cxsort_fname=trim(request("cxsort_fname"))
number=request("number")
'检验此二级分类是否唯一
sql="select * from 56770_cxsort where sort_name="&request("sort_name")&" and csort_name="&request("csort_id")&" and cxsort_name='"&cxsort_name&"' order by cxsort_id desc"
set rs=server.createobject("ADODB.Recordset")
rs.open sql,conn,1,1
if not(rs.eof or rs.bof) then
response.write"<SCRIPT language=JavaScript>alert('对不起,此三级分类名[或编号]不唯一,请核实!');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.end
end if
rs.close
set rs=nothing
conn.execute "insert into 56770_cxsort (sort_name,csort_name,cxsort_name,cxsort_ename,cxsort_fname,xnumber) values ("&request("sort_name")&","&request("csort_id")&",'"&cxsort_name&"','"&cxsort_ename&"','"&cxsort_fname&"','"&number&"')"
url="sort.asp"
response.redirect url
response.end
end if
%>
<%
'开始删除操作
if request("action")="del" then
conn.execute "delete * from 56770_cxsort where cxsort_id="&request("cxsort_name")&" and xnumber='"&request("xnumber")&"'"
conn.execute "delete * from 56770_cysort where cxsort_name="&request("cxsort_name")&""
conn.execute "delete * from 56770_product where cxsort_name="&request("cxsort_name")&""
url="sort.asp"
response.redirect url
response.end
end if
%>
<%
'开始修改操作
if request("action")="modi" then
Response.Write("<script>alert("" 很抱歉,程序版本为试用版 \n\n 您无法对数据库进行操作,如您需要请您购买商业版本 \n\n *****感谢您对我们的支持,我们会继续努力***** \n\n QQ:88464758 联系电话:0451-89575990 \n\n为中国电子商务发展助力!-- 56770.com"");history.back();</script>")
Response.end
end if
%>
<%
'开始合并操作
if request("action")="unite" then
unitecxsort1=request("unitecxsort1")
unitecxsort2=request("unitecxsort2")
unitecxsortto=request("unitecxsortto")
if unitecxsort1="" or unitecxsort2="" or unitecxsortto="" then
response.write"<SCRIPT language=JavaScript>alert('对不起,您在合并分类时有错误操作,请核实!');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.end
end if
conn.execute "update 56770_cxsort set cxsort_name='"&unitecxsortto&"' where cxsort_name='"&unitecxsort1&"'"
conn.execute "update 56770_cysort set cxsort_name='"&unitecxsortto&"' where cxsort_name='"&unitecxsort1&"'"
conn.execute "delete * from 56770_cxsort where cxsort_name='"&unitecxsort2&"'"
'conn.execute "update 56770_product set cxsort_name='"&unitecxsortto&"' where cxsort_name='"&unitecxsort1&"' or cxsort_name='"&unitecxsort2&"'"
url="sort.asp"
response.redirect url
response.end
end if
%>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="css.css" type="text/css">
</head>
<body bgcolor="#FFFFCC" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" cellspacing="1" cellpadding="2" bgcolor="#FFFFFF" vspace="0" hspace="0">
<tr>
<td height="27" bgcolor="#FFCC33" background="images/admin_bg_1.gif">.:: 您可以在这里进行商品类别相关操作</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="50"> </td>
</tr>
</table>
<br>
<%if request("a")="add" then%>
<table border="0" cellspacing="1" cellpadding="4" bgcolor="#FFFFFF" align="center" width="80%">
<tr>
<td colspan="2" background="images/admin_bg_1.gif">为 <font color="#FFFFFF"><%=request("csort_name")%></font> 添加三级分类</td>
</tr>
<form name="addcsort" method="post" action="cxsort_edit.asp">
<%
sql="select * from 56770_cxsort order by cxsort_id desc"
set rs=server.createobject("ADODB.Recordset")
rs.open sql,conn,1,1
if rs.eof or rs.bof then
number="0001"
else
number=rs("xnumber")+1
number=right("0000"&number,4)
end if
rs.close
set rs=nothing
%>
<tr bgcolor="#B0CBE6">
<td align="right" width="25%">简体中文名:</td>
<td>
<input type="text" name="cxsort_name" class="form">
</td>
</tr>
<tr bgcolor="#B0CBE6">
<td align="right" width="25%">繁体中文名:</td>
<td>
<input type="text" name="cxsort_fname" class="form">
</td>
</tr>
<tr bgcolor="#B0CBE6">
<td align="right" width="25%">英文名:</td>
<td>
<input type="text" name="cxsort_ename" class="form">
</td>
</tr>
<tr bgcolor="#B0CBE6">
<td align="right">编号:</td>
<td>
<input type="text" name="number" class="form" value=<%=number%>>
</td>
</tr>
<tr bgcolor="#B0CBE6">
<td colspan="2" align="center" >
<input type="submit" name="Submit" value="添 加">
<input type="hidden" name="action" value="add">
<input type="hidden" name="sort_name" value="<%=request("sort_name")%>">
<input type="hidden" name="csort_id" value="<%=request("csort_id")%>">
</td>
</tr>
</form>
</table>
<%end if%>
<br>
<%if request("a")="modi" then%>
<%
sql="select * from 56770_cxsort where cxsort_id="&request("cxsort_id")&""
set rs=server.createobject("ADODB.Recordset")
rs.open sql, conn, 1, 1
cxsort_name=rs("cxsort_name")
cxsort_ename=rs("cxsort_ename")
cxsort_fname=rs("cxsort_fname")
rs.Close
set rs=nothing
%>
<table border="0" cellspacing="1" cellpadding="4" bgcolor="#FFFFFF" align="center" width="60%">
<form name="modicxsorta" method="post" action="cxsort_edit.asp?cxsort_id=<%=request("cxsort_id")%>">
<tr bgcolor="#B0CBE6">
<td align="right" width="25%">简体中文名:</td>
<td>
<input type="text" name="cxsort_name" value="<%=cxsort_name%>" class="form">
</td>
</tr>
<tr bgcolor="#B0CBE6">
<td align="right" width="25%">繁体中文名:</td>
<td>
<input type="text" name="cxsort_fname" value="<%=cxsort_fname%>" class="form">
</td>
</tr>
<tr bgcolor="#B0CBE6">
<td align="right" width="25%">英文名:</td>
<td>
<input type="text" name="cxsort_ename" value="<%=cxsort_ename%>" class="form">
</td>
</tr>
<tr bgcolor="#B0CBE6">
<td colspan="2" align="center">
<input type="submit" name="Submit22" value="修 改">
<input type="hidden" name="action" value="modi">
<input type="hidden" name="xnumber" value="<%=request("xnumber")%>">
</td>
</tr>
</form>
</table>
<%end if%>
<%if request("a")="unite" then%>
<table border="0" cellspacing="1" cellpadding="4" bgcolor="#FFFFFF" align="center" width="60%">
<tr background="images/admin_bg_1.gif">
<td colspan="2" background="images/admin_bg_1.gif">合并<%=sort_name%>下<%=csort_name%>的三级类</td>
</tr>
<form name="unitecxsort" method="post" action="cxsort_edit.asp">
<tr bgcolor="#B0CBE6">
<td align="right" width="25%">分类名:</td>
<td>
<input type="text" name="unitecxsort1" class="form" value=<%=request("unitecxsort")%> readonly>
</td>
</tr>
<tr bgcolor="#B0CBE6">
<td align="right">分类名:</td>
<td>
<select name="unitecxsort2">
<option value="" selected>请选择三级分类(2)</option>
<%
sql="select * from 56770_cxsort where sort_name="&request("sort_name")&" and csort_name="&request("csort_name")&" and cxsort_name<>'"&request("unitecxsort")&"'"
set rs=server.createobject("ADODB.Recordset")
rs.open sql,conn,1,1
while not rs.eof
%>
<option value="<%=rs("cxsort_id")%>"><%=rs("cxsort_name")%></option>
<%
rs.movenext
wend
rs.Close()
set rs=nothing
%>
</select>
</td>
</tr>
<tr bgcolor="#B0CBE6">
<td align="right">合并为:</td>
<td>
<input type="text" name="unitecxsortto" class="form">
</td>
</tr>
<tr bgcolor="#B0CBE6">
<td colspan="2" align="center">
<input type="submit" name="Submit222" value="合 并">
<input type="hidden" name="action" value="unite">
<input type="hidden" name="sort_name" value="<%=request("sort_name")%>">
<input type="hidden" name="csort_name" value="<%=request("csort_name")%>">
</td>
</tr>
</form>
</table>
<%end if%>
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?