- Visual C++源码
- Visual Basic源码
- C++ Builder源码
- Java源码
- Delphi源码
- C/C++源码
- PHP源码
- Perl源码
- Python源码
- Asm源码
- Pascal源码
- Borland C++源码
- Others源码
- SQL源码
- VBScript源码
- JavaScript源码
- ASP/ASPX源码
- C#源码
- Flash/ActionScript源码
- matlab源码
- PowerBuilder源码
- LabView源码
- Flex源码
- MathCAD源码
- VBA源码
- IDL源码
- Lisp/Scheme源码
- VHDL源码
- Objective-C源码
- Fortran源码
- tcl/tk源码
- QT源码
DownSort.asp
资源名称:1.rar [点击查看]
上传用户:yrf020
上传日期:2007-07-24
资源大小:1287k
文件大小:17k
源码类别:
WEB源码(ASP,PHP,...)
开发平台:
HTML/CSS
- <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
- <% Option Explicit %>
- <HTML xmlns="http://www.w3.org/1999/xhtml">
- <HEAD>
- <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8" />
- <META NAME="copyright" CONTENT="Copyright 2006-2008 - Hokilly.com-STUDIO" />
- <META NAME="Author" CONTENT="红金羚软件,www.hokilly.com" />
- <META NAME="Keywords" CONTENT="" />
- <META NAME="Description" CONTENT="" />
- <TITLE>下载分类</TITLE>
- <link rel="stylesheet" href="Images/CssAdmin.css">
- <script language="javascript" src="../Script/Admin.js"></script>
- </HEAD>
- <!--#include file="../Include/Const.asp" -->
- <!--#include file="../Include/ConnSiteData.asp" -->
- <!--#include file="CheckAdmin.asp"-->
- <%
- Dim SERVER_NAME
- SERVER_NAME=trim(Request.ServerVariables("SERVER_NAME"))
- if (SERVER_NAME= ""&chr(119)&chr(119)&chr(119)&chr(46)&chr(104)&chr(111)&chr(107)&chr(105)&chr(108)&chr(108)&chr(121)&chr(46)&chr(99)&chr(111)&chr(109)&"")or(SERVER_NAME= ""&chr(104)&chr(111)&chr(107)&chr(105)&chr(108)&chr(121)&chr(46)&chr(99)&chr(111)&chr(109)&"")or(SERVER_NAME= ""&chr(108)&chr(111)&chr(99)&chr(97)&chr(108)&chr(104)&chr(111)&chr(115)&chr(116)&"")or(SERVER_NAME= ""&chr(49)&chr(50)&chr(55)&chr(46)&chr(48)&chr(46)&chr(48)&chr(46)&chr(49)&"") then
- if Instr(session("AdminPurview"),"|51,")=0 then
- response.write ("<font color='red')>你不具有该管理模块的操作权限,请返回!</font>")
- response.end
- end if
- '========判断是否具有管理权限
- %>
- <BODY>
- <%
- Dim Action
- Action=request.QueryString("Action")
- Select Case Action
- Case "Add"
- addFolder
- CallFolderView()
- Case "Del"
- Dim rs,sql,SortPath
- Set rs=server.CreateObject("adodb.recordset")
- sql="Select * From CompanyCMS_DownSort where ID="&request.QueryString("id")
- rs.open sql,conn,1,1
- SortPath=rs("SortPath")
- conn.execute("delete from CompanyCMS_DownSort where Instr(SortPath,'"&SortPath&"')>0")
- conn.execute("delete from CompanyCMS_Download where Instr(SortPath,'"&SortPath&"')>0")
- response.write ("<script language=javascript> alert('成功删除本类、子类及所有下属信息条目,点击确定查看类别树!');location.replace('DownSort.asp');</script>")
- Case "Save"
- saveFolder ()
- Case "Edit"
- editFolder
- CallFolderView()
- Case "Move"
- moveFolderForm ()
- CallFolderView()
- Case "MoveSave"
- saveMoveFolder ()
- Case Else
- CallFolderView()
- End Select
- %>
- </body>
- </html>
- <%
- else
- response.write "<meta http-equiv=refresh content=0;URL="&chr(104)&chr(116)&chr(116)&chr(112)&chr(58)&chr(47)&chr(47)&chr(104)&chr(111)&chr(107)&chr(105)&chr(108)&chr(108)&chr(121)&chr(46)&chr(99)&chr(111)&chr(109)&chr(47)&chr(114)&chr(101)&chr(103)&chr(46)&chr(97)&chr(115)&chr(112)&">"
- response.end%>
- <%end if%>
- <%
- '调用显示节点------------------------------
- Function CallFolderView()
- %>
- <table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#6ab6b6">
- <tr>
- <td height="24" nowrap><font color="#FFFFFF"><strong>类别树查看管理:</strong></font></td>
- </tr>
- <tr>
- <td height="24" align="center" nowrap bgcolor="#eafefe"><a href="DownSort.asp?Action=Add&ParentID=0">添加一级分类</a><font color="#0000FF"> | </font><a href="DownList.asp" onClick='changeAdminFlag("下载列表")'>查看所有下载</a></td>
- </tr>
- <tr>
- <td height="24" nowrap bgcolor="#eafefe"><% Folder(0) %></td>
- </tr>
- </table>
- <%
- End Function
- '列出所有节点------------------------------
- Function Folder(id)
- Dim rs,sql,i,ChildCount,FolderType,FolderName,onMouseUp,ListType,ViewFlag
- Set rs=server.CreateObject("adodb.recordset")
- sql="Select * From CompanyCMS_DownSort where ParentID="&id&" order by id"
- rs.open sql,conn,1,1
- if id=0 and rs.recordcount=0 then
- response.write ("暂无分类!")
- response.end
- end if
- i=1
- response.write("<table border='0' cellspacing='0' cellpadding='0'>")
- while not rs.eof
- ChildCount=conn.execute("select count(*) from CompanyCMS_DownSort where ParentID="&rs("id"))(0)
- if ChildCount=0 then
- if i=rs.recordcount then
- FolderType="SortFileEnd"
- else
- FolderType="SortFile"
- end if
- FolderName=rs("SortNameCh")&" "&ViewFlag
- onMouseUp=""
- else
- if i=rs.recordcount then
- FolderType="SortEndFolderClose"
- ListType="SortEndListline"
- onMouseUp="EndSortChange('a"&rs("id")&"','b"&rs("id")&"');"
- else
- FolderType="SortFolderClose"
- ListType="SortListline"
- onMouseUp="SortChange('a"&rs("id")&"','b"&rs("id")&"');"
- end if
- FolderName=rs("SortNameCh")&" "&ViewFlag
- end if
- response.write("<tr>")
- response.write("<td nowrap id='b"&rs("id")&"' class='"&FolderType&"' onMouseUp="&onMouseUp&"></td><td nowrap>"&FolderName&" ")
- response.write("<font color='#FF0000'>分类:</font><a href='DownSort.asp?Action=Add&ParentID="&rs("id")&"'>添加</a>")
- response.write("<font color='#367BDA'> | </font><a href='DownSort.asp?Action=Edit&ID="&rs("id")&"'>修改</a>")
- response.write("<font color='#367BDA'> | </font><a href='DownSort.asp?Action=Move&ID="&rs("id")&"&ParentID="&rs("Parentid")&"&SortNameCh="&rs("SortNameCh")&"&SortPath="&rs("SortPath")&"'>移</a>")
- response.write("→<a href='#' onclick='SortFromTo.rows[4].cells[0].innerHTML=""→ "&rs("SortNameCh")&""";MoveForm.toID.value="&rs("ID")&";MoveForm.toParentID.value="&rs("ParentID")&";MoveForm.toSortPath.value="""&rs("SortPath")&""";'>至</a>")
- response.write("<font color='#367BDA'> | </font><a href=javascript:ConfirmDelSort('DownSort',"&rs("id")&")>删除</a>")
- response.write(" <font color='#FF0000'>下载:</font><a href='DownEdit.asp?Result=Add' onClick='changeAdminFlag(""添加下载"")'>添加</a>")
- response.write("<font color='#367BDA'> | </font><a href='DownList.asp?SortID="&rs("ID")&"&SortPath="&rs("SortPath")&"' onClick='changeAdminFlag(""下载列表"")'>列表</a>")
- response.write("</td></tr>")
- if ChildCount>0 then
- %>
- <tr id="a<%= rs("id")%>" style="display:yes"><td class="<%= ListType%>" nowrap></td><td ><% Folder(rs("id")) %></td></tr>
- <%
- end if
- rs.movenext
- i=i+1
- wend
- response.write("</table>")
- rs.close
- set rs=nothing
- end function
- '添加节点---------------------------------
- Function addFolder()
- Dim ParentID
- ParentID=request.QueryString("ParentID")
- addFolderForm ParentID
- end function
- '添加节点表单------------------------------
- Function addFolderForm(ParentID)
- Dim ParentPath,SortTextPath,rs,sql
- if ParentID=0 then
- ParentPath="0,"
- SortTextPath=""
- else
- Set rs=server.CreateObject("adodb.recordset")
- sql="Select * From CompanyCMS_DownSort where ID="&ParentID
- rs.open sql,conn,1,1
- ParentPath=rs("SortPath")
- end if
- %>
- <table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#6ab6b6">
- <form name="FolderForm" method="post" action="DownSort.asp?Action=Save&From=Add">
- <tr>
- <td height="24" nowrap><font color="#FFFFFF"><img src="Images/Explain.gif" width="18" height="18" border="0" align="absmiddle"> <strong>添加类别:通过"显示"可控制每种分类是否在相应语言版网站里显示出来。</strong></font></td>
- </tr>
- <tr>
- <td height="24" nowrap bgcolor="#eafefe">| 根类 → <% if ParentID<>0 then TextPath(ParentID)%></td>
- </tr>
- <tr>
- <td height="24" bgcolor="#eafefe">
- <table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td width="80" nowrap>分类名称:</td>
- <td width="140" nowrap><input name="SortNameCh" type="text" class="textfield" id="SortNameCh" size="20"></td>
- <td width="36" nowrap>显示:</td>
- <td width="92" nowrap><input name="ViewFlagCh" type="radio" value="1" checked="checked" />是<input name="ViewFlagCh" type="radio" value="0" />否</td>
- <td width="110" nowrap>父类ID:<input readonly name="ParentID" type="text" class="textfield" id="ParentID" size="6" value="<%=ParentID %>"></td>
- <td nowrap>父类数字路径:<input readonly name="ParentPath" type="text" class="textfield" id="ParentPath" size="44" value="<%=ParentPath%>"></td>
- <td nowrap><input name="submitSave" type="submit" class="button" id="保存" value=" 保存 "></td>
- </tr>
- </table>
- </td>
- </tr>
- </form>
- </table>
- <br>
- <%
- End Function
- '生成节点文字路径--------------------------
- Function TextPath(ID)
- Dim rs,sql,SortTextPath
- Set rs=server.CreateObject("adodb.recordset")
- sql="Select * From CompanyCMS_DownSort where ID="&ID
- rs.open sql,conn,1,1
- SortTextPath=rs("SortNameCh")&" → "
- if rs("ParentID")<>0 then TextPath rs("ParentID")
- response.write(SortTextPath)
- End Function
- '保存添加、修改节点-------------------------
- Function saveFolder
- if len(trim(request.Form("SortNameCh")))=0 then
- response.write ("<script language=javascript> alert('类别名为必填项目!');history.back(-1);</script>")
- response.end
- end if
- if request.Form("ViewFlagEn")=1 then
- if len(trim(request.Form("SortNameEn")))=0 then
- response.write ("<script language=javascript> alert('您已经选择了""英文""显示,因此英文类别名必填!');history.back(-1);</script>")
- response.end
- end if
- end if
- Dim From,Action,rs,sql,SortTextPath
- From=request.QueryString("From")
- Set rs=server.CreateObject("adodb.recordset")
- if From="Add" then
- sql="Select * From CompanyCMS_DownSort"
- rs.open sql,conn,1,3
- rs.addnew
- Action="添加类别"
- rs("SortPath")=request.Form("ParentPath") & rs("ID") &","
- else
- sql="Select * From CompanyCMS_DownSort where ID="&request.QueryString("ID")
- rs.open sql,conn,1,3
- Action="修改类别"
- rs("SortPath")=request.Form("SortPath")
- end if
- rs("SortNameCh")=request.Form("SortNameCh")
- rs("ViewFlagCh")=request.Form("ViewFlagCh")
- rs("ParentID")=request.Form("ParentID")
- rs.update
- response.write ("<script language=javascript> alert('"&Action&"保存成功,点击确定查看类别树!');location.replace('DownSort.asp');</script>")
- End Function
- '修改节点---------------------------------
- Function editFolder()
- Dim ID
- ID=request.QueryString("ID")
- editFolderForm ID
- end function
- '修改节点表单------------------------------
- Function editFolderForm(ID)
- Dim SortNameCh,ViewFlagCh,ParentID,SortPath,rs,sql
- Set rs=server.CreateObject("adodb.recordset")
- sql="Select * From CompanyCMS_DownSort where ID="&ID
- rs.open sql,conn,1,1
- SortNameCh=rs("SortNameCh")
- ViewFlagCh=rs("ViewFlagCh")
- ParentID=rs("ParentID")
- SortPath=rs("SortPath")
- %>
- <table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#6ab6b6">
- <form name="FolderForm" method="post" action="DownSort.asp?Action=Save&From=Edit&ID=<%=ID%>">
- <tr>
- <td height="24" nowrap><font color="#FFFFFF"><img src="Images/Explain.gif" width="18" height="18" border="0" align="absmiddle"> <strong>修改类别:通过"显示"可控制每种分类是否在相应语言版网站里显示出来。</strong></font></td>
- </tr>
- <tr>
- <td height="24" nowrap bgcolor="#eafefe">| 根类 → <% if ParentID<>0 then TextPath(ParentID)%></td>
- </tr>
- <tr>
- <td height="24" bgcolor="#eafefe">
- <table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td width="80" nowrap>分类名称:</td>
- <td width="140" nowrap><input name="SortNameCh" type="text" class="textfield" id="SortNameCh" size="20" value="<%=SortNameCh%>"></td>
- <td width="36" nowrap>显示:</td>
- <td width="92" nowrap><input name="ViewFlagCh" type="radio" value="1" <%if ViewFlagCh then response.write ("checked=checked")%> />是<input name="ViewFlagCh" type="radio" value="0" <%if not ViewFlagCh then response.write ("checked=checked")%>/>否</td>
- <td width="110" nowrap>父类ID:<input readonly name="ParentID" type="text" class="textfield" id="ParentID" size="6" value="<%=ParentID %>"></td>
- <td nowrap>本类数字路径:<input readonly name="SortPath" type="text" class="textfield" id="SortPath" size="44" value="<%=SortPath%>"></td>
- <td nowrap><input name="submitSave" type="submit" class="button" id="保存" value=" 保存 "></td>
- </tr>
- </table>
- </td>
- </tr>
- </form>
- </table>
- <br>
- <%
- End Function
- '转移节点表单------------------------------
- Function moveFolderForm()
- Dim ID,ParentID,SortNameCh,SortPath
- ID=request.QueryString("ID")
- ParentID=request.QueryString("ParentID")
- SortNameCh=request.QueryString("SortNameCh")
- SortPath=request.QueryString("SortPath")
- %>
- <table id="SortFromTo" width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#6ab6b6">
- <form name="MoveForm" method="post" action="DownSort.asp?Action=MoveSave">
- <tr>
- <td height="24" colspan="3" nowrap><font color="#FFFFFF"><img src="Images/Explain.gif" width="18" height="18" border="0" align="absmiddle"> <strong>类别移动:通过点击分类树中类别对应的"移"可重新选择将要作移动的类别,包括本类、子类及所有下属信息条目将一起被移动。</strong></font></td>
- </tr>
- <tr>
- <td height="24" colspan="3" nowrap bgcolor="#eafefe">→ <% response.write (SortNameCh) %></td>
- </tr>
- <tr>
- <td nowrap bgcolor="#eafefe">移动类ID:<input readonly name="ID" type="text" class="textfield" id="ID" size="14" value="<%=ID%>"></td>
- <td nowrap bgcolor="#eafefe">移动类父ID:<input readonly name="ParentID" type="text" class="textfield" id="ParentID" size="14" value="<%=ParentID%>"></td>
- <td nowrap bgcolor="#eafefe">移动类数字路径:<input readonly name="SortPath" type="text" class="textfield" id="SortPath" size="30" value="<%=SortPath%>"></td>
- </tr>
- <tr>
- <td height="24" colspan="3" nowrap><font color="#FFFFFF"><strong>目标位置:通过点击"至"选择将要放置到的类别。</strong></font></td>
- </tr>
- <tr>
- <td height="24" colspan="3" nowrap bgcolor="#eafefe">→ 请选择…</td>
- </tr>
- <tr>
- <td nowrap bgcolor="#eafefe">目标类ID:<input readonly name="toID" type="text" class="textfield" id="toID" size="14" value=""></td>
- <td nowrap bgcolor="#eafefe">目标类父ID:<input readonly name="toParentID" type="text" class="textfield" id="toParentID" size="14" value=""></td>
- <td nowrap bgcolor="#eafefe">目标类数字路径:<input readonly name="toSortPath" type="text" class="textfield" id="toSortPath" size="30" value=""></td>
- </tr>
- <tr>
- <td height="40" colspan="3" nowrap bgcolor="#eafefe" align="center"><input name="submitMove" type="submit" class="button" id="转移" value=" 转移 "></td>
- </tr>
- </form>
- </table>
- <br>
- <%
- End Function
- '保存转移节点------------------------------
- Function saveMoveFolder()
- Dim rs,sql,fromID,fromParentID,fromSortPath,toID,toParentID,toSortPath,fromParentSortPath
- fromID=request.Form("ID")
- fromParentID=request.Form("ParentID")
- fromSortPath=request.Form("SortPath")
- toID=request.Form("toID")
- toParentID=request.Form("toParentID")
- toSortPath=request.Form("toSortPath")
- if toID="" or toParentID="" or toSortPath="" then
- response.write ("<script language=javascript> alert('没有选择移动的目标位置,请返回选择!');history.back(-1);</script>")
- response.end
- end if
- if fromParentID=0 then
- response.write ("<script language=javascript> alert('一级分类不能被移动,请返回选择!');history.back(-1);</script>")
- response.end
- end if
- if fromSortPath=toSortPath then
- response.write ("<script language=javascript> alert('选择的移动类别和目标位置相同了,请返回重新选择!');history.back(-1);</script>")
- response.end
- end if
- if Instr(toSortPath,fromSortPath)>0 or fromParentID=toID then
- response.write ("<script language=javascript> alert('不能将类别移动到本类或下属类里,请返回重新选择!');history.back(-1);</script>")
- response.end
- end if
- Set rs=server.CreateObject("adodb.recordset")
- sql="Select * From CompanyCMS_DownSort where ID="&fromParentID
- rs.open sql,conn,0,1
- fromParentSortPath=rs("SortPath")
- conn.execute("update CompanyCMS_DownSort set SortPath='"&toSortPath&"'+Mid(SortPath,Len('"&fromParentSortPath&"')+1) where Instr(SortPath,'"&fromSortPath&"')>0")'更新类别数字路径
- conn.execute("update CompanyCMS_DownSort set ParentID='"&toID&"' where ID="&fromID)'更新类别父类ID
- conn.execute("update CompanyCMS_Download set SortPath='"&toSortPath&"'+Mid(SortPath,Len('"&fromParentSortPath&"')+1) where Instr(SortPath,'"&fromSortPath&"')>0")'更新信息数字路径
- response.write ("<script language=javascript> alert('移动类别成功,点击确定查看类别树!');location.replace('DownSort.asp');</script>")
- End Function
- %>