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

📄 affiche_manage.asp

📁 这是一个ASP+VBScript+Access开发的网上家园源程序
💻 ASP
字号:
<!--#include file="connect.asp" -->
<!--#include file="..\include\nosqlin.asp" -->
<%if request.Cookies("admin") <> "1" then response.redirect "index.asp"%>
<html>
<head>
<BASE onmouseover=window.status="<%=Unit%>个人主页空间——您理想的网上家园!";return true>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title><%=Unit%>>><%=softname%>>>公告管理</title>
<style type="text/css">
<!--
a:link {
	color: #333333;text-decoration:none
}
a:visited {
	color: #666666;text-decoration:none
}
a:active {
	color: #999999;text-decoration:none
}
A:hover {
	color: #FF0000;text-decoration:underline
	}
-->
</style>
<SCRIPT LANGUAGE=javascript>
<!--
function Juge(formaffiche)
{
if (document.formaffiche.title.value == "")
	{
		alert("标题不能为空!");
		document.formaffiche.title.focus();
		return (false);
	}
if (document.formaffiche.contents.value == "")
	{
		alert("内容不能为空!");
		document.formaffiche.contents.focus();
		return (false);
	}
}
-->
</Script>
</head>

<body bgcolor="#E1EBF4" style="font-size: 9pt">
<%
act=request("act")
if act="DEL" then
strSQL= "delete from affiche where id="&request("id")
objCnn.Execute(strSQL)
end if

if request("act0")="MOD" then
strSQL = "update affiche set title = '" & request("title") & "', contents='"&Request("contents")&"' where id = "&Request("id")
objCnn.Execute(strSQL)
end if

if request("act0")="ADD" then
'strSQL = "update affiche set title = '" & request("title") & "', contents='"&Request("contents")&"' where id = "&Request("id")
strSQL = "insert into affiche(title, contents, adddate) values ('" & request("title") & "','" &Request("contents")& "','" & date & "')"
objCnn.Execute(strSQL)
end if

strSQL= "select * from affiche"
set rs = objCnn.Execute(strSQL)
%>
<div align="center">
  <center>
  <table border="0" width="80%" style="font-size: 9pt; border: 1 solid #008080" height="131" cellspacing="0" cellpadding="0">
    <tr>
      <td width="100%" colspan="4" height="57" style="border-bottom: 1 solid #008080">
        <p align="center"><font size="4" color="#008080"><b>公告管理</b></font></td>
    </tr>
    <tr>
      <td width="7%" align="center" height="22">序号</td>
      <td width="27%" align="center" height="22" style="border-left: 1 solid #008080; border-right: 1 solid #008080">标题</td>
      <td width="47%" align="center" height="22" style="border-right: 1 solid #008080">内容</td>
      <td width="19%" align="center" height="22">操作</td>
    </tr>
<%if not rs.eof then%>
<%i=1%>
<%do while not rs.eof%>
    <tr>
      <td width="7%" style="border-top: 1 solid #008080" align="center"><%=i%></td>
      <td width="27%" style="border-left: 1 solid #008080; border-right: 1 solid #008080; border-top: 1 solid #008080"> <%=rs("title")%></td>
      <td width="47%" style="border-right: 1 solid #008080; border-top: 1 solid #008080">  <%=rs("contents")%></td>
      <td width="19%" style="border-top: 1 solid #008080" align="center"><a href="?act=MOD&id=<%=rs("id")%>">修改</a> <a href="affiche_manage.asp?act=DEL&id=<%=rs("id")%>">删除</a></td>
    </tr>
<%rs.movenext%>
<%i=i+1%>
<%loop%>
<%else%>
	<tr><td colspan="4" style="border-top: 1 solid #008080">目前没有公告</td></tr>
<%end if%>
  </table>
  </center>
</div>
<%
act0="ADD"
if act="MOD" then
strSQL= "select * from affiche where id="&request("id")
set rs = objCnn.Execute(strSQL)
id=rs("id")
title=rs("title")
contents=rs("contents")
act0="MOD"
end if
%>

<div align="center">
  <center>
  <form name=formaffiche method="POST" action="affiche_manage.asp"  onSubmit="return Juge(this)">
  <table border="0" width="80%" style="font-size: 9pt; border: 1 solid #008080">
    <tr>
      <td width="34%" height="39" valign="bottom">
        <p align="right">添加新公告:</td>
      <td width="66%" height="39" valign="bottom"></td>
    </tr>
    <tr>
      <td width="35%" height="23" align="right">标题:</td>
      <td width="65%" height="23"><input type="text" name="title" size="48" value="<%=title%>"></td>
    </tr>
    <tr>
      <td width="35%" height="60" align="right" valign="top">内容:</td>
      <td width="65%" height="60"><textarea rows="2" name="contents" cols="47"><%=contents%></textarea></td>
    </tr>
    <tr>
      <td width="100%" height="28" align="right" valign="top" colspan="2">
        <p align="center"><input type="submit" value="确定" name="B1"> <input type="reset" value="重写" name="B2"></td>  
    </tr>
  </table><input type="hidden" name="act0" value="<%=act0%>"><input type="hidden" name="id" value="<%=id%>"></form>
  </center>
</div>

</body>

</html>

⌨️ 快捷键说明

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