yns_setup.asp
上传用户:yjkj1008
上传日期:2020-10-17
资源大小:1496k
文件大小:8k
源码类别:

电子政务应用

开发平台:

HTML/CSS

  1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
  2. <!--#include file="Connections/conn_news.asp" -->
  3. <%
  4. ' *** Restrict Access To Page: Grant or deny access to this page
  5. MM_authorizedUsers="3"
  6. MM_authFailedURL="default.asp"
  7. MM_grantAccess=false
  8. If Session("MM_Username") <> "" Then
  9.   If (false Or CStr(Session("MM_UserAuthorization"))="") Or _
  10.          (InStr(1,MM_authorizedUsers,Session("MM_UserAuthorization"))>=1) Then
  11.     MM_grantAccess = true
  12.   End If
  13. End If
  14. If Not MM_grantAccess Then
  15.   MM_qsChar = "?"
  16.   If (InStr(1,MM_authFailedURL,"?") >= 1) Then MM_qsChar = "&"
  17.   MM_referrer = Request.ServerVariables("URL")
  18.   if (Len(Request.QueryString()) > 0) Then MM_referrer = MM_referrer & "?" & Request.QueryString()
  19.   MM_authFailedURL = MM_authFailedURL & MM_qsChar & "accessdenied=" & Server.URLEncode(MM_referrer)
  20.   Response.Redirect(MM_authFailedURL)
  21. End If
  22. %>
  23. <%
  24. '请尊重作者劳动成果不要删除以上信息
  25. '业一新闻系统3.0正式版
  26. '主页:http://yeyi.net
  27. '论坛:http://bbs.yeyi.net
  28. '业一网络 承接各种网站制作
  29. '程序开发 软件开发业务
  30. '业务联系
  31. '电话: 13007310512
  32. '联系人:郝亚平
  33. 'QQ:24344842 (只谈业务,技术问题请访问论坛)
  34. '请尊重作者劳动成果不要删除以上信息
  35. %>
  36. <%
  37. ' *** Edit Operations: declare variables
  38. Dim MM_editAction
  39. Dim MM_abortEdit
  40. Dim MM_editQuery
  41. Dim MM_editCmd
  42. Dim MM_editConnection
  43. Dim MM_editTable
  44. Dim MM_editRedirectUrl
  45. Dim MM_editColumn
  46. Dim MM_recordId
  47. Dim MM_fieldsStr
  48. Dim MM_columnsStr
  49. Dim MM_fields
  50. Dim MM_columns
  51. Dim MM_typeArray
  52. Dim MM_formVal
  53. Dim MM_delim
  54. Dim MM_altVal
  55. Dim MM_emptyVal
  56. Dim MM_i
  57. MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME"))
  58. If (Request.QueryString <> "") Then
  59.   MM_editAction = MM_editAction & "?" & Request.QueryString
  60. End If
  61. ' boolean to abort record edit
  62. MM_abortEdit = false
  63. ' query string to execute
  64. MM_editQuery = ""
  65. %>
  66. <%
  67. ' *** Update Record: set variables
  68. If (CStr(Request("MM_update")) = "form1" And CStr(Request("MM_recordId")) <> "") Then
  69.   MM_editConnection = MM_conn_news_STRING
  70.   MM_editTable = "t_setup"
  71.   MM_editColumn = "st_id"
  72.   MM_recordId = "" + Request.Form("MM_recordId") + ""
  73.   MM_editRedirectUrl = "yns_ok.htm"
  74.   MM_fieldsStr  = "st_title|value|st_url|value|st_logo|value|st_banner|value|st_copyright|value|st_cnum|value|st_ccnu|value|st_cnnu|value|st_lnum|value"
  75.   MM_columnsStr = "st_title|',none,''|st_url|',none,''|st_logo|',none,''|st_banner|',none,''|st_copyright|',none,''|st_cnum|none,none,NULL|st_ccnu|none,none,NULL|st_cnnu|none,none,NULL|st_lnum|none,none,NULL"
  76.   ' create the MM_fields and MM_columns arrays
  77.   MM_fields = Split(MM_fieldsStr, "|")
  78.   MM_columns = Split(MM_columnsStr, "|")
  79.   
  80.   ' set the form values
  81.   For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
  82.     MM_fields(MM_i+1) = CStr(Request.Form(MM_fields(MM_i)))
  83.   Next
  84.   ' append the query string to the redirect URL
  85.   If (MM_editRedirectUrl <> "" And Request.QueryString <> "") Then
  86.     If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And Request.QueryString <> "") Then
  87.       MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
  88.     Else
  89.       MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
  90.     End If
  91.   End If
  92. End If
  93. %>
  94. <%
  95. ' *** Update Record: construct a sql update statement and execute it
  96. If (CStr(Request("MM_update")) <> "" And CStr(Request("MM_recordId")) <> "") Then
  97.   ' create the sql update statement
  98.   MM_editQuery = "update " & MM_editTable & " set "
  99.   For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
  100.     MM_formVal = MM_fields(MM_i+1)
  101.     MM_typeArray = Split(MM_columns(MM_i+1),",")
  102.     MM_delim = MM_typeArray(0)
  103.     If (MM_delim = "none") Then MM_delim = ""
  104.     MM_altVal = MM_typeArray(1)
  105.     If (MM_altVal = "none") Then MM_altVal = ""
  106.     MM_emptyVal = MM_typeArray(2)
  107.     If (MM_emptyVal = "none") Then MM_emptyVal = ""
  108.     If (MM_formVal = "") Then
  109.       MM_formVal = MM_emptyVal
  110.     Else
  111.       If (MM_altVal <> "") Then
  112.         MM_formVal = MM_altVal
  113.       ElseIf (MM_delim = "'") Then  ' escape quotes
  114.         MM_formVal = "'" & Replace(MM_formVal,"'","''") & "'"
  115.       Else
  116.         MM_formVal = MM_delim + MM_formVal + MM_delim
  117.       End If
  118.     End If
  119.     If (MM_i <> LBound(MM_fields)) Then
  120.       MM_editQuery = MM_editQuery & ","
  121.     End If
  122.     MM_editQuery = MM_editQuery & MM_columns(MM_i) & " = " & MM_formVal
  123.   Next
  124.   MM_editQuery = MM_editQuery & " where " & MM_editColumn & " = " & MM_recordId
  125.   If (Not MM_abortEdit) Then
  126.     ' execute the update
  127.     Set MM_editCmd = Server.CreateObject("ADODB.Command")
  128.     MM_editCmd.ActiveConnection = MM_editConnection
  129.     MM_editCmd.CommandText = MM_editQuery
  130.     MM_editCmd.Execute
  131.     MM_editCmd.ActiveConnection.Close
  132.     If (MM_editRedirectUrl <> "") Then
  133.       Response.Redirect(MM_editRedirectUrl)
  134.     End If
  135.   End If
  136. End If
  137. %>
  138. <%
  139. Dim rssetup
  140. Dim rssetup_numRows
  141. Set rssetup = Server.CreateObject("ADODB.Recordset")
  142. rssetup.ActiveConnection = MM_conn_news_STRING
  143. rssetup.Source = "SELECT * FROM t_setup"
  144. rssetup.CursorType = 0
  145. rssetup.CursorLocation = 2
  146. rssetup.LockType = 1
  147. rssetup.Open()
  148. rssetup_numRows = 0
  149. %>
  150. <html>
  151. <head>
  152. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  153. <title>业一新闻系统3.0正式版-------业一网络Yeyi.net制作</title>
  154. <link href="style/css.css" rel="stylesheet" type="text/css">
  155. </head>
  156. <body>
  157. <form method="POST" action="<%=MM_editAction%>" name="form1">
  158.   <table width="600" border="0" align="center" cellpadding="0" cellspacing="0">
  159.     <tr bgcolor="#CCCCCC"> 
  160.       <td height="3" colspan="2" align="right" nowrap></td>
  161.     </tr>
  162.     <tr> 
  163.       <td height="7" colspan="2" align="right" nowrap class="bg"></td>
  164.     </tr>
  165.     <tr> 
  166.       <td width="26%" height="30" align="center" nowrap>网站标题:</td>
  167.       <td width="70%" height="30"> <input type="text" name="st_title" value="<%=(rssetup.Fields.Item("st_title").Value)%>" size="32"> 
  168.       </td>
  169.     </tr>
  170.     <tr class="bg"> 
  171.       <td width="26%" height="30" align="center" nowrap>网站地址:</td>
  172.       <td height="30"> <input type="text" name="st_url" value="<%=(rssetup.Fields.Item("st_url").Value)%>" size="32"> 
  173.       </td>
  174.     </tr>
  175.     <tr> 
  176.       <td width="26%" height="30" align="center" nowrap>网站Logo:</td>
  177.       <td height="30"> <input type="text" name="st_logo" value="<%=(rssetup.Fields.Item("st_logo").Value)%>" size="40"> 
  178.       </td>
  179.     </tr>
  180.     <tr class="bg"> 
  181.       <td width="26%" height="30" align="center" nowrap>网站Banner:</td>
  182.       <td height="30"> <input type="text" name="st_banner" value="<%=(rssetup.Fields.Item("st_banner").Value)%>" size="40"> 
  183.       </td>
  184.     </tr>
  185.     <tr> 
  186.       <td width="26%" height="30" align="center" nowrap>版权所有:</td>
  187.       <td height="30"> <input type="text" name="st_copyright" value="<%=(rssetup.Fields.Item("st_copyright").Value)%>" size="40"> 
  188.       </td>
  189.     </tr>
  190.     <tr class="bg"> 
  191.       <td width="26%" height="30" align="center" nowrap><font color="#FF0000">大类新闻</font>每页显示数:</td>
  192.       <td height="30"> <input type="text" name="st_cnum" value="<%=(rssetup.Fields.Item("st_cnum").Value)%>" size="5"> 
  193.       </td>
  194.     </tr>
  195.     <tr> 
  196.       <td width="26%" height="30" align="center" nowrap><font color="#FF0000">推荐新闻</font>每页显示数:</td>
  197.       <td height="30"><input name="st_ccnu" type="text" id="st_ccnu" value="<%=(rssetup.Fields.Item("st_ccnu").Value)%>" size="5"> 
  198.       </td>
  199.     </tr>
  200.     <tr class="bg"> 
  201.       <td height="30" align="center" nowrap><font color="#FF0000">搜索结果</font>每页显示数:</td>
  202.       <td height="30"><input name="st_cnnu" type="text" id="st_cnnu" value="<%=(rssetup.Fields.Item("st_cnnu").Value)%>" size="5"></td>
  203.     </tr>
  204.     <tr> 
  205.       <td height="30" align="center" nowrap><font color="#FF0000">后台</font>每页显示数:</td>
  206.       <td height="30"><input type="text" name="st_lnum" value="<%=(rssetup.Fields.Item("st_lnum").Value)%>" size="5"></td>
  207.     </tr>
  208.     <tr> 
  209.       <td width="26%" height="30" align="center" nowrap>&nbsp;</td>
  210.       <td height="30"> <input type="submit" value="系统设置"> </td>
  211.     </tr>
  212.   </table>
  213.   <input type="hidden" name="MM_update" value="form1">
  214.   <input type="hidden" name="MM_recordId" value="<%= rssetup.Fields.Item("st_id").Value %>">
  215. </form>
  216. <p>&nbsp;</p>
  217. </body>
  218. </html>
  219. <%
  220. rssetup.Close()
  221. Set rssetup = Nothing
  222. %>