📄 sort_edit.asp
字号:
<!--#include file="../inc/CheckAdmin.asp"-->
<!--#include file="../inc/Config.asp"-->
<!--#include file="../inc/Navtree.asp"-->
<!--#include file="../inc/Conn.asp"-->
<%
Dim Language
Language=formatStr(Request("Language"))
table_behind="LinkSort_"
table=Get_Table(table_behind,Language)
if table="None" then
check_alert "语言版本错误",request.ServerVariables("HTTP_REFERER")
end if
if request("update")=1 then
if request.form("Name")="" then
check_alert "分类名称不能为空",request.ServerVariables("HTTP_REFERER")
end if
savetree table,request("sortid"),request("id"),request("Name"),request("address"),request.form("content1")
'closers
closeconn
response.redirect("Sort_Admin.asp?Language="&Language)
response.end
end if
sub savetree(table,sortid,id,LS_Name,pic,Memo)
Order=0
Oldaddress=""
LS_Id="" '路径标志计算开始
S_address=getaddress(table,sortid)
Order=countorder(table,sortid)
rs.open"select * from "&table&" where LS_Id="&id,conn,1,3
if rs.eof then
rs.addnew
end if
Oldaddress=rs("LS_Address")&","&rs("LS_Id")
LS_Id=rs("LS_Id")
if cstr(sortid)<>cstr(rs("LS_Parentid")) then
rs("LS_Order")=Order
end if
rs("LS_Address")=S_address
rs("LS_parentid")=Sortid
rs("LS_Name")=LS_Name
'rs("LS_Memo")=Memo
rs.update
rs.close
updateundersideaddress table,Oldaddress,S_address,LS_Id
end sub
function getaddress(table,id)
'获取当前记录的路径
rs.open"select * from "&table&" where LS_Id="&id,conn,1,1
if not rs.eof then
if rs("LS_Address")<>"" then
getaddress=rs("LS_Address")&","&rs("LS_Id")
else
getaddress=rs("LS_Id")
end if
else
getaddress=""
end if
rs.close '路径标志计算结束
end function
function countorder(table,id)
'计算排序值开始
rs.open"select top 1 * from "&table&" where LS_Parentid="&id&" order by LS_Order desc",conn,1,1
if not rs.eof then
countorder=rs("LS_Order")+1
else
countorder=0
end if
rs.close
'计算排序值结束
end function
sub updateundersideaddress(table,Oldaddress,addres,LS_Id)
'更改下面子类的路径开始
rs.open"select * from "&table&" where LS_Address like '"&Oldaddress&"%'",conn,1,3
if addres<>"" then
addres=addres&","&LS_Id
else
addres=LS_Id
end if
do while not rs.eof
showaddress=replace(rs("LS_Address"),Oldaddress,addres)
rs("LS_Address")=showaddres
rs.movenext
loop
rs.close
'更改下面子类的路径结束
end sub
LS_Id=0
id=0
if request("id")<>"" then
id=request("id")
If id="" or not isnumeric(id) then Check_Alert "非法操作","Sort_admin.asp"
rs.open"select * from "&table&" where LS_Id="&request("id"),conn,1,1
if not rs.eof then
SortId=rs("LS_parentid")
LS_Name=rs("LS_Name")
'Memo=rs("LS_Memo")
end if
rs.close
else
id=0
end if
if left(addres,4)=cstr(year(now())) then
picpath="../../uploadfile/product_sort/"&addres
elseif addres<>"" then
picpath=addres
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>网站管理系统</title>
<link href="../Css_Main.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {color: #CCCCCC}
-->
</style>
</head>
<script language="JavaScript">
function Check()
{
if (form.Name.value == "")
{alert("类别名称不能为空");
form.Name.focus();
return false;
}
document.form.submit();
}
</script>
<body>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="1" class="border">
<tr>
<td class="title_dh"><div align="center">新闻中心——修改分类</div></td>
</tr>
</table>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="20"></td>
</tr>
</table>
<form name="form" method="post" action="">
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="1" class="border">
<tr class="title_top">
<td colspan="2"><div align="center">修改分类</div></td>
</tr>
<tr class="tdbg">
<td width="20%">
<div align="right"><strong>版本:</strong></div></td>
<td><%= Check_Language(Language) %></td>
</tr>
<tr class="tdbg">
<td><div align="right"><strong>所属分类:</strong></div></td>
<td><select name="Sortid" id="select">
<option value='0'>顶级分类</option>
<%showtreefornav table,"LS_",0,"rs","",SortId,isadd %>
</select>
<input name="id" type="hidden" id="id" value="<%=id%>">
<input name="update" type="hidden" id="update" value="1">
<font color="#FF0000">*</font></td>
</tr>
<tr class="tdbg">
<td><div align="right"><strong>类别名称:</strong></div></td>
<td><input name="Name" type="text" id="Name" value="<%=LS_Name%>" size="16">
<font color="#FF0000">*</font></td>
</tr>
</table>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="40">
<div align="center"><span class="style1">
<input type="button" name="Submit" value="修改" onClick="Check()">
<input type="reset" name="reset" value="取消">
</span> </div></td>
</tr>
</table>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -