📄 sort_add.asp
字号:
<!--#include file="../inc/CheckAdmin.asp"-->
<!--#include file="../inc/Config.asp"-->
<!--#include file="../inc/Navtree.asp"-->
<!--#include file="../inc/Conn.asp"-->
<!--#include file="setting.asp"-->
<%
Dim Language
Language=formatStr(Request("Language"))
if Language="" then Language="C"
table_behind="ProductSort_"
table=Get_Table(table_behind,Language)
if request.form("add")=1 then
if request.form("Name")="" then
check_alert "城市名称不能为空",request.ServerVariables("HTTP_REFERER")
end if
savetree table,request.form("sortid"),request.form("Name"),request.form("address"),request.form("content1")
closeconn
response.Redirect("Sort_Admin.asp?Language="&Language)
response.end
end if
sub savetree(table,sortid,PS_Name,pic,Memo)
Order=0
Oldaddress=""
PS_Id="" '路径标志计算开始
S_address=getaddress(table,sortid)
Order=countorder(table,sortid)
rs.open"select * from "&table&"",conn,1,3
rs.addnew
rs("PS_Order")=Order
rs("PS_Pic")=pic
rs("PS_Address")=S_address
rs("PS_parentid")=Sortid
rs("PS_Name")=PS_Name
rs("PS_Memo")=Memo
rs.update
rs.close
updateundersideaddress table,Oldaddress,S_address,PS_Id
end sub
function getaddress(table,id)
'获取当前记录的路径
rs.open"select * from "&table&" where PS_Id="&id,conn,1,1
if not rs.eof then
if rs("PS_Address")<>"" then
getaddress=rs("PS_Address")&","&rs("PS_Id")
else
getaddress=rs("PS_Id")
end if
else
getaddress=""
end if
rs.close '路径标志计算结束
end function
function countorder(table,id)
'计算排序值开始
rs.open"select top 1 * from "&table&" where PS_Parentid="&id&" order by PS_Order desc",conn,1,1
if not rs.eof then
countorder=rs("PS_Order")+1
else
countorder=0
end if
rs.close
'计算排序值结束
end function
sub updateundersideaddress(table,Oldaddress,addres,PS_Id)
'更改下面子类的路径开始
rs.open"select * from "&table&" where PS_Address like '"&Oldaddress&"%'",conn,1,3
if addres<>"" then
addres=addres&","&PS_Id
else
addres=PS_Id
end if
do while not rs.eof
showaddress=replace(rs("PS_Address"),Oldaddress,addres)
rs("PS_Address")=showaddres
rs.movenext
loop
rs.close
'更改下面子类的路径结束
end sub
if request("id")<>"" then
SortId=request("id")
else
SortId=0
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}
.STYLE2 {color: #FF0000}
-->
</style>
<script language="JavaScript">
function Check()
{/*if (form.language.value=="")
{alert ("请选择语言版本")
form.language.focus();
return false;
}*/
if (form.Name.value == "")
{alert("名称不能为空。");
form.Name.focus();
return false;
}
document.form.submit();
}
</script>
</head>
<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>
<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>
<select name="Sortid" id="Sortid">
<% If table<>"None" Then %>
<option value='0'>顶级城市</option>
<%showtreefornav table,"PS_",0,"rs","",SortId,isadd %>
<% Else %>
<option value="" selected>没有城市</option>
<% End If %>
</select>
<span class="STYLE2">*</span> <input type="hidden" name="add" value=1 id="add"></td>
</tr>
<tr class="tdbg">
<td><div align="right"><strong>名称:</strong></div></td>
<td><input name="Name" type="text" id="Name" size="16">
<span class="STYLE2">*</span></td>
</tr>
<tr class="tdbg" style="display:<% If ProRadio(27)=0 Then %>none<% End If %>">
<td><div align="right"><strong>类别图片:</strong></div></td>
<td><table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td id="hidpic" style="display:'<%if addres<>"" then%>none<%end if%>'" ><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td id="hiddenframe"><a style="cursor:hand" onClick="document.all.showframe.style.display='';document.all.hiddenframe.style.display='none';"> 上传图片</a> <a style="cursor:hand" onClick="document.all.adddz.style.display='';document.all.hiddenframe.style.display='none';">插入图片URL</a>
<input name="address" type="hidden" id="address"></td>
</tr>
<tr>
<td height="17" id="showframe" style="display:none"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="245" height="15"><iframe src='../inc/uppic.asp?up=../../uploadfile/Product_Sort/&tup=address' frameborder=0 height=25 width="100%" scrolling="no"></iframe> </td>
<td width="332" align="left" valign="baseline"><a style="cursor:hand" onClick="document.all.showframe.style.display='none';document.all.hiddenframe.style.display='';">取消</a></td>
</tr>
</table> </td>
</tr>
<tr>
<td height="17" id="adddz" style="display:none">
<input name="dz" type="text" id="dz" onChange="document.all.address.value=this.value" size="30" > <a style="cursor:hand" onClick="document.all.adddz.style.display='none';document.all.hiddenframe.style.display='';">取消</a> </td>
</tr>
</table> </td>
<td id="showpic" style="display:'<%if len(addres)>0 then%><%else%>none<%end if%>'" > </td>
</tr>
</table></td>
</tr>
<tr class="tdbg" style="display:<% If ProRadio(28)=0 Then %>none<% End If %>">
<td valign="top"><div align="right"><strong>类别说明:</strong></div></td>
<td><input type="hidden" name="content1">
<iframe ID="eWebEditor1" src="../WebEditor/ewebeditor.asp?id=content1&style=SamYan" frameborder="0" scrolling="no" width="560" HEIGHT="350"></iframe> </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 + -