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

数据库编程

开发平台:

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="../../FS_InterFace/NS_Function.asp" -->
  6. <!--#include file="../../FS_Inc/Func_page.asp" -->
  7. <%'Copyright (c) 2006 Foosun Inc. Code by 邓西
  8. response.buffer=true
  9. Response.CacheControl = "no-cache"
  10. Dim Conn,User_Conn
  11. MF_Default_Conn
  12. MF_Session_TF 
  13. if not MF_Check_Pop_TF("AS_site") then Err_Show
  14. if not MF_Check_Pop_TF("AS003") then Err_Show
  15. Dim lng_ClassID,o_Class_Rs,str_Class_Sql,OpCType,str_ClassName,strShowErr,str_ClassSubmit,str_temp_name,str_Optype_name
  16. str_ClassSubmit=Request.Form("ClassSubmit")
  17. If str_ClassSubmit="Submit" Then
  18. str_ClassName=Request.Form("ClassName")
  19. If Trim(str_ClassName)="" or IsNull(str_ClassName) Then
  20. strShowErr = "<li>栏目名字不能为空!</li>"
  21. Response.Redirect("lib/Error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  22. Response.end
  23. Else
  24. str_Class_Sql="Select * from FS_AD_Class where AdClassName='"&str_ClassName&"'"
  25. Set o_Class_Rs=Conn.execute(str_Class_Sql)
  26. If o_Class_Rs.Eof Then
  27. Conn.execute("insert into FS_AD_Class(AdClassName,AddDate,Lock) values('"&str_ClassName&"','"&Now()&"',0)")
  28. Set o_Class_Rs=Nothing
  29. strShowErr = "<li>添加成功!</li>"
  30. Response.Redirect("lib/Success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=AdminAdsAds_ClassManage.asp")
  31. Response.end
  32. Else
  33. Set o_Class_Rs=Nothing
  34. strShowErr = "<li>栏目名字已存在!</li>"
  35. Response.Redirect("lib/Error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  36. Response.end
  37. End If
  38. End If
  39. End If
  40. str_temp_name= Request.Querystring("OpCType")
  41. If str_temp_name<>"" Then
  42. str_temp_name=" 添 加 "
  43. str_ClassSubmit="Submit"
  44. Else
  45. str_temp_name=" 修 改 "
  46. End If
  47. lng_ClassID=Request.QueryString("ID")
  48. If lng_ClassID<>"" or Not IsNull(lng_ClassID) Then
  49. Set o_Class_Rs=Conn.execute("Select AdClassName From FS_AD_Class Where AdClassID="&Clng(lng_ClassID)&"")
  50. If Not o_Class_Rs.Eof Then
  51. str_ClassName=o_Class_Rs("AdClassName")
  52. End If
  53. Set o_Class_Rs=Nothing
  54. End If 
  55. str_Optype_name=Request.Form("ClassName")
  56. If Trim(str_Optype_name)<>"" Then
  57. lng_ClassID=Request.Form("ClassID")
  58. If lng_ClassID="" or IsNull(lng_ClassID) Then
  59. strShowErr = "<li>参数错误!</li>"
  60. Response.Redirect("lib/Error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  61. Response.end
  62. Else
  63. If isnumeric(lng_ClassID)=False Then
  64. strShowErr = "<li>参数错误!</li>"
  65. Response.Redirect("lib/Error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  66. Response.end
  67. Else
  68. str_Class_Sql="Select * from FS_AD_Class where AdClassName='"&str_Optype_name&"'"
  69. Set o_Class_Rs=Conn.execute(str_Class_Sql)
  70. If o_Class_Rs.Eof Then
  71. Conn.execute("Update FS_AD_Class Set AdClassName='"&str_Optype_name&"' where AdClassID="&Clng(lng_ClassID)&"")
  72. Set o_Class_Rs=Nothing
  73. strShowErr = "<li>修改成功!</li>"
  74. Response.Redirect("lib/Success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=AdminAdsAds_ClassManage.asp?Page="&Request.QueryString("Page")&"")
  75. Response.end
  76. Else
  77. Set o_Class_Rs=Nothing
  78. strShowErr = "<li>栏目名字已存在!</li>"
  79. Response.Redirect("lib/Error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  80. Response.end
  81. End If
  82. Set o_Class_Rs=Nothing
  83. End If
  84. End If
  85. End If
  86. %>
  87. <html>
  88. <head>
  89. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  90. <title>广告统计___Powered by foosun Inc.</title>
  91. <link href="../images/skin/Css_<%=Session("Admin_Style_Num")%>/<%=Session("Admin_Style_Num")%>.css" rel="stylesheet" type="text/css">
  92. </head>
  93. <body>
  94. <table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
  95.   <tr class="hback"> 
  96.     <td class="xingmu"><%=str_temp_name%>广告分类</td>
  97.   </tr>
  98.    <tr class="hback"> 
  99.     <td align="left" class="hback"><a href="javascript:history.back();">返回上一级</a></td>
  100.   </tr>
  101.    <tr class="hback">
  102.      <td align="left" class="hback" height="10"></td>
  103.    </tr>
  104.    <tr class="hback">
  105.      <td align="center" class="hback"><form name="AdClass" method="post" action="">
  106.        <p> </p>
  107.        <table width="426" border="0" cellspacing="0" cellpadding="0">
  108.        <tr>
  109.          <td width="109" height="20" align="right">栏目名称</td>
  110.          <td width="10" align="right"> </td>
  111.          <td width="307" align="left"><input name="ClassName" type="text" size="30" maxlength="30" title="栏目名称:必填" value="<%=str_ClassName%>"><input type="hidden" value="<%=str_ClassSubmit%>" name="ClassSubmit"><input type="hidden" value="<%=str_ClassName%>" name="Tempname"><input type="hidden" value="<%=lng_ClassID%>" name="ClassID"></td>
  112.        </tr>
  113.        <tr>
  114.          <td height="10" colspan="3">&nbsp;</td>
  115.        </tr>
  116.        <tr>
  117.          <td height="10" colspan="3" align="center"><input name="Tj" type="submit" id="Tj" value="<%=str_temp_name%>">
  118.              <input name="Cx" type="reset" id="Cx" value=" 重 写 "></td>
  119.        </tr>
  120.      </table>
  121.  </form></td>
  122.    </tr>
  123. </table>
  124. </body>
  125. </html>
  126. <%
  127. Sub CheckAllIDFLag(Showstr)
  128. If CheckAllID="" or IsNull(CheckAllID) Then
  129. strShowErr = "<li>请选择要"&Showstr&"的文件!</li>"
  130. Response.Redirect("lib/Error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  131. Response.end
  132. End If
  133. End Sub
  134. Set Conn=Nothing
  135. %><!-- Powered by: FoosunCMS4.0系列,Company:Foosun Inc. -->