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

📄 mov.asp

📁 视频源代码 视频源代码
💻 ASP
字号:
<!--#include file="../inc/conn.asp"-->
<!--#include file="../inc/vip.asp"-->
<%
if not adminlevel=1 then
  call msgbox("您的级别不够!",0)
end if

id=strFilter(request("id"),10)
if id="" then
  call msgbox("请正确指定关系新闻!",1)
end if
if not isnumeric(id) then
  call msgbox("请正确指定关系新闻!",1)
end if
id=CCur(id)
sql="select top 1 categoryid from news where id="&id
rs.open sql,conn,1,1
if not rs.eof then
  categoryid	=rs(0)
else
  rs.close
  call msgbox("该关系新闻不存在!",1)
end if
rs.close

add=request("add")
if add><"" then
  addcategory=request("addcategory")
  if addcategory><"" then
    if isnumeric(addcategory) then
      sql="select categoryname from category where categoryid="&addcategory
      rs.open sql,conn,1,1
      if not rs.eof then
        if not instr(categoryid,"."&addcategory&".")>0 then
          categoryid	=categoryid&addcategory&"."&rs(0)&"."
        end if
      end if
      rs.close
    end if
  end if
  rs.open "update news set categoryid='"&categoryid&"' where id="&id,conn,1,3
end if
del=request("del")
if del><"" then
  delcategory=request("delcategory")
  if delcategory><"" then
    if isnumeric(delcategory) then
      sql="select categoryname from category where categoryid="&delcategory
      rs.open sql,conn,1,1
      if not rs.eof then
        newcategoryid	=replace(categoryid,delcategory&"."&rs(0)&".","")
      end if
      rs.close
    end if
  end if
  if newcategoryid><"." then categoryid=newcategoryid
  rs.open "update news set categoryid='"&categoryid&"' where id="&id,conn,1,3
end if

categoryid	=split(categoryid,".")

sql="select categoryid,categoryname,categoryindex from category where categorysort='news' order by categoryid ASC"
rs.open sql,conn,1,1
if not rs.eof then
  category=rs.getrows
end if
rs.close

Set rs=nothing
Set conn=nothing
%>
<!--#include file="../inc/head.asp"-->
<script>
one=new Array();
two=new Array();
<%
if isarray(category) then
  ii=0:jj=0
  for i=0 to ubound(category,2)
    cindex=split(category(2,i),".")
    if ubound(cindex)=1 then
response.write "one["&ii&"]=new Array("&category(0,i)&",'"&category(1,i)&"');"&vbcrlf
      for j=0 to ubound(category,2)
        if instr(category(2,j),category(2,i))>0 and category(2,j)><category(2,i) then
response.write "two["&jj&"]=new Array("&category(0,j)&",'"&category(1,j)&"',"&category(0,i)&");"&vbcrlf
        jj=jj+1
        end if
      next
response.write vbcrlf
      ii=ii+1
    end if
  next
end if
%>
</script>
<table border="0" align="center" width="380" cellpadding="2" cellspacing="1">
  <tr bgcolor="EFEFEF"><th colspan="2" width="80%">添加关联</th><th width="20%">删除关联</th></tr>
  <tr bgcolor="FFFFFF"><td style="color:ffffff">

栏目:<select name=onesort onchange="sort(this.options[this.selectedIndex].value);document.addform.addcategory.options[0] = new Option(this.options[this.selectedIndex].text,this.options[this.selectedIndex].value);"></select><br>
专题:<select name=twosort onchange="document.addform.addcategory.options[0] = new Option(this.options[this.selectedIndex].text,this.options[this.selectedIndex].value);"><option></select>

<script>
document.all.onesort.options[0]=new Option('请选择新闻栏目','');
for (var i=0;i<one.length;i++) {
  document.all.onesort.options[i+1] = new Option(one[i][1],one[i][0]);
}

function sort(id) {
  document.all.twosort.length=0; 
  document.all.twosort.options[0]=new Option('请选择栏目专题','');

  for (var i=0;i<two.length;i++) {
    if (two[i][2]==id) document.all.twosort.options[document.all.twosort.length] = new Option(two[i][1],two[i][0]);
  }  
}

function come(){
  var content="";
  if (document.addform.addcategory.length==0) content+="请选择添加类别!\n"
  if (content!=""){
    alert(content+'\n      Copyright by 2001-2002 ZWCITY.COM');
    return false;
  }
}
</script>

  </td><td nowrap style="color:FFFFFF">

<form method="POST" action="../news/mov.asp" name="addform" autocomplete="off" onsubmit="return(come());">
    <input type="hidden" name="id" value="<%=id%>">
=>  <select name="addcategory"></select>
<div align=right><input class=button type=submit name=add value=" 添 加 "></div>
</form>

  </td><td>

<form method="POST" action="../news/mov.asp" name="delform">
    <input type="hidden" name="id" value="<%=id%>">
    <select name="delcategory">
<%
  if isarray(categoryid) then
    for j=1 to ubound(categoryid,1)-1 step 2
response.write "<option value="""&categoryid(j)&""">"&categoryid(j+1)
    next
  end if
%>
    </select>
<div align=right><input class=button type=submit name=del value=" 去 除 "></div>
</form>

  </td></tr>
</table>

<!--#include file="../inc/foot.asp"-->

⌨️ 快捷键说明

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