DownBaok.asp
上传用户:dbstep
上传日期:2022-08-06
资源大小:2803k
文件大小:11k
源码类别:

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

开发平台:

ASP/ASPX

  1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
  2. <HTML xmlns="http://www.w3.org/1999/xhtml">
  3. <HEAD>
  4. <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8" />
  5. <META NAME="copyright" CONTENT="Copyright 2006-2009" />
  6. <META NAME="Author" CONTENT="迅易网站建设开发、www.sk.com" />
  7. <META NAME="Keywords" CONTENT="" />
  8. <META NAME="Description" CONTENT="" />
  9. <TITLE>编辑下载</TITLE>
  10. <link rel="stylesheet" href="Images/CssAdmin.css">
  11. <script language="javascript" src="../skweb/JS/Admin.js"></script>
  12. </HEAD>
  13. <!--#include file="../skweb/Const.asp" -->
  14. <!--#include file="../skweb/ConnSiteData.asp" -->
  15. <!--#include file="CheckAdmin.asp"-->
  16. <%
  17. if Instr(session("AdminPurview"),"|53,")=0 then 
  18.   response.write ("<font color='red')>你不具有该管理模块的操作权限,请返回!</font>")
  19.   response.end
  20. end if
  21. '========判断是否具有管理权限
  22. %>
  23. <BODY>
  24. <% 
  25. dim Result
  26. Result=request.QueryString("Result")
  27. dim ID,DownName,ViewFlag,SortName,SortID,SortPath
  28. dim FileSize,FileUrl,CommendFlag,GroupID,GroupIdName,Exclusive,Content
  29. ID=request.QueryString("ID")
  30. call DownEdit() 
  31. %>
  32. <table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#6298E1">
  33.   <tr>
  34.     <td height="24" nowrap><font color="#FFFFFF"><img src="Images/Explain.gif" width="18" height="18" border="0" align="absmiddle">&nbsp;<strong>下载检索及分类查看:添加,修改,删除下载信息</strong></font></td>
  35.   </tr>
  36.   <tr>
  37.     <td height="24" align="center" nowrap  bgcolor="#EBF2F9"><a href="DownEdit.asp?Result=Add" onClick='changeAdminFlag("添加产品信息")'>添加下载信息</a><font color="#0000FF">&nbsp;|&nbsp;</font><a href="DownList.asp" onClick='changeAdminFlag("产品列表")'>查看所有下载信息</a></td>
  38.   </tr>
  39. </table>
  40. <br>
  41. <table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#6298E1">
  42.   <form name="editForm" method="post" action="DownEdit.asp?Action=SaveEdit&Result=<%=Result%>&ID=<%=ID%>">
  43.   <tr>
  44.     <td height="24" nowrap bgcolor="#EBF2F9"><table width="100%" border="0" cellpadding="0" cellspacing="0" id=editDown idth="100%">
  45.       <tr>
  46.         <td width="120" height="20" align="right">&nbsp;</td>
  47.         <td>&nbsp;</td>
  48.       </tr>
  49.       <tr>
  50.         <td height="20" align="right">下载名称:</td>
  51.         <td><input name="DownName" type="text" class="textfield" id="DownName" style="WIDTH: 240;" value="<%=DownName%>" maxlength="100">&nbsp;发布:
  52.     <input name="ViewFlag" type="checkbox" style='HEIGHT: 13px;WIDTH: 13px;' value="1" <%if ViewFlag then response.write ("checked")%>>&nbsp;*&nbsp;不少于3个字符</td>
  53.       </tr>
  54.       <tr>
  55.         <td height="20" align="right">所属类别:</td>
  56.         <td><input name="SortName" type="text" class="textfield" id="SortName" value="<%=SortName%>" style="WIDTH: 240;background-color:#EBF2F9;" readonly>&nbsp;<a href="javaScript:OpenScript('SelectSort.asp?Result=Download',500,500,'')"><img src="Images/Select.gif" width="30" height="16" border="0" align="absmiddle"></a></td>
  57.       </tr>
  58.       <tr>
  59.         <td height="20" align="right">类别数字:</td>
  60.         <td><input name="SortID" type="text" class="textfield" id="SortID" style="WIDTH: 40;background-color:#EBF2F9;" value="<%=SortID%>" readonly><input name="SortPath" type="text" class="textfield" id="SortPath" style="WIDTH: 200;background-color:#EBF2F9;" value="<%=SortPath%>" readonly>&nbsp;*</td>
  61.       </tr>
  62.       <tr>
  63.         <td height="20" align="right">查看权限:</td>
  64.         <td><select name="GroupID" class="textfield">
  65.             <% call SelectGroup() %>
  66.           </select>
  67.             <input name="Exclusive" type="radio" value="&gt;="  <%if Exclusive="" or Exclusive=">=" then response.write ("checked")%>>
  68.           隶属
  69.           <input type="radio"  <%if Exclusive="=" then response.write ("checked")%> name="Exclusive" value="=">
  70.           专属(隶属:权限值≥可查看,专属:权限值=可查看)</td>
  71.       </tr>
  72.       <tr>
  73.         <td height="20" align="right">状  态:</td>
  74.         <td><input name="CommendFlag" type="checkbox" style="HEIGHT: 13px;WIDTH: 13px;" value="1" <%if CommendFlag then response.write ("checked")%>>
  75.           &nbsp;推荐</td>
  76.       </tr>
  77.       <tr>
  78.         <td height="20" align="right">下载地址:</td>
  79.         <td><input name="FileUrl" type="text" class="textfield" style="WIDTH: 240;" value="<%=FileUrl%>" maxlength="100">&nbsp;<a href="javaScript:OpenScript('UpFileForm.asp?Result=FileUrl',460,180)"><img src="Images/Upload.gif" width="30" height="16" border="0" align="absmiddle"></a></td>
  80.       </tr>
  81.       <tr>
  82.         <td height="20" align="right">文件大小:</td>
  83.         <td><input name="FileSize" type="text" class="textfield" id="FileSize" style="WIDTH: 240;" value="<%=FileSize%>" maxlength="100"></td>
  84.       </tr>
  85.       <tr> 
  86.       <td height="20" align="right" valign="top">下载地址:</td>
  87.       <td><input name="urltitle1" value="下载地址1" type="text" class="textfield" size="8">
  88.       :<input type="text" name="url1"  class="textfield" size="40"> &nbsp;<a href="javascript:" onClick="window.open('myup.asp?cat=down&uptype=file&urlname=url1&sizename=downsize&upmode=openwindow','','scrollbars=no,top=300,left=400,width=355,height=50,status=yes')">[上传下载]</a>&nbsp;&nbsp;上传数:<input name="upNum" id="upNum" type="text" class="textfield"  value="1" size="4"> <input type="button" onClick="addDownUrl()" style="cursor:hand;" value="设置">
  89. <div id="dowurlrs"></div>
  90.   </td>
  91.     </tr>
  92.   <tr> 
  93.     <td height="20" align="right" >下载大小:</td>
  94.     <td > <input name="downsize" type="text" class="textfield" id="downsize"> <a href="javascript:" onClick="downsize.value+='KB';">KB</a>|<a href="javascript:" onClick="downsize.value+='MB';">MB</a></td>
  95.   </tr>
  96.       <tr>
  97.         <td height="20" align="right" valign="top">信息内容:<br>
  98.         <td><%
  99. Dim oFCKeditor
  100. Set oFCKeditor = New FCKeditor
  101. oFCKeditor.BasePath = "../fckeditor/" 
  102. oFCKeditor.ToolbarSet = "Default" 
  103. oFCKeditor.Width = "550" 
  104. oFCKeditor.Height = "400" 
  105. oFCKeditor.Value = content
  106. oFCKeditor.Create "Content" 
  107. %></td>
  108.       </tr>
  109.       <tr>
  110.         <td height="30" align="right">&nbsp;</td>
  111.         <td valign="bottom"><input name="submitSaveEdit" type="submit" class="button"  id="submitSaveEdit" value="保存" style="WIDTH: 80;" ></td>
  112.       </tr>
  113.       <tr>
  114.         <td height="20" align="right">&nbsp;</td>
  115.         <td valign="bottom">&nbsp;</td>
  116.       </tr>
  117.     </table></td>
  118.   </tr>
  119.   </form>
  120.     <script language="JavaScript">
  121.   function addDownUrl(){
  122.    var dnum,urlstr;
  123. urlstr="";
  124. dnum=Number(document.all.editForm.upNum.value);
  125. for(var i=2;i<=dnum;i++){
  126. urlstr+="<input type=text class="textfield" value='下载地址"+String(i)+"' size=8 name=urltitle"+String(i)+"> :<input type=text class="textfield" name=url"+String(i)+" size=40> &nbsp;<a href="javascript:" onclick="window.open('myup.asp?cat=down&uptype=file&urlname=url"+String(i)+"&sizename=downsize&upmode=openwindow','','scrollbars=no,top=300,left=400,width=355,height=50px')">[上传下载]</a><br>";
  127. }
  128. dowurlrs.innerHTML=urlstr;
  129.   }
  130.   </script>
  131. </table>
  132. </BODY>
  133. </HTML>
  134. <%
  135. sub DownEdit()
  136.   dim Action,rsRepeat,rs,sql
  137.   Action=request.QueryString("Action")
  138.   if Action="SaveEdit" then '保存编辑下载信息
  139.     set rs = server.createobject("adodb.recordset")
  140.     if len(trim(request.Form("DownName")))<3 then
  141.       response.write ("<script language=javascript> alert('下载名称为必填项目!');history.back(-1);</script>")
  142.       response.end
  143.     end if
  144.     if Result="Add" then '创建下载信息
  145.   sql="select * from sk_Download"
  146.       rs.open sql,conn,1,3
  147.       rs.addnew
  148.       rs("DownName")=trim(Request.Form("DownName"))
  149.   if Request.Form("ViewFlag")=1 then
  150.         rs("ViewFlag")=Request.Form("ViewFlag")
  151.   else
  152.         rs("ViewFlag")=0
  153.   end if
  154.   if Request.Form("SortID")="" and Request.Form("SortPath")="" then
  155.         response.write ("<script language=javascript> alert('请选择所属分类!');history.back(-1);</script>")
  156.         response.end
  157.   else
  158.     rs("SortID")=Request.Form("SortID")
  159. rs("SortPath")=Request.Form("SortPath")
  160.   end if
  161.   if Request.Form("CommendFlag")=1 then
  162.         rs("CommendFlag")=Request.Form("CommendFlag")
  163.   else
  164.         rs("CommendFlag")=0
  165.   end if
  166.       GroupIdName=split(Request.Form("GroupID"),"┎╂┚")
  167.   rs("GroupID")=GroupIdName(0)
  168.   rs("Exclusive")=trim(Request.Form("Exclusive"))
  169.   rs("FileSize")=trim(Request.Form("FileSize"))
  170.   rs("down_size")=Request.form("downsize")
  171.   rs("Content")=Request.Form("Content")
  172.   rs("AddTime")=now()
  173. end if  
  174. if Result="Modify" then '修改下载信息
  175.       sql="select * from sk_Download where ID="&ID
  176.       rs.open sql,conn,1,3
  177.       rs("DownName")=trim(Request.Form("DownName"))
  178.   if Request.Form("ViewFlag")=1 then
  179.         rs("ViewFlag")=Request.Form("ViewFlag")
  180.   else
  181.         rs("ViewFlag")=0
  182.   end if
  183.   if Request.Form("SortID")<>"" and Request.Form("SortPath")<>"" then
  184.     rs("SortID")=Request.Form("SortID")
  185. rs("SortPath")=Request.Form("SortPath")
  186.   else
  187.         response.write ("<script language=javascript> alert('请选择所属分类!');history.back(-1);</script>")
  188.         response.end
  189.   end if
  190.   if Request.Form("CommendFlag")=1 then
  191.         rs("CommendFlag")=Request.Form("CommendFlag")
  192.   else
  193.         rs("CommendFlag")=0
  194.   end if
  195.       GroupIdName=split(Request.Form("GroupID"),"┎╂┚")
  196.   rs("GroupID")=GroupIdName(0)
  197.   rs("Exclusive")=trim(Request.Form("Exclusive"))
  198.   rs("FileSize")=trim(Request.Form("FileSize"))
  199.   rs("FileUrl")=trim(Request.Form("FileUrl"))
  200.   rs("Content")=Request.Form("Content")
  201. end if
  202. rs.update
  203. rs.close
  204.     set rs=nothing 
  205.     response.write "<script language=javascript> alert('成功编辑下载信息!');changeAdminFlag('下载列表');location.replace('DownList.asp');</script>"
  206.   else '提取产品信息
  207. if Result="Modify" then
  208.       set rs = server.createobject("adodb.recordset")
  209.       sql="select * from sk_Download where ID="& ID
  210.       rs.open sql,conn,1,1
  211.       if rs.bof and rs.eof then
  212.         response.write ("数据库读取记录出错!")
  213.         response.end
  214.       end if
  215.   DownName=rs("DownName")
  216.   ViewFlag=rs("ViewFlag")
  217.   SortName=SortText(rs("SortID"))
  218.   SortID=rs("SortID")
  219.   SortPath=rs("SortPath")
  220.   CommendFlag=rs("CommendFlag")
  221.   GroupID=rs("GroupID")
  222.   Exclusive=rs("Exclusive")
  223.   FileSize=rs("FileSize")
  224.   FileUrl=rs("FileUrl")
  225.       Content=rs("Content")
  226.   rs.close
  227.       set rs=nothing 
  228.     end if
  229.   end if
  230. end sub
  231. %>
  232. <% 
  233. sub SelectGroup()
  234.   dim rs,sql
  235.   set rs = server.createobject("adodb.recordset")
  236.   sql="select GroupID,GroupName from sk_MemGroup"
  237.   rs.open sql,conn,1,1
  238.   if rs.bof and rs.eof then
  239.     response.write("未设组别")
  240.   end if
  241.   while not rs.eof
  242.     response.write("<option value='"&rs("GroupID")&"┎╂┚"&rs("GroupName")&"'")
  243.     if GroupID=rs("GroupID") then response.write ("selected")
  244.     response.write(">"&rs("GroupName")&"</option>")
  245.     rs.movenext
  246.   wend
  247.   rs.close
  248.   set rs=nothing
  249. end sub
  250. %>
  251. <%
  252. '生成所属类别--------------------------
  253. Function SortText(ID)
  254.   Dim rs,sql
  255.   Set rs=server.CreateObject("adodb.recordset")
  256.   sql="Select * From sk_DownSort where ID="&ID
  257.   rs.open sql,conn,1,1
  258.   SortText=rs("SortName")
  259.   rs.close
  260.   set rs=nothing
  261. End Function
  262. %>