Photo_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_PhotoClass where UserNumber='"&Fs_User.UserNumber&"' and ID ="&NoSqlHack(Request("id")))
  17. User_Conn.execute("update FS_ME_Photo set Classid=0 where UserNumber='"&Fs_User.UserNumber&"' and  ClassID="&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=../Photo_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 title,id,UserNumber From FS_ME_PhotoClass where title='"&trim(Request.Form("title"))&"' 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("title")=replace(trim(request.Form("title")),"'","")
  36. rs("UserNumber")=Fs_User.UserNumber
  37. rs.update
  38.     rs.close:Set rs=nothing
  39. set User_Conn=nothing:set Fs_User=nothing
  40. strShowErr = "<li>添加成功!</li>"
  41. Response.Redirect("lib/Success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=../Photo_Class.asp")
  42. Response.end
  43.    end if
  44. end if
  45. if Request.Form("Action")="edit_save" then
  46. set rs= Server.CreateObject(G_FS_RS)
  47. rs.open "select title,id,UserNumber From FS_ME_PhotoClass where id="&clng(trim(Request.Form("id")))&" and UserNumber='"&Fs_User.UserNumber&"'",User_Conn,1,3
  48. rs("title")=replace(trim(request.Form("title")),"'","")
  49. rs.update
  50. rs.close:Set rs=nothing
  51. set User_Conn=nothing:set Fs_User=nothing
  52. strShowErr = "<li>修改成功!</li>"
  53. Response.Redirect("lib/Success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=../Photo_Class.asp")
  54. Response.end
  55. end if
  56. %>
  57. <html xmlns="http://www.w3.org/1999/xhtml">
  58. <title>相册管理-网站内容管理系统</title>
  59. <meta name="keywords" content="风讯cms,cms,FoosunCMS,FoosunOA,FoosunVif,vif,风讯网站内容管理系统">
  60. <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
  61. <meta content="MSHTML 6.00.3790.2491" name="GENERATOR" />
  62. <meta name="Keywords" content="Foosun,FoosunCMS,Foosun Inc.,风讯,风讯网站内容管理系统,风讯系统,风讯新闻系统,风讯商城,风讯b2c,新闻系统,CMS,域名空间,asp,jsp,asp.net,SQL,SQL SERVER" />
  63. <link href="images/skin/Css_<%=Request.Cookies("FoosunUserCookies")("UserLogin_Style_Num")%>/<%=Request.Cookies("FoosunUserCookies")("UserLogin_Style_Num")%>.css" rel="stylesheet" type="text/css">
  64. <head>
  65. <body>
  66. <table width="98%" border="0" align="center" cellpadding="1" cellspacing="1" class="table">
  67.   <tr>
  68.     <td>
  69.       <!--#include file="top.asp" -->
  70.     </td>
  71.   </tr>
  72. </table>
  73. <table width="98%" height="135" border="0" align="center" cellpadding="1" cellspacing="1" class="table">
  74.   
  75.     <tr class="back"> 
  76.       <td   colspan="2" class="xingmu" height="26"> <!--#include file="Top_navi.asp" --> </td>
  77.     </tr>
  78.     <tr class="back"> 
  79.       <td width="18%" valign="top" class="hback"> <div align="left"> 
  80.           <!--#include file="menu.asp" -->
  81.         </div></td>
  82.       <td width="82%" valign="top" class="hback"><table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
  83.         <tr class="hback"> 
  84.           <td class="hback"><strong>位置:</strong><a href="../">网站首页</a> &gt;&gt; 
  85.             <a href="main.asp">会员首页</a> &gt;&gt; <a href="PhotoManage.asp">相册管理</a> 
  86.             &gt;&gt;分类管理</td>
  87.         </tr>
  88.       </table> 
  89.   
  90.       <table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
  91.         <tr>
  92.           <td class="hback"><a href="PhotoManage.asp">相册首页</a>┆<a href="Photo_add.asp">增加图片</a>┆<a href="PhotoManage.asp?isRec=1">被推荐的图片</a>┆<a href="Photo_filt.asp">幻灯片播放</a>┆<a href="Photo_Class.asp">相册分类</a>┆<a href="Photo_Class.asp?Action=add">增加分类</a></td>
  93.         </tr>
  94.         <tr> 
  95.           <td class="hback"> 
  96.             <%
  97.   response.Write(" <table width=""98%"" align=center cellpadding=""2"" cellspacing=""1""><tr>")
  98.   dim t_k
  99.   t_k=0
  100.   set rs = Server.CreateObject(G_FS_RS)
  101.   rs.open "select id,title,UserNumber From FS_ME_PhotoClass where UserNumber='"&Fs_User.UserNumber&"'",User_Conn,1,3
  102.   do while not rs.eof 
  103.    Response.Write(" <td width=""24%"" valign=bottom><img src=""images/folderopened.gif""></img><a href=PhotoManage.asp?classid="&rs("id")&" title=""点击查看此分类下的图片"">"&rs("title")&"</a><a href=Photo_Class.asp?id="&rs("id")&"&Action=edit><修改></a><a href=""Photo_Class.asp?Action=del&id="&rs("id")&""" onClick=""{if(confirm('确定删除吗?')){return true;}return false;}""><删除></a></td>")
  104.   rs.movenext
  105.   t_k = t_k+1
  106.   if t_k mod 4 =0 then
  107.    Response.Write(" </tr>")
  108.   end if
  109.   loop
  110.   response.Write(" </table>")
  111.   rs.close:set rs=nothing
  112.   %>
  113.           </td>
  114.         </tr>
  115.       </table> 
  116.       <%if NoSqlHack(Request.QueryString("Action"))="add" then%>
  117.       
  118.         
  119.       <table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
  120.         <form name="form1" method="post" action="">
  121.           <tr> 
  122.             <td colspan="2" class="xingmu">增加相册分类</td>
  123.           </tr>
  124.           <tr> 
  125.             <td width="24%" class="hback"><div align="right">相册分类名称</div></td>
  126.             <td width="76%" class="hback"><input name="title" type="text" id="title" value="<%=date()%>" size="40"></td>
  127.           </tr>
  128.           <tr> 
  129.             <td class="hback"><div align="right"></div></td>
  130.             <td class="hback"><input type="submit" name="Submit" value="增加相册分类">
  131.               <input name="Action" type="hidden" id="Action" value="add_save"></td>
  132.           </tr>
  133.         </form>
  134.       </table>
  135.       
  136.       <%end if%>
  137.        <%if NoSqlHack(Request.QueryString("Action"))="edit" then
  138.    if NoSqlHack(request.QueryString("id"))="" then
  139.     rs.close:set rs=nothing
  140. set User_Conn=nothing:set Fs_User=nothing
  141. response.Write("错误的参数")
  142. response.end
  143.    end if
  144.    set rs= Server.CreateObject(G_FS_RS)
  145.    rs.open "select id,title,UserNumber From FS_ME_PhotoClass where id="&NoSqlHack(request.QueryString("id")),User_Conn,1,3
  146.    %>
  147.       <table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
  148.         <form name="form1" method="post" action="">
  149.           <tr> 
  150.             <td colspan="2" class="xingmu">修改相册分类</td>
  151.           </tr>
  152.           <tr> 
  153.             <td width="24%" class="hback"><div align="right">相册分类名称</div></td>
  154.             <td width="76%" class="hback"><input name="title" type="text" id="title" value="<%=rs("title")%>" size="40"><input name="id" type="hidden" id="id" value="<%=rs("id")%>" size="40"></td>
  155.           </tr>
  156.           <tr> 
  157.             <td class="hback"><div align="right"></div></td>
  158.             <td class="hback"><input type="submit" name="Submit2" value="修改相册分类"> 
  159.               <input name="Action" type="hidden" id="Action" value="edit_save"></td>
  160.           </tr>
  161.         </form>
  162.       </table>
  163.       <%end if%>
  164.     </td>
  165.     </tr>
  166.     <tr class="back"> 
  167.       <td height="20"  colspan="2" class="xingmu"> <div align="left"> 
  168.           <!--#include file="Copyright.asp" -->
  169.         </div></td>
  170.     </tr>
  171.  
  172. </table>
  173. </body>
  174. </html>
  175. <%
  176. Set Fs_User = Nothing
  177. %>
  178. <!--Powsered by Foosun Inc.,Product:FoosunCMS V4.0系列-->