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

📄 sort_edit.asp

📁 这是一个物流网站的源代码
💻 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"))
table_behind="NewsSort_"
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,NS_Name,pic,Memo)
   Order=0
   Oldaddress=""
   NS_Id=""                                 '路径标志计算开始
   S_address=getaddress(table,sortid)
   Order=countorder(table,sortid)
                                 
   rs.open"select * from "&table&" where NS_Id="&id,conn,1,3
	  if  rs.eof then
          rs.addnew
	  end if
	  Oldaddress=rs("NS_Address")&","&rs("NS_Id")
	  NS_Id=rs("NS_Id")
      if cstr(sortid)<>cstr(rs("NS_Parentid")) then
         rs("NS_Order")=Order
      end if
   rs("NS_Address")=S_address
   rs("NS_parentid")=Sortid
   rs("NS_Name")=NS_Name
   'rs("NS_Memo")=Memo
   rs.update
   	
   rs.close
   updateundersideaddress table,Oldaddress,S_address,NS_Id
end sub

function getaddress(table,id)
   '获取当前记录的路径
   rs.open"select * from "&table&" where NS_Id="&id,conn,1,1
   if not rs.eof then
      if rs("NS_Address")<>"" then
         getaddress=rs("NS_Address")&","&rs("NS_Id")
      else
         getaddress=rs("NS_Id") 
	  end if
   else
      getaddress=""
   end if
   rs.close                                        '路径标志计算结束
end function

function countorder(table,id)
   '计算排序值开始
   rs.open"select top 1 * from "&table&" where NS_Parentid="&id&" order by NS_Order desc",conn,1,1
   if not rs.eof then
      countorder=rs("NS_Order")+1
   else
       countorder=0
   end if
   rs.close
   '计算排序值结束
end function

sub updateundersideaddress(table,Oldaddress,addres,NS_Id)
   '更改下面子类的路径开始
   rs.open"select * from "&table&" where NS_Address like '"&Oldaddress&"%'",conn,1,3
   if addres<>"" then
      addres=addres&","&NS_Id
   else
      addres=NS_Id
   end if
   do while not rs.eof 
       showaddress=replace(rs("NS_Address"),Oldaddress,addres)
       rs("NS_Address")=showaddres
	   rs.movenext   
   loop
   rs.close
   '更改下面子类的路径结束
end sub

NS_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 NS_Id="&request("id"),conn,1,1
   if not rs.eof then
      SortId=rs("NS_parentid")
	  NS_Name1=rs("NS_Name")
	  'Memo=rs("NS_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="3"><div align="center">修改分类</div></td>
  </tr>
  <tr class="tdbg">
    <td width="20%">
    <div align="right"><strong>版本:</strong></div></td>
    <td colspan="2"><%= Check_Language(Language) %></td>
  </tr>
  <tr class="tdbg">
    <td><div align="right"><strong>所属分类:</strong></div></td>
    <td colspan="2"><select name="Sortid" id="select">
      <option value='0'>顶级分类</option>
      <%showtreefornav table,"NS_",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 colspan="2"><input name="Name" type="text" id="Name" value="<%=NS_Name1%>" size="16">
      <font color="#FF0000">*</font></td>
  </tr>
  <tr class="tdbg" style="display:<% If newsRadio(5)=0 Then %>none<% End If %>">
    <td><div align="right"><strong><strong>新闻预览图:</strong></strong></div></td>
             		       <td id="showpic" style="display:'<%if  len(textimg)>11 then%><%else%>none<%end if%>'" ><table width="100%">
        		            <tr>
         		             <td valign="middle" width="21%" id="pic"><a href="<%=spicpath%>" target="_blank"><img src="<%=spicpath%>" width="120" height="50" id="image" border="0"></a></td>
         		             <td valign="middle"><a style="cursor:'hand'" onClick="document.all.hidpic.style.display='';document.all.showpic.style.display='none';">&nbsp;&nbsp;更改图片</a>&nbsp;&nbsp;<a style="cursor:hand" onClick="document.all.textimg.value='';document.all.showpic.style.display='none';document.all.hidpic.style.display='';">删除图片</a></td>
       		             </tr>
        		        </table></td>
    <td id="hidpic" style="display:'<%if len(textimg)>11 then%>none<%end if%>'" ><table width="98%" 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';">&nbsp;上传图片</a>&nbsp;&nbsp;<a style="cursor:hand" onClick="document.all.adddz.style.display='';document.all.hiddenframe.style.display='none';">插入图片URL</a>
            <input name="textimg" type="hidden" id="textimg" value="<%= textimg %>"></td>
      </tr>
      <tr>
        <td height="17" id="showframe" style="display:none"><table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td height="15">   <div align="left">
                <table width="100%"  border="0" align="left" cellpadding="0" cellspacing="0">
                  <tr>
                    <td width="245"><iframe src='../inc/uppic.asp?up=../../uploadfile/News_title/&tup=textimg' frameborder=0 height=25 width="100%" scrolling="no"></iframe></td>
                    <td><div align="left"><a style="cursor:hand" onClick="document.all.showframe.style.display='none';document.all.hiddenframe.style.display='';">取消</a></div></td>
                  </tr>
                </table>
              </div></td>
              </tr>
        </table></td>
      </tr>
      <tr>
        <td height="17" id="adddz" style="display:none">&nbsp;
            <input name="dz" type="text" id="dz" onChange="document.all.textimg.value=this.value" size="30" >
      &nbsp; <a style="cursor:hand" onClick="document.all.adddz.style.display='none';document.all.hiddenframe.style.display='';">取消</a> </td>
      </tr>
    </table></td>
  </tr>
  <tr class="tdbg" style="display:none">
    <td><div align="right"><strong>浏览权限:</strong></div></td>
    <td colspan="2"><input name="power" type="radio" value="0" <% 'if Power=0 then Response.Write(" checked") %>>
      所有浏览者
        <input name="power" type="radio" value="1" <% 'if Power=1 then Response.Write(" checked") %>>
      普通会员
      <input name="power" type="radio" value="2" <% 'if Power=2 then Response.Write(" checked") %>>
      商务会员
      <input name="power" type="radio" value="3" <% 'if Power=3 then Response.Write(" checked") %>>
      VIP会员</td>
  </tr>
  <tr class="tdbg" style="display:<% If newsRadio(6)=0 Then %>none<% End If %>">
    <td><div align="right"><strong>详细说明:</strong></div></td>
    <td colspan="2"><input type="hidden" name="content1" value="<%=Server.HTMLEncode(Content)%>">
       <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()">
&nbsp;
        <input type="reset" name="reset" value="取消">
    </span> </div></td>
  </tr>
</table>
</form>
</body>
</html>


⌨️ 快捷键说明

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