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

数据库编程

开发平台:

ASP/ASPX

  1. <% Option Explicit %>
  2. <!--#include file="../FS_Inc/Const.asp" -->
  3. <!--#include file="../FS_Inc/Function.asp" -->
  4. <!--#include file="../FS_InterFace/MF_Function.asp" -->
  5. <!--#include file="lib/strlib.asp" -->
  6. <!--#include file="lib/UserCheck.asp" -->
  7. <!--#include file="../FS_Inc/Func_Page.asp" -->
  8. <%
  9. Dim rs
  10. if request("Action")="del" then
  11. if Request("id")="" then
  12. strShowErr = "<li>错误的参数!</li>"
  13. Response.Redirect("lib/error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  14. Response.end
  15. else
  16. User_Conn.execute("Delete from FS_ME_FavoriteClass where UserNumber='"&Fs_User.UserNumber&"' and ClassID ="&NoSqlHack(Request("id")))
  17. User_Conn.execute("update FS_ME_Favorite set FavoClassID=0 where UserNumber='"&Fs_User.UserNumber&"' and  FavoClassID="&NoSqlHack(Request("id")))
  18. set User_Conn=nothing:set Fs_User=nothing
  19. strShowErr = "<li>删除成功!</li>"
  20. Response.Redirect("lib/Success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=../Favorite_Class.asp")
  21. Response.end
  22. end if
  23. end if
  24. if Request.Form("Action")="add_save" then
  25.    set rs= Server.CreateObject(G_FS_RS)
  26.    rs.open "select ClassID,ClassCName,AddTime,UserNumber From FS_ME_FavoriteClass where ClassCName='"&trim(Request.Form("ClassCName"))&"' and UserNumber='"&Fs_User.UserNumber&"'",User_Conn,1,3
  27.    if not rs.eof then
  28.     rs.close:Set rs=nothing
  29. set User_Conn=nothing:set Fs_User=nothing
  30. strShowErr = "<li>此收藏夹已经存在!</li>"
  31. Response.Redirect("lib/error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  32. Response.end
  33.    else
  34.     rs.addnew
  35.     rs("ClassCName")=replace(trim(request.Form("ClassCName")),"'","")
  36. rs("UserNumber")=Fs_User.UserNumber
  37. rs("addtime")=now
  38. rs.update
  39.     rs.close:Set rs=nothing
  40. set User_Conn=nothing:set Fs_User=nothing
  41. strShowErr = "<li>添加成功!</li>"
  42. Response.Redirect("lib/Success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=../Favorite_Class.asp")
  43. Response.end
  44.    end if
  45. end if
  46. if Request.Form("Action")="edit_save" then
  47. set rs= Server.CreateObject(G_FS_RS)
  48. rs.open "select ClassID,ClassCName,UserNumber From FS_ME_FavoriteClass where Classid="&clng(trim(Request.Form("id")))&" and UserNumber='"&Fs_User.UserNumber&"'",User_Conn,1,3
  49. rs("ClassCName")=replace(trim(request.Form("ClassCName")),"'","")
  50. rs.update
  51. rs.close:Set rs=nothing
  52. set User_Conn=nothing:set Fs_User=nothing
  53. strShowErr = "<li>修改成功!</li>"
  54. Response.Redirect("lib/Success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=../Favorite_Class.asp")
  55. Response.end
  56. end if
  57. %>
  58. <html xmlns="http://www.w3.org/1999/xhtml">
  59. <title>相册管理-网站内容管理系统</title>
  60. <meta name="keywords" content="风讯cms,cms,FoosunCMS,FoosunOA,FoosunVif,vif,风讯网站内容管理系统">
  61. <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
  62. <meta content="MSHTML 6.00.3790.2491" name="GENERATOR" />
  63. <meta name="Keywords" content="Foosun,FoosunCMS,Foosun Inc.,风讯,风讯网站内容管理系统,风讯系统,风讯新闻系统,风讯商城,风讯b2c,新闻系统,CMS,域名空间,asp,jsp,asp.net,SQL,SQL SERVER" />
  64. <link href="images/skin/Css_<%=Request.Cookies("FoosunUserCookies")("UserLogin_Style_Num")%>/<%=Request.Cookies("FoosunUserCookies")("UserLogin_Style_Num")%>.css" rel="stylesheet" type="text/css">
  65. <head>
  66. <body>
  67. <table width="98%" border="0" align="center" cellpadding="1" cellspacing="1" class="table">
  68.   <tr>
  69.     <td>
  70.       <!--#include file="top.asp" -->
  71.     </td>
  72.   </tr>
  73. </table>
  74. <table width="98%" height="135" border="0" align="center" cellpadding="1" cellspacing="1" class="table">
  75.   
  76.     <tr class="back"> 
  77.       <td   colspan="2" class="xingmu" height="26"> <!--#include file="Top_navi.asp" --> </td>
  78.     </tr>
  79.     <tr class="back"> 
  80.       <td width="18%" valign="top" class="hback"> <div align="left"> 
  81.           <!--#include file="menu.asp" -->
  82.         </div></td>
  83.       <td width="82%" valign="top" class="hback"><table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
  84.         <tr class="hback"> 
  85.           <td class="hback"><strong>位置:</strong><a href="../">网站首页</a> &gt;&gt; 
  86.             <a href="main.asp">会员首页</a> &gt;&gt; <a href="Favorite.asp">收藏夹管理</a> 
  87.             &gt;&gt;分类管理</td>
  88.         </tr>
  89.       </table> 
  90.   
  91.       <table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
  92.         <tr>
  93.           <td class="hback"><a href="Favorite.asp">全部</a>┆<a href="Favorite.asp?Type=0">新闻</a>┆<a href="Favorite.asp?Type=1">下载</a>┆<a href="Favorite.asp?Type=2">企业会员</a>┆<a href="Favorite.asp?Type=3">供求信息</a>┆<a href="Favorite.asp?Type=4">商品</a>┆<a href="Favorite.asp?Type=5">房产信息</a>┆<a href="Favorite.asp?Type=6">招聘</a>┆<a href="Favorite.asp?Type=7">日志</a>┆<a href="Favorite_Class.asp">收藏夹(分类)管理</a>┆<a href="Favorite_Class.asp?Action=add">增加分类</a></td>
  94.         </tr>
  95.         <tr> 
  96.           <td class="hback"> 
  97.             <%
  98.   response.Write(" <table width=""98%"" align=center cellpadding=""2"" cellspacing=""1""><tr>")
  99.   dim t_k
  100.   t_k=0
  101.   set rs = Server.CreateObject(G_FS_RS)
  102.   rs.open "select ClassID,ClassCName,UserNumber From FS_ME_FavoriteClass where UserNumber='"&Fs_User.UserNumber&"'",User_Conn,1,3
  103.   do while not rs.eof 
  104.    Response.Write(" <td width=""24%"" valign=bottom><img src=""images/folderopened.gif""></img><a href=Favorite.asp?classid="&rs("ClassID")&">"&rs("ClassCName")&"</a><a href=Favorite_class.asp?id="&rs("Classid")&"&Action=edit><修改></a><a href=""Favorite_class.asp?Action=del&id="&rs("Classid")&""" onClick=""{if(confirm('确定删除吗?')){return true;}return false;}""><删除></a></td>")
  105.   rs.movenext
  106.   t_k = t_k+1
  107.   if t_k mod 4 =0 then
  108.    Response.Write(" </tr>")
  109.   end if
  110.   loop
  111.   response.Write(" </table>")
  112.   rs.close:set rs=nothing
  113.   %>
  114.           </td>
  115.         </tr>
  116.       </table> 
  117.       <%if NoSqlHack(Request.QueryString("Action"))="add" then%>
  118.       
  119.         
  120.       <table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
  121.         <form name="form1" method="post" action="">
  122.           <tr> 
  123.             <td colspan="2" class="xingmu">增加收藏夹</td>
  124.           </tr>
  125.           <tr> 
  126.             <td width="24%" class="hback"><div align="right">分类名称</div></td>
  127.             <td width="76%" class="hback"><input name="ClassCName" type="text" id="ClassCName" value="<%=date()%>" size="40"></td>
  128.           </tr>
  129.           <tr> 
  130.             <td class="hback"><div align="right"></div></td>
  131.             <td class="hback"><input type="submit" name="Submit" value="增加收藏夹"> 
  132.               <input name="Action" type="hidden" id="Action" value="add_save"></td>
  133.           </tr>
  134.         </form>
  135.       </table>
  136.       
  137.       <%end if%>
  138.        <%if NoSqlHack(Request.QueryString("Action"))="edit" then
  139.    if NoSqlHack(request.QueryString("id"))="" then
  140.     rs.close:set rs=nothing
  141. set User_Conn=nothing:set Fs_User=nothing
  142. response.Write("错误的参数")
  143. response.end
  144.    end if
  145.    set rs= Server.CreateObject(G_FS_RS)
  146.    rs.open "select Classid,ClassCName,UserNumber From FS_ME_FavoriteClass where Classid="&NoSqlHack(request.QueryString("id")),User_Conn,1,3
  147.    %>
  148.       <table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
  149.         <form name="form1" method="post" action="">
  150.           <tr> 
  151.             <td colspan="2" class="xingmu">修改收藏夹</td>
  152.           </tr>
  153.           <tr> 
  154.             <td width="24%" class="hback"><div align="right">相册分类名称</div></td>
  155.             <td width="76%" class="hback"><input name="ClassCName" type="text" id="ClassCName" value="<%=rs("ClassCName")%>" size="40"><input name="id" type="hidden" id="id" value="<%=rs("Classid")%>" size="40"></td>
  156.           </tr>
  157.           <tr> 
  158.             <td class="hback"><div align="right"></div></td>
  159.             <td class="hback"><input type="submit" name="Submit2" value="修改收藏夹"> 
  160.               <input name="Action" type="hidden" id="Action" value="edit_save"></td>
  161.           </tr>
  162.         </form>
  163.       </table>
  164.       <%end if%>
  165.     </td>
  166.     </tr>
  167.     <tr class="back"> 
  168.       <td height="20"  colspan="2" class="xingmu"> <div align="left"> 
  169.           <!--#include file="Copyright.asp" -->
  170.         </div></td>
  171.     </tr>
  172.  
  173. </table>
  174. </body>
  175. </html>
  176. <%
  177. Set Fs_User = Nothing
  178. %>
  179. <!--Powsered by Foosun Inc.,Product:FoosunCMS V4.0系列-->