DownEdit.asp
资源名称:1.rar [点击查看]
上传用户:yrf020
上传日期:2007-07-24
资源大小:1287k
文件大小:7k
源码类别:

WEB源码(ASP,PHP,...)

开发平台:

HTML/CSS

  1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
  2. <% Option Explicit %>
  3. <HTML xmlns="http://www.w3.org/1999/xhtml">
  4. <HEAD>
  5. <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8" />
  6. <META NAME="copyright" CONTENT="Copyright 2006-2008 - Hokilly.com-STUDIO" />
  7. <META NAME="Author" CONTENT="红金羚软件,www.hokilly.com" />
  8. <META NAME="Keywords" CONTENT="" />
  9. <META NAME="Description" CONTENT="" />
  10. <TITLE>编辑下载</TITLE>
  11. <link rel="stylesheet" href="Images/CssAdmin.css">
  12. <script language="javascript" src="../Script/Admin.js"></script>
  13. <style type="text/css">
  14. <!--
  15. .STYLE1 { font-size: medium;
  16. font-weight: bold;
  17. color: #ff0000;
  18. }
  19. -->
  20. </style>
  21. </HEAD>
  22. <!--#include file="../Include/Const.asp" -->
  23. <!--#include file="../Include/ConnSiteData.asp" -->
  24. <!--#include file="CheckAdmin.asp"-->
  25. <%
  26. Dim SERVER_NAME
  27. SERVER_NAME=trim(Request.ServerVariables("SERVER_NAME"))
  28. 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
  29. if Instr(session("AdminPurview"),"|53,")=0 then 
  30.   response.write ("<font color='red')>你不具有该管理模块的操作权限,请返回!</font>")
  31.   response.end
  32. end if
  33. '========判断是否具有管理权限
  34. %>
  35. <BODY>
  36. <p>&nbsp;</p>
  37. <p class="STYLE1">免费版不提供此功能!请联系Tel:13915064582
  38.   或者QQ:15916190 购买商业正式版!</p>
  39. <p>详情请见:<a href="http://www.hokilly.com" target="_blank">http://www.hokilly.com</a></p>
  40. <p>常州红金羚软件技术有限公司 </p>
  41. <p>&nbsp;</p>
  42. </body>
  43. </html> 
  44. <%
  45. else
  46. 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)&">"
  47. response.end%>
  48. <%end if%>
  49. <%
  50. sub DownEdit()
  51.   dim Action,rsRepeat,rs,sql
  52.   Action=request.QueryString("Action")
  53.   if Action="SaveEdit" then '保存编辑下载信息
  54.     set rs = server.createobject("adodb.recordset")
  55.     if len(trim(request.Form("DownNameCh")))<1 then
  56.       response.write ("<script language=javascript> alert('名称为必填项目!');history.back(-1);</script>")
  57.       response.end
  58.     end if
  59.     if Result="Add" then '创建下载信息
  60.   sql="select * from CompanyCMS_Download"
  61.       rs.open sql,conn,1,3
  62.       rs.addnew
  63.       rs("DownNameCh")=trim(Request.Form("DownNameCh"))
  64.   if Request.Form("ViewFlagCh")=1 then
  65.         rs("ViewFlagCh")=Request.Form("ViewFlagCh")
  66.   else
  67.         rs("ViewFlagCh")=0
  68.   end if
  69.    if Request.Form("SortID")="" and Request.Form("SortPath")="" then
  70.         response.write ("<script language=javascript> alert('请选择所属分类!');history.back(-1);</script>")
  71.         response.end
  72.   else
  73.     rs("SortID")=Request.Form("SortID")
  74. rs("SortPath")=Request.Form("SortPath")
  75.   end if
  76.   if Request.Form("CommendFlag")=1 then
  77.         rs("CommendFlag")=Request.Form("CommendFlag")
  78.   else
  79.         rs("CommendFlag")=0
  80.   end if
  81.       GroupIdName=split(Request.Form("GroupID"),"┎╂┚")
  82.   rs("GroupID")=GroupIdName(0)
  83.   rs("Exclusive")=trim(Request.Form("Exclusive"))
  84.   rs("FileSize")=trim(Request.Form("FileSize"))
  85.   rs("FileUrl")=trim(Request.Form("FileUrl"))
  86.   rs("ContentCh")=Request.Form("ContentCh")
  87.   rs("UploadFiles")=trim(Request.Form("UploadFiles"))
  88.   rs("AddTime")=now()
  89.   rs("UpdateTime")=now()
  90. end if  
  91. if Result="Modify" then '修改下载信息
  92.       sql="select * from CompanyCMS_Download where ID="&ID
  93.       rs.open sql,conn,1,3
  94.       rs("DownNameCh")=trim(Request.Form("DownNameCh"))
  95.   if Request.Form("ViewFlagCh")=1 then
  96.         rs("ViewFlagCh")=Request.Form("ViewFlagCh")
  97.   else
  98.         rs("ViewFlagCh")=0
  99.   end if
  100.   if Request.Form("SortID")<>"" and Request.Form("SortPath")<>"" then
  101.     rs("SortID")=Request.Form("SortID")
  102. rs("SortPath")=Request.Form("SortPath")
  103.   else
  104.         response.write ("<script language=javascript> alert('请选择所属分类!');history.back(-1);</script>")
  105.         response.end
  106.   end if
  107.   if Request.Form("CommendFlag")=1 then
  108.         rs("CommendFlag")=Request.Form("CommendFlag")
  109.   else
  110.         rs("CommendFlag")=0
  111.   end if
  112.       GroupIdName=split(Request.Form("GroupID"),"┎╂┚")
  113.   rs("GroupID")=GroupIdName(0)
  114.   rs("Exclusive")=trim(Request.Form("Exclusive"))
  115.   rs("FileSize")=trim(Request.Form("FileSize"))
  116.   rs("FileUrl")=trim(Request.Form("FileUrl"))
  117.   rs("ContentCh")=Request.Form("ContentCh")
  118.   rs("UploadFiles")=trim(Request.Form("UploadFiles"))
  119.   rs("UpdateTime")=now()
  120. end if
  121. rs.update
  122. rs.close
  123.     set rs=nothing 
  124.     response.write "<script language=javascript> alert('成功编辑下载信息!');changeAdminFlag('下载列表');location.replace('DownList.asp');</script>"
  125.   else '提取产品信息
  126. if Result="Modify" then
  127.       set rs = server.createobject("adodb.recordset")
  128.       sql="select * from CompanyCMS_Download where ID="& ID
  129.       rs.open sql,conn,1,1
  130.       if rs.bof and rs.eof then
  131.         response.write ("数据库读取记录出错!")
  132.         response.end
  133.       end if
  134.   DownNameCh=rs("DownNameCh")
  135.   ViewFlagCh=rs("ViewFlagCh")
  136.   SortNameCh=SortText(rs("SortID"))
  137.   SortID=rs("SortID")
  138.   SortPath=rs("SortPath")
  139.   CommendFlag=rs("CommendFlag")
  140.   GroupID=rs("GroupID")
  141.   Exclusive=rs("Exclusive")
  142.   FileSize=rs("FileSize")
  143.   FileUrl=rs("FileUrl")
  144.       ContentCh=rs("ContentCh")
  145.   UploadFiles=rs("UploadFiles")
  146.   rs.close
  147.       set rs=nothing 
  148.     end if
  149.   end if
  150. end sub
  151. %>
  152. <% 
  153. sub SelectGroup()
  154.   dim rs,sql
  155.   set rs = server.createobject("adodb.recordset")
  156.   sql="select GroupID,GroupNameCh from CompanyCMS_MemGroup"
  157.   rs.open sql,conn,1,1
  158.   if rs.bof and rs.eof then
  159.     response.write("未设组别")
  160.   end if
  161.   while not rs.eof
  162.     response.write("<option value='"&rs("GroupID")&"┎╂┚"&rs("GroupNameCh")&"'")
  163.     if GroupID=rs("GroupID") then response.write ("selected")
  164.     response.write(">"&rs("GroupNameCh")&"</option>")
  165.     rs.movenext
  166.   wend
  167.   rs.close
  168.   set rs=nothing
  169. end sub
  170. %>
  171. <%
  172. '生成所属类别--------------------------
  173. Function SortText(ID)
  174.   Dim rs,sql
  175.   Set rs=server.CreateObject("adodb.recordset")
  176.   sql="Select * From CompanyCMS_DownSort where ID="&ID
  177.   rs.open sql,conn,1,1
  178.   SortText=rs("SortNameCh")
  179.   rs.close
  180.   set rs=nothing
  181. End Function
  182. %>