⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 editnews.asp

📁 北方供求 V3.3 Sql 版 §V3.3更新功能 1、首页(自动生成静态
💻 ASP
字号:
<!--#Include file="../Common/Inc_DatConn.asp"-->
<!--#Include file="Common/Inc_Config.asp"-->
<!--#Include file="Common/Inc_Function.asp"-->
<%
'┌─  风云ASP在线  ────────────────────────┐
'│                                                                 │
'│  作者:赵振波.	http://www.fyasp.com	    				    │
'│                                                                 │
'│   Q Q:176189168  										   	    │
'│                                                                 │
'│ Email:fy96@163.com                                             │
'│                                                                 │
'│ 程序定做,系统开发,网站制作,提供高质量的网络产品、技术和服务!│
'│                                                                 │
'│【版权声明】                                                     │
'│                                                                 │
'│     本程序版权归坐看风云所有,未经授权擅自修改、复制或散布本程序│
'│                                                                 │
'│的部分或全部,将承受严厉的民事和刑事处罚,对已知的违反者将给予法 │
'│                                                                 │
'│律范围内的全面制裁。对非法使用此程序所造成的一切后果本人概不负责!│
'│                                                                 │
'└───────────────────  http://www.fyasp.com ──┘
%>
<%if IsTimeOut(Session("strAccount"),Session("strPassWord")) then Response.Redirect "index.asp"%>
<html>
<head>
<title><% = strSiteName%> - 网站后台管理系统</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="Common/Site.css" type="text/css">
<script language="javascript">
//检验表单的合法性
function CheckForm() {
	if (document.AddForm.Topic.value == "") {
		alert("\新闻标题不能为空!");
		document.AddForm.Topic.focus();
	}
	else if (document.AddForm.Content.value == "") {
		alert("\新闻内容不能为空");
		document.AddForm.Content.focus();
	}
	else {
        return true;
    }
    return false;
}
// End of validation form script -->
</script>
<script language="javascript">
function AddPhoto() {
	popupWin = window.open('Oper.asp?Oper=AddPhoto','','width=300,height=160,scrollbars=no')
}
</script>
</head>

<body leftMargin="0" topMargin="2">
<!--#Include file="Common/inc_Top.asp"-->
<table width="750" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr> 
    <td width="105" valign="top" style="border-left: 1px solid rgb(0,0,0); border-right: 1px solid rgb(0,0,0)" class="bottom"><br>
	<!--#Include file="Common/Inc_Button.asp"-->
    </td>
    <td valign="top" style="border-right: 1px solid rgb(0,0,0)" align="center" class="banma2">
        <table width="96%" border="0" cellspacing="0" cellpadding="0" align="center">
          <tr> 
            <td height="50">当前位置:<a href="Main.asp">管理首页</a> -&gt; <a href="NewsMgr.asp">新闻管理</a> -&gt; 新闻更新</td>
          </tr>
        </table>
<%
if UCase(Request.Form("Oper")) = "EDITNEWS" then
	Dim rdsEditNews
	Dim sqlEditNews
	Dim strFileName
	
	strFileName = Request.Form("FileName")
	if strFileName <> Request.Form("PhotoName") then
		Dim fso
		set fso = CreateObject("Scripting.FileSystemObject")
		fso.DeleteFile Server.MapPath(strUploadNewsPhotoUrl & strFileName)
		set fso = nothing
	end if
	
	set rdsEditNews = Server.CreateObject("ADODB.Recordset")
	sqlEditNews = "Select * From Dat_News Where NewsKey = "& Request("Id")
	rdsEditNews.Open sqlEditNews,Conn,3,3
	
	rdsEditNews("NewsClass") = Request.Form("NewsClass")
	rdsEditNews("Topic") = Request.Form("Topic")
	rdsEditNews("From") = Request.Form("From")
	rdsEditNews("Content") = dvHTMLEncode(Request.Form("Content"))
	rdsEditNews("PhotoName") = Request.Form("PhotoName")
	rdsEditNews.Update
	rdsEditNews.Close
	set rdsEditNews = nothing
	
	strMsgTitle = "新闻更新"
	strError = False
	strMsg	= "新闻更新成功..."
	strGoFile = "NewsMgr.asp"
	Call ShowMessage()	
else
	Dim rdsNews
	Dim sqlNews
	Dim intNewsKey
	
	intNewsKey = Request("Id")
	if intNewsKey = "" then intNewsKey = 0
	
	set rdsNews = Server.CreateObject("ADODB.Recordset")
	sqlNews = "Select * From Dat_News Where NewsKey = "& intNewsKey
	rdsNews.Open sqlNews,Conn,1,1
	if not rdsNews.EOF then
%>   
	    <table border="0" width="96%" cellspacing="0" cellpadding="0" align="center">
	      <tr>
	        <td width="100%" class="booktable">
			<table border="0" width="100%" cellspacing="1" cellpadding="2">
			  <form method="post" action="EditNews.asp" name="AddForm" OnSubmit="return CheckForm()">
			  <input type="hidden" name="Oper" value="EditNews">
			  <input type="hidden" name="Id" value="<% = Request.QueryString("Id")%>">
			  <input type="hidden" name="FileName" value="<% = rdsNews("PhotoName")%>">
			  <tr>
			    <td width="20%" height="25" class="bottom" align="right">新闻类别:</td>
			    <td width="80%" height="25" class="banma1">
			    &nbsp;<select size="1" name="NewsClass" class="face">
				  <option value="1" <%if rdsNews("NewsClass") = "1" then Response.Write "selected"%>>本站公告</option>
				  <option value="2" <%if rdsNews("NewsClass") = "2" then Response.Write "selected"%>>行业新闻</option>
				</select>
			    </td>
			  </tr>
			  <tr>
			    <td width="20%" height="25" class="bottom" align="right">标题:</td>
			    <td width="80%" height="25" class="banma2">&nbsp;<input type="text" name="Topic" size="60" class="face" value="<% = rdsNews("Topic")%>">&nbsp;<font color="#FF0000">**</font></td>
			  </tr>
			  <tr>
			    <td width="20%" height="25" class="bottom" align="right">来自:</td>
			    <td width="80%" height="25" class="banma1">&nbsp;<input type="text" name="From" size="25" class="face" value="<% = rdsNews("From")%>"></td>
			  </tr>
			  <tr>
			    <td width="20%" height="25" class="bottom" align="right">内容:</td>
			    <td width="80%" height="25" class="banma2" align="center" valign="top">
				<table border="0" width="97%" cellspacing="0" cellpadding="0">
				  <tr>
				    <td width="100%">
            		<textarea rows="13" name="Content" cols="68" class="face"><%=bbHTMLDecode(rdsNews("Content"))%></textarea></td>
				  </tr>
				</table>			    
			    </td>
			  </tr>
			  <tr>
			    <td width="20%" height="25" class="bottom" align="right"></td>
			    <td width="80%" height="25" class="banma2">&nbsp;<input type="submit" value="更 新" name="Submit" class="button">&nbsp;&nbsp;&nbsp;&nbsp;<input type="reset" value="取 消" name="Reset" class="button"></td>
			  </tr>
			  </form>
			</table>			
	      </td>
		</tr>
	  </table>
<%
	end if
	rdsNews.Close
	set rdsNews = nothing
end if
%>	  
      <br>
    </td>
  </tr>
</table>
<!--#Include file="Common/Inc_Bottom.asp"-->
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -