yns_add.asp
资源名称:gov_1.0.rar [点击查看]
上传用户:yjkj1008
上传日期:2020-10-17
资源大小:1496k
文件大小:9k
源码类别:
电子政务应用
开发平台:
HTML/CSS
- <%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
- <!--#include file="Connections/conn_news.asp" --> <% '请尊重作者劳动成果不要删除以上信息 '业一新闻系统3.0正式版 '主页:http://yeyi.net '论坛:http://bbs.yeyi.net '业一网络 承接各种网站制作 '程序开发 软件开发业务 '业务联系 '电话: 13007310512 '联系人:郝亚平 'QQ:24344842 (只谈业务,技术问题请访问论坛) '请尊重作者劳动成果不要删除以上信息 %>
- <%
- ' *** Restrict Access To Page: Grant or deny access to this page
- MM_authorizedUsers="1,2,3"
- MM_authFailedURL="default.asp"
- MM_grantAccess=false
- If Session("MM_Username") <> "" Then
- If (false Or CStr(Session("MM_UserAuthorization"))="") Or _
- (InStr(1,MM_authorizedUsers,Session("MM_UserAuthorization"))>=1) Then
- MM_grantAccess = true
- End If
- End If
- If Not MM_grantAccess Then
- MM_qsChar = "?"
- If (InStr(1,MM_authFailedURL,"?") >= 1) Then MM_qsChar = "&"
- MM_referrer = Request.ServerVariables("URL")
- if (Len(Request.QueryString()) > 0) Then MM_referrer = MM_referrer & "?" & Request.QueryString()
- MM_authFailedURL = MM_authFailedURL & MM_qsChar & "accessdenied=" & Server.URLEncode(MM_referrer)
- Response.Redirect(MM_authFailedURL)
- End If
- %>
- <%
- Dim rst
- Dim rst_numRows
- Set rst = Server.CreateObject("ADODB.Recordset")
- rst.ActiveConnection = MM_conn_news_STRING
- rst.Source = "SELECT * FROM t_type"
- rst.CursorType = 0
- rst.CursorLocation = 2
- rst.LockType = 1
- rst.Open()
- rst_numRows = 0
- %>
- <%
- Dim rss
- Dim rss_numRows
- Set rss = Server.CreateObject("ADODB.Recordset")
- rss.ActiveConnection = MM_conn_news_STRING
- rss.Source = "SELECT * FROM t_stype"
- rss.CursorType = 0
- rss.CursorLocation = 2
- rss.LockType = 1
- rss.Open()
- rss_numRows = 0
- %>
- <%
- Dim rsm
- Dim rsm_numRows
- Set rsm = Server.CreateObject("ADODB.Recordset")
- rsm.ActiveConnection = MM_conn_news_STRING
- rsm.Source = "SELECT m_id, m_name FROM t_mob"
- rsm.CursorType = 0
- rsm.CursorLocation = 2
- rsm.LockType = 1
- rsm.Open()
- rsm_numRows = 0
- %>
- <%
- function makefilename(fname)
- fname = now()
- fname = replace(fname,"-","")
- fname = replace(fname," ","")
- fname = replace(fname,":","")
- fname = replace(fname,"PM","")
- fname = replace(fname,"AM","")
- fname = replace(fname,"上午","")
- fname = replace(fname,"下午","")
- makefilename=fname & ".htm"
- end function
- %>
- <%
- Dim fname
- Dim filepath
- fname = makefilename(now())
- filepath=(rst.Fields.Item("t_id").Value)
- %>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
- <title>业一新闻系统3.0正式版-------业一网络Yeyi.net制作</title>
- <script>
- <!--
- function showimg(){
- if (document.form1.n_index.checked == true) {
- img.style.display = "";
- advance.innerText="取消首页新闻:"
- }else{
- img.style.display = "none";
- advance.innerText="设为首页新闻:"
- }
- }
- function MM_openBrWindow(theURL,winName,features) { //v2.0
- window.open(theURL,winName,features);
- }
- //-->
- </script>
- <script language="JavaScript">
- <!--
- function Dofromsite(addfromsite)
- {
- var fromsite = document.form1.addfromsite.value;
- document.form1.fromsite.value=fromsite;
- document.form1.fromsite.focus();
- return; }
- //-->
- </script>
- <script language="javascript">
- <!--
- function na_select_form (fname, type_name)
- {
- document.forms[fname].elements[type_name].select()
- document.forms[fname].elements[type_name].focus()
- }
- function checkdata()
- {
- if (document.form1.viewhtml.checked == true)
- {
- alert("对不起,请取消“查看HTML源代码”后再添加!")
- document.form1.viewhtml.focus()
- return false
- }
- if (document.form1.n_title.value=="") {
- alert ("请输入新闻标题 !")
- return false
- }
- if (document.form1.n_author.value=="") {
- alert ("请输入新闻作者 !")
- return false
- }
- if (document.form1.n_content.value=="") {
- alert ("请输入新闻内容 !")
- return false
- }
- return true
- }
- //-->
- </script>
- <link href="style/css.css" rel="stylesheet" type="text/css">
- </head>
- <body>
- <form ACTION="yns_save.asp" METHOD="POST" name="form1" id="form1" OnSubmit="return checkdata()" onReset="return ResetForm();" >
- <table width="575" border="0" align="center" cellpadding="0" cellspacing="0">
- <tr>
- <td height="3" bgcolor="#CCCCCC"></td>
- </tr>
- </table>
- <table width="575" border="0" align="center" cellpadding="0" cellspacing="0" class="line">
- <tr>
- <td height="7" colspan="3" align="center" nowrap class="bg"></td>
- </tr>
- <tr>
- <td width="18%" height="20" align="center" nowrap>新闻类别:</td>
- <td height="20" colspan="2">
- <select style="font-family: 宋体; font-size: 9pt" name="n_tid">
- <%
- While (NOT rst.EOF)
- %>
- <option value="<%=(rst.Fields.Item("t_id").Value)%>"><%=(rst.Fields.Item("t_name").Value)%></option>
- <%
- rst.MoveNext()
- Wend
- If (rst.CursorType > 0) Then
- rst.MoveFirst
- Else
- rst.Requery
- End If
- %>
- </select> </td>
- </tr>
- <tr class="bg">
- <td width="18%" height="20" align="center" nowrap>专题类别:</td>
- <td height="20" colspan="2">
- <select style="font-family: 宋体; font-size: 9pt" name="n_sid">
- <option value="">不属于专题</option>
- <%
- While (NOT rss.EOF)
- %>
- <option value="<%=(rss.Fields.Item("s_id").Value)%>"><%=(rss.Fields.Item("s_name").Value)%></option>
- <%
- rss.MoveNext()
- Wend
- If (rss.CursorType > 0) Then
- rss.MoveFirst
- Else
- rss.Requery
- End If
- %>
- </select> </td>
- </tr>
- <tr>
- <td width="18%" height="20" align="center" nowrap>新闻模板:</td>
- <td height="20" colspan="2"> <select name="n_mid" style="font-family: 宋体; font-size: 9pt" >
- <%
- While (NOT rsm.EOF)
- %>
- <option value="<%=(rsm.Fields.Item("m_id").Value)%>"><%=(rsm.Fields.Item("m_name").Value)%></option>
- <%
- rsm.MoveNext()
- Wend
- If (rsm.CursorType > 0) Then
- rsm.MoveFirst
- Else
- rsm.Requery
- End If
- %>
- </select> </td>
- </tr>
- <tr class="bg">
- <td width="18%" height="20" align="center" nowrap>是否推荐:</td>
- <td height="20" colspan="2">
- <input type="checkbox" name="n_commend" value=true >
- </td>
- </tr>
- <tr>
- <td width="18%" height="20" align="center" nowrap><span id=advance>设为首页新闻:</span></td>
- <td height="20" colspan="2"> <input type="checkbox" name="n_index" value=true onclick=showimg()>
- </td>
- </tr>
- <tr class="bg">
- <td width="18%" height="20" align="center" nowrap>新闻标题:</td>
- <td height="20" colspan="2">
- <input style="font-family: 宋体; font-size: 9pt" type="text" name="n_title" value="" size="32">
- </td>
- </tr>
- <tr>
- <td width="18%" height="20" align="center" nowrap>新闻作者:</td>
- <td height="20" colspan="2"> <font color="#F6F6F6">
- <input style="font-family: 宋体; font-size: 9pt" type="text" name="n_author" value="" size="15">
- </font></td>
- </tr>
- </table>
- <table width="575" border="0" align="center" cellpadding="0" cellspacing="0" id="img" style="display: none">
- <tr class="bg">
- <td width="18%" height="20" align="center" nowrap>缩略图:</td>
- <td width="50%" height="20">
- <input style="font-family: 宋体; font-size: 9pt" type="text" name="n_mpic" value="" size="32">
- </td>
- <td width="32%" height="20"> <a href="#" onClick="MM_openBrWindow('yns_upload.asp?m=1','上传图片','width=300,height=100')">上传缩略图</a></td>
- </tr>
- <tr>
- <td width="18%" height="20" align="center" nowrap>真实图:</td>
- <td width="50%" height="20">
- <input style="font-family: 宋体; font-size: 9pt" type="text" name="n_rpic" value="" size="32">
- </td>
- <td width="32%" height="20"> <a href="#" onClick="MM_openBrWindow('yns_upload.asp?m=2','上传图片','width=300,height=100')">上传真实图</a></td>
- </tr>
- </table>
- <table width="575" border="0" align="center" cellpadding="0" cellspacing="0">
- <tr>
- <td>
- <!--#include file="edit.asp" -->
- <script language="javascript">
- document.write ('<iframe src="yns_tarea.asp" id="message" width="575" height="350"></iframe>')
- frames.message.document.designMode = "On";
- </script>
- </td>
- </tr>
- </table>
- <div align="center">
- <input id=Submit1 onClick="document.form1.n_content.value = frames.message.document.body.innerHTML;" type=submit name=Submit1 value="添加新闻">
- <input name="Submit2" type="reset" id="Submit2" value="清除表单">
- <input name="n_fname" type="hidden" id="n_fname3" value="<%=fname%>">
- <input name="n_date" type="hidden" id="n_date2" value="<%=now()%>">
- <input name="n_content" type="hidden" id="n_content">
- <input type="hidden" name="MM_insert" value="form1">
- </div>
- </form>
- </body>
- </html>
- <script src="edit.js" type="text/javascript"></script>
- <%
- rst.Close()
- Set rst = Nothing
- %>
- <%
- rss.Close()
- Set rss = Nothing
- %>
- <%
- rsm.Close()
- Set rsm = Nothing
- %>
English
