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

电子政务应用

开发平台:

HTML/CSS

  1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
  2. <!--#include file="Connections/conn_news.asp" --> <% '请尊重作者劳动成果不要删除以上信息 '业一新闻系统3.0正式版 '主页:http://yeyi.net '论坛:http://bbs.yeyi.net '业一网络 承接各种网站制作 '程序开发 软件开发业务 '业务联系 '电话: 13007310512 '联系人:郝亚平 'QQ:24344842 (只谈业务,技术问题请访问论坛) '请尊重作者劳动成果不要删除以上信息 %>
  3. <%
  4. ' *** Restrict Access To Page: Grant or deny access to this page
  5. MM_authorizedUsers="1,2,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. Dim rst
  25. Dim rst_numRows
  26. Set rst = Server.CreateObject("ADODB.Recordset")
  27. rst.ActiveConnection = MM_conn_news_STRING
  28. rst.Source = "SELECT * FROM t_type"
  29. rst.CursorType = 0
  30. rst.CursorLocation = 2
  31. rst.LockType = 1
  32. rst.Open()
  33. rst_numRows = 0
  34. %>
  35. <%
  36. Dim rss
  37. Dim rss_numRows
  38. Set rss = Server.CreateObject("ADODB.Recordset")
  39. rss.ActiveConnection = MM_conn_news_STRING
  40. rss.Source = "SELECT * FROM t_stype"
  41. rss.CursorType = 0
  42. rss.CursorLocation = 2
  43. rss.LockType = 1
  44. rss.Open()
  45. rss_numRows = 0
  46. %>
  47. <%
  48. Dim rsm
  49. Dim rsm_numRows
  50. Set rsm = Server.CreateObject("ADODB.Recordset")
  51. rsm.ActiveConnection = MM_conn_news_STRING
  52. rsm.Source = "SELECT m_id, m_name FROM t_mob"
  53. rsm.CursorType = 0
  54. rsm.CursorLocation = 2
  55. rsm.LockType = 1
  56. rsm.Open()
  57. rsm_numRows = 0
  58. %>
  59. <%
  60. function makefilename(fname)
  61. fname = now()
  62. fname = replace(fname,"-","")
  63. fname = replace(fname," ","") 
  64. fname = replace(fname,":","")
  65. fname = replace(fname,"PM","")
  66. fname = replace(fname,"AM","")
  67. fname = replace(fname,"上午","")
  68. fname = replace(fname,"下午","")
  69. makefilename=fname & ".htm"
  70. end function 
  71. %>
  72. <%
  73. Dim fname
  74. Dim filepath
  75. fname = makefilename(now()) 
  76. filepath=(rst.Fields.Item("t_id").Value)
  77. %> 
  78. <html>
  79. <head>
  80. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  81. <title>业一新闻系统3.0正式版-------业一网络Yeyi.net制作</title>
  82. <script>
  83. <!--
  84. function showimg(){
  85. if (document.form1.n_index.checked == true) {
  86. img.style.display = "";
  87. advance.innerText="取消首页新闻:"
  88. }else{
  89. img.style.display = "none";
  90. advance.innerText="设为首页新闻:"
  91. }
  92. }
  93. function MM_openBrWindow(theURL,winName,features) { //v2.0
  94.   window.open(theURL,winName,features);
  95. }
  96. //-->
  97. </script>
  98. <script language="JavaScript">
  99. <!--
  100. function Dofromsite(addfromsite)
  101. var fromsite = document.form1.addfromsite.value; 
  102. document.form1.fromsite.value=fromsite; 
  103. document.form1.fromsite.focus(); 
  104. return; }
  105. //-->
  106. </script>
  107. <script language="javascript">
  108. <!--
  109. function na_select_form (fname, type_name) 
  110. {
  111.   document.forms[fname].elements[type_name].select()
  112.   document.forms[fname].elements[type_name].focus()
  113. }
  114. function checkdata()
  115. {
  116. if (document.form1.viewhtml.checked == true)
  117. {
  118.   alert("对不起,请取消“查看HTML源代码”后再添加!")
  119.   document.form1.viewhtml.focus()
  120.   return false
  121.  }
  122. if (document.form1.n_title.value=="") {
  123. alert ("请输入新闻标题 !")
  124. return false
  125. }
  126. if (document.form1.n_author.value=="") {
  127. alert ("请输入新闻作者 !")
  128. return false
  129. }
  130. if (document.form1.n_content.value=="") {
  131. alert ("请输入新闻内容 !")
  132. return false
  133. }
  134. return true
  135. }
  136. //-->
  137. </script>
  138. <link href="style/css.css" rel="stylesheet" type="text/css">
  139. </head>
  140. <body>
  141. <form ACTION="yns_save.asp" METHOD="POST"   name="form1" id="form1" OnSubmit="return checkdata()" onReset="return ResetForm();" >
  142.   <table width="575" border="0" align="center" cellpadding="0" cellspacing="0">
  143.     <tr>
  144.       <td height="3" bgcolor="#CCCCCC"></td>
  145.     </tr>
  146.   </table>
  147.   <table width="575" border="0" align="center" cellpadding="0" cellspacing="0" class="line">
  148.     <tr> 
  149.       <td height="7" colspan="3" align="center" nowrap class="bg"></td>
  150.     </tr>
  151.     <tr> 
  152.       <td width="18%" height="20" align="center" nowrap>新闻类别:</td>
  153.       <td height="20" colspan="2"> 
  154.         <select style="font-family: 宋体; font-size: 9pt" name="n_tid">
  155.           <%
  156. While (NOT rst.EOF)
  157. %>
  158.           <option value="<%=(rst.Fields.Item("t_id").Value)%>"><%=(rst.Fields.Item("t_name").Value)%></option>
  159.           <%
  160.   rst.MoveNext()
  161. Wend
  162. If (rst.CursorType > 0) Then
  163.   rst.MoveFirst
  164. Else
  165.   rst.Requery
  166. End If
  167. %>
  168.         </select> </td>
  169.     </tr>
  170.     <tr class="bg"> 
  171.       <td width="18%" height="20" align="center" nowrap>专题类别:</td>
  172.       <td height="20" colspan="2"> 
  173.         <select style="font-family: 宋体; font-size: 9pt" name="n_sid">
  174.           <option value="">不属于专题</option>
  175.           <%
  176. While (NOT rss.EOF)
  177. %>
  178.           <option value="<%=(rss.Fields.Item("s_id").Value)%>"><%=(rss.Fields.Item("s_name").Value)%></option>
  179.           <%
  180.   rss.MoveNext()
  181. Wend
  182. If (rss.CursorType > 0) Then
  183.   rss.MoveFirst
  184. Else
  185.   rss.Requery
  186. End If
  187. %>
  188.         </select> </td>
  189.     </tr>
  190.     <tr> 
  191.       <td width="18%" height="20" align="center" nowrap>新闻模板:</td>
  192.       <td height="20" colspan="2"> <select name="n_mid" style="font-family: 宋体; font-size: 9pt" >
  193.           <%
  194. While (NOT rsm.EOF)
  195. %>
  196.           <option value="<%=(rsm.Fields.Item("m_id").Value)%>"><%=(rsm.Fields.Item("m_name").Value)%></option>
  197.           <%
  198.   rsm.MoveNext()
  199. Wend
  200. If (rsm.CursorType > 0) Then
  201.   rsm.MoveFirst
  202. Else
  203.   rsm.Requery
  204. End If
  205. %>
  206.         </select> </td>
  207.     </tr>
  208.     <tr class="bg"> 
  209.       <td width="18%" height="20" align="center" nowrap>是否推荐:</td>
  210.       <td height="20" colspan="2"> 
  211.         <input type="checkbox" name="n_commend" value=true > 
  212.       </td>
  213.     </tr>
  214.     <tr> 
  215.       <td width="18%" height="20" align="center" nowrap><span id=advance>设为首页新闻:</span></td>
  216.       <td height="20" colspan="2"> <input type="checkbox" name="n_index" value=true onclick=showimg()> 
  217.       </td>
  218.     </tr>
  219.     <tr class="bg"> 
  220.       <td width="18%" height="20" align="center" nowrap>新闻标题:</td>
  221.       <td height="20" colspan="2"> 
  222.         <input style="font-family: 宋体; font-size: 9pt" type="text" name="n_title" value="" size="32"> 
  223.       </td>
  224.     </tr>
  225.     <tr> 
  226.       <td width="18%" height="20" align="center" nowrap>新闻作者:</td>
  227.       <td height="20" colspan="2"> <font color="#F6F6F6"> 
  228.         <input style="font-family: 宋体; font-size: 9pt" type="text" name="n_author" value="" size="15">
  229.         </font></td>
  230.     </tr>
  231.   </table>
  232.   <table width="575" border="0" align="center" cellpadding="0" cellspacing="0" id="img" style="display: none">
  233.     <tr class="bg"> 
  234.       <td width="18%" height="20" align="center" nowrap>缩略图:</td>
  235.       <td width="50%" height="20"> 
  236.         <input style="font-family: 宋体; font-size: 9pt"  type="text" name="n_mpic" value="" size="32"> 
  237.       </td>
  238.       <td width="32%" height="20"> <a href="#" onClick="MM_openBrWindow('yns_upload.asp?m=1','上传图片','width=300,height=100')">上传缩略图</a></td>
  239.     </tr>
  240.     <tr> 
  241.       <td width="18%" height="20" align="center" nowrap>真实图:</td>
  242.       <td width="50%" height="20"> 
  243.         <input style="font-family: 宋体; font-size: 9pt" type="text" name="n_rpic" value="" size="32"> 
  244.       </td>
  245.       <td width="32%" height="20"> <a href="#" onClick="MM_openBrWindow('yns_upload.asp?m=2','上传图片','width=300,height=100')">上传真实图</a></td>
  246.     </tr>
  247.   </table>
  248.   <table width="575" border="0" align="center" cellpadding="0" cellspacing="0">
  249.     <tr> 
  250.       <td>
  251.         <!--#include file="edit.asp" -->
  252. <script language="javascript">
  253. document.write ('<iframe src="yns_tarea.asp" id="message" width="575" height="350"></iframe>')
  254. frames.message.document.designMode = "On";
  255. </script>
  256.       </td>
  257.     </tr>
  258.   </table>
  259.   <div align="center">
  260.     <input id=Submit1  onClick="document.form1.n_content.value = frames.message.document.body.innerHTML;" type=submit name=Submit1 value="添加新闻">
  261.     <input name="Submit2" type="reset" id="Submit2" value="清除表单">
  262.     <input name="n_fname" type="hidden" id="n_fname3" value="<%=fname%>">
  263.     <input name="n_date" type="hidden" id="n_date2" value="<%=now()%>">
  264.     <input name="n_content" type="hidden" id="n_content">
  265.     <input type="hidden" name="MM_insert" value="form1">
  266.   </div>
  267. </form>
  268. </body>
  269. </html>
  270. <script src="edit.js" type="text/javascript"></script>
  271. <%
  272. rst.Close()
  273. Set rst = Nothing
  274. %>
  275. <%
  276. rss.Close()
  277. Set rss = Nothing
  278. %>
  279. <%
  280. rsm.Close()
  281. Set rsm = Nothing
  282. %>