📄 yns_updata.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="Connections/conn_news.asp" -->
<%
' *** Restrict Access To Page: Grant or deny access to this page
MM_authorizedUsers="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
%>
<%
Dim rsn__MMColParam
rsn__MMColParam = "1"
If (Request.QueryString("n_id") <> "") Then
rsn__MMColParam = Request.QueryString("n_id")
End If
%>
<%
Dim rsn
Dim rsn_numRows
Set rsn = Server.CreateObject("ADODB.Recordset")
rsn.ActiveConnection = MM_conn_news_STRING
rsn.Source = "SELECT * FROM t_news WHERE n_id = " + Replace(rsn__MMColParam, "'", "''") + ""
rsn.CursorType = 0
rsn.CursorLocation = 2
rsn.LockType = 1
rsn.Open()
rsn_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>招生就业管理系统1.0版</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_upsave.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 bgcolor="#CCCCCC">
<td height="3" colspan="3" align="center" nowrap></td>
</tr>
<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" class="input">
<%
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" class="input">
<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 style="font-family: 宋体; font-size: 9pt" name="n_mid" class="input">
<%
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="<%=(rsn.Fields.Item("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="<%=(rsn.Fields.Item("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="<%=(rsn.Fields.Item("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="<%=(rsn.Fields.Item("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?action=modify&n_id=<%=request("n_id")%>" id="message" width="575" height="350"></iframe>')
frames.message.document.designMode = "On";
</script>
</td>
</tr>
</table>
<div align="center">
<input type="hidden" name="MM_update" value="form1">
<input type="hidden" name="MM_recordId" value="<%= rsn.Fields.Item("n_id").Value %>">
<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">
</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
%>
<%
rsn.Close()
Set rsn = Nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -