DownloadList_Ajax.asp
上传用户:jisenq
上传日期:2014-06-29
资源大小:7216k
文件大小:5k
源码类别:

数据库编程

开发平台:

ASP/ASPX

  1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
  2. <% Option Explicit %>
  3. <!--#include file="../../FS_Inc/Const.asp" -->
  4. <!--#include file="../../FS_InterFace/MF_Function.asp" -->
  5. <!--#include file="../../FS_InterFace/HS_Function.asp" -->
  6. <!--#include file="../../FS_Inc/Function.asp" -->
  7. <%
  8. Response.Buffer = True
  9. Response.Expires = -1
  10. Response.ExpiresAbsolute = Now() - 1
  11. Response.Expires = 0
  12. Response.CacheControl = "no-cache"
  13. response.Charset = "gb2312"
  14. Dim Conn,User_Conn,DS_Rs,DS_Sql ,DS_Rs1,DS_Sql1
  15. MF_Default_Conn 
  16. MF_User_Conn
  17. MF_Session_TF
  18. if not MF_Check_Pop_TF("Down_List") then Err_Show
  19. if request.QueryString("Act") = "DelAddr" then
  20. if request.QueryString("AddrID")<>"" then 
  21. Conn.execute("delete from FS_DS_Address where ID="&request.QueryString("AddrID"))
  22. Call Edit_AddrList(NoSqlHack(request.QueryString("DownLoadID")))
  23. end if
  24. elseif  request.QueryString("Act") = "Check" then
  25. select case request.QueryString("stype")
  26. case "downname"
  27. DS_Sql = "select Count(*) from FS_DS_List where ClassID='"&NoSqlHack(request.QueryString("classid"))&"'  and Name='"&NoSqlHack(request.QueryString("name"))&"'"
  28. case "DownLoadID"
  29. DS_Sql = "select Count(*) from FS_DS_List where DownLoadID='"&NoSqlHack(request.QueryString("value"))&"'"
  30. case "addrname"
  31. DS_Sql = "select Count(*) from FS_DS_Address where AddressName='"&NoSqlHack(request.QueryString("value"))&"'"
  32. end select
  33. response.Write(Get_OtherTable_Value( DS_Sql ))
  34. response.End()
  35. elseif request.QueryString("Act") = "GetExtName" then
  36. response.Write(getClass_FileExtName(request.QueryString("ClassID")))
  37. response.End()
  38. end if
  39. Sub Edit_AddrList(DownID)
  40. Dim rowii
  41. rowii = 0
  42. if DownID<>"" then
  43. DS_Sql1 = "select ID,AddressName,Url,Number from FS_DS_Address where DownLoadID = '"&DownID&"' order by Number desc"
  44. set DS_Rs1 = Conn.execute(DS_Sql1)
  45. response.Write("<table border=""0"" width=""100%"" cellpadding=""3"" cellspacing=""1"" class=""table"">"&vbcrlf)
  46. do while not DS_Rs1.eof 
  47. rowii = rowii + 1%>
  48.     <tr  class="hback"> 
  49.       <td align="right">下载地址名称</td>
  50.       <td>
  51. <input type="text" size="40" maxlength="50" name="AddressName" id="AddressName" value="<%=DS_Rs1("AddressName")%>">
  52.   </td>
  53.     </tr>
  54.     <tr>
  55.       <td class="hback" align="right">下载地址</td>
  56.       <td colspan="3" class="hback">
  57.   <input name="Url" type="text" id="Url" style="width:50%"  maxlength="100" value="<%=DS_Rs1("Url")%>"> 
  58.       <input type="button" name="bnt_ChoosePic_rowBettween"  value="选择文件" onClick="SelectFile();">
  59.   <span id="Url_Alt"></span>
  60.   </td>       
  61.     </tr>
  62.     <tr  class="hback"> 
  63.       <td align="right">下载地址排序</td>
  64.       <td>
  65.   <input type="text" name="Number" id="Number" size="10" maxlength="1" value="<%=DS_Rs1("Number")%>">
  66.   <%if rowii>1 then%>
  67.   <input type="button" class="tx" value="删除这条下载" onClick="if(confirm('确定删除这条下载吗?')) {new Ajax.Updater('Ajax_AddrInfo','DownloadList_Ajax.asp?no-cache='+Math.random() , {method: 'get', parameters: 'Act=DelAddr&DownLoadID=<%=DownID%>&AddrID=<%=DS_Rs1("ID")%>' });disabled=true;}">
  68.   <%end if%>
  69.       <span class=tx>默认排序请留空!</span></td>
  70.     </tr>
  71. <%
  72. DS_Rs1.movenext
  73. loop
  74. response.Write("</table>")
  75. DS_Rs1.close
  76. %>
  77. <%end if
  78. end Sub
  79. Function getClass_FileExtName(ClassID)
  80. if ClassID<>"" then 
  81. set DS_Rs = Conn.execute("select FileExtName from FS_DS_Class where ClassID='"&NoSqlHack(ClassID)&"'")
  82. if not DS_Rs.eof then 
  83. getClass_FileExtName = DS_Rs("FileExtName")
  84. else
  85. getClass_FileExtName= "html"
  86. end if
  87. DS_Rs.close
  88. end if
  89. End Function
  90. ''得到相关表的值。
  91. Function Get_OtherTable_Value(This_Fun_Sql)
  92. Dim This_Fun_Rs,str_Chk_Info
  93. str_Chk_Info = ""
  94. if instr(This_Fun_Sql," FS_ME_")>0 then 
  95. set This_Fun_Rs = User_Conn.execute(This_Fun_Sql)
  96. else
  97. set This_Fun_Rs = Conn.execute(This_Fun_Sql)
  98. end if
  99. if instr(lcase(This_Fun_Sql)," in ")>0 then 
  100. do while not This_Fun_Rs.eof
  101. str_Chk_Info = str_Chk_Info & This_Fun_Rs(0)
  102. This_Fun_Rs.movenext
  103. loop
  104. else
  105. if not This_Fun_Rs.eof then 
  106. str_Chk_Info = This_Fun_Rs(0)
  107. else
  108. str_Chk_Info = "OK"
  109. end if
  110. end if
  111. if Err.Number>0 then 
  112. Err.Clear
  113. Get_OtherTable_Value = "系统错误,"&Err.Description&",请联系管理员."
  114. exit function
  115. end if
  116. set This_Fun_Rs=nothing 
  117. if str_Chk_Info<>"" and cstr(str_Chk_Info)<>"0" then 
  118. str_Chk_Info = "<font color=red>重复:" & str_Chk_Info &"</font>"
  119. else
  120. str_Chk_Info = "<font color=green>OK</font>"
  121. end if
  122. Get_OtherTable_Value = str_Chk_Info
  123. End Function
  124. User_Conn.close
  125. Conn.close
  126. %>