www.gusucode.com > 学校共青团组织网站源代码 > 学校共青团组织网站源代码/626/admin/admin_gg.asp

    <%
if Request.Cookies("admindj")="3" then
   Response.Write "<BR><BR><BR><BR><center>权限不足,你没有此功能的管理权限"
   Response.end
end if
%>
<!--#include file = admin_chk.asp -->
<!--#include file = admin_conn.asp -->
<!--#include file = titleb.asp -->
<head>
<!--#include file = language.asp -->
<%

if Request.Cookies("admindj")="2" and config("shyggsh")="0" then
   Response.Write "<BR><BR><BR><BR><center>权限不足,你没有此功能的管理权限"
   Response.end
end if
%>
<STYLE type="text/css">
<!--
a:link       {text-decoration: none; font-family: AdobeSm; color: #000000 }
a:visited    {text-decoration: none; color: #000000 }
A:hover      {COLOR: green; FONT-FAMILY: "宋体,MingLiU"; TEXT-DECORATION: underline}
body         {font-size: 9pt; font-family: 宋体,MingLiU, Arial;color: #000000}
TD           {FONT-SIZE: 9pt; FONT-FAMILY: "宋体,MingLiU, Arial";color: #000000;table-layout:fixed;word-break:break-all}
p            {FONT-SIZE: 9pt; FONT-FAMILY: "宋体,MingLiU, Arial";color: #000000}
input        {FONT-SIZE: 9pt; FONT-FAMILY: "宋体,MingLiU, Arial";color: #000000}
body         {margin-top: 0; margin-bottom: 0;margin-left:0;margin-right:0; color: #000000}
select       {FONT-SIZE: 9PT;}
option       {FONT-SIZE: 9pt;}
textarea     {FONT-SIZE: 9pt;}
-->
</STYLE>
</head>
<body bgcolor="#F7F7F7">
<%


editid=trim(Request("editid"))
saveid=trim(Request("saveid"))
delid=trim(Request("delid"))
title=Request("title")
content=Request("content")
addtime=date()

if editid<>"" and trim(Request("title"))="" and trim(Request("content"))="" then
  Set rs = Server.CreateObject("ADODB.RecordSet")
  rs.Open "select * from [webgg] where id="&clng(editid),conn,1,1
  if rs.recordcount<>0 then
     edittitle=rs("title")
     editcontent=rs("content")
  end if
  rs.close
  set rs=nothing
elseif saveid="" and trim(Request("title"))<>"" and trim(Request("content"))<>"" then
     conn.Execute "insert into [webgg] ([title],[content],[addtime],[adduser]) values('"&title&"','"&content&"','"&addtime&"','"&session("admin__user")&"')"   
     Response.Redirect "admin_gg.asp"
elseif saveid<>"" and trim(Request("title"))<>"" and trim(Request("content"))<>"" then
   conn.Execute "update [webgg] set title='"&title&"',content='"&content&"' where id="&clng(saveid)
   Response.Redirect "admin_gg.asp"
elseif delid<>"" then
   conn.Execute "delete from [webgg] where ID="&CInt(delid)
end if
%>
<div align="center">
	 <p>添加公告</p>
	<div align="center">
		<table border="0" cellpadding="0" cellspacing="0" width="700" id="table2">
			<tr>
				<td>
				<!--webbot BOT="GeneratedScript" PREVIEW=" " startspan --><script Language="JavaScript" Type="text/javascript"><!--
function FrontPage_Form1_Validator(theForm)
{

  if (theForm.title.value == "")
  {
    alert("请在 公告标题 域中输入值。");
    theForm.title.focus();
    return (false);
  }

  if (theForm.title.value.length < 1)
  {
    alert("在 公告标题 域中,请至少输入 1 个字符。");
    theForm.title.focus();
    return (false);
  }

  if (theForm.title.value.length > 200)
  {
    alert("在 公告标题 域中,请最多输入 200 个字符。");
    theForm.title.focus();
    return (false);
  }

  if (theForm.content.value == "")
  {
    alert("请在 公告内容 域中输入值。");
    theForm.content.focus();
    return (false);
  }

  if (theForm.content.value.length < 1)
  {
    alert("在 公告内容 域中,请至少输入 1 个字符。");
    theForm.content.focus();
    return (false);
  }
  return (true);
}
//--></script><!--webbot BOT="GeneratedScript" endspan --><form method="POST" action="admin_gg.asp?saveid=<%=editid%>" name="FrontPage_Form1" onsubmit="return FrontPage_Form1_Validator(this)" language="JavaScript">
					<div align="center">
						<table border="1" cellpadding="5" width="700" id="table3" style="border-collapse: collapse" bordercolor="#C0C0C0">
							<tr>
								<td width="90" align="center" background="../images/bj3.jpg">公告标题</td>
								<td width="587" background="../images/bj3.jpg">
								&nbsp;<!--webbot bot="Validation" s-display-name="公告标题" b-value-required="TRUE" i-minimum-length="1" i-maximum-length="200" --><input type="text" name="title" size="61" value="<%=edittitle%>" maxlength="200"></td>
							</tr>
							<tr>
								<td width="90" align="center" background="../images/bj6.jpg" height="94">公告内容</td>
								<td width="587" background="../images/bj6.jpg" height="94">
								&nbsp;<!--webbot bot="Validation" s-display-name="公告内容" b-value-required="TRUE" i-minimum-length="1" --><textarea rows="5" name="content" cols="90"><%=editcontent%></textarea></td>
							</tr>
						</table>
					</div>
					<p align="center"><input type="submit" value="保存" name="B1">    <input type="reset" value="重置" name="B2"></p>
				</form>
				<p> </td>
			</tr>
		</table>
	</div>
	<table border="1" cellpadding="3" cellspacing="0" width="700" id="table1" style="border-collapse: collapse" bordercolor="#C0C0C0">
		<tr>
			<td background="../images/bj5.jpg" width="557" align="center" height="25">
			<font color="#FFFFFF">公  告</font></td>
			<td background="../images/bj5.jpg" width="128" align="center" height="25">
			<font color="#FFFFFF">操 作</font></td>
		</tr>
		<%
		Set rs = Server.CreateObject("ADODB.RecordSet")
		rs.Open "select * from [webgg] order by id desc",conn,1,1
		
		if rs.recordcount<>0 then
		
		page=int(request("page"))
		rs.PageSize=10
		pagecount=rs.pagesize
		if page<=0 then page=1
		if request("page")="" then page=1
		rs.AbsolutePage=page
		
		for k=1 to pagecount
		%>
		<tr>
			<td width="557"><font color="#666666">(编号:<%=rs("id")%>)</font><%=titleb(rs("title"),50)%><br>
			<font color="#ff0000">调用代码:&lt;script language=&quot;javascript&quot; src=&quot;<%=finddir(request.servervariables("URL"))%>ggjs.asp?id=<%=rs("id")%>&ttt=1&quot;&gt;&lt;/script&gt;</font></td>
			<td width="128" align="center">
			<p align="center"><a href="admin_gg.asp?editid=<%=rs("ID")%>">修改</a> <a onclick='{if(confirm("您确定删除吗?此操作将不能恢复!")){return true;}return false;}' href="admin_gg.asp?delid=<%=rs("id")%>">删除</a></td>
		</tr>
		<%
		rs.movenext
		if rs.eof then exit for
		next
		else
		  Response.Write "<tr><td colspan=2>暂无公告</td></tr>"
		end if
		
		%>
		</table>
</div><BR>
<center>
<%if rs.recordcount<>0 then
  if page>1 then
    response.write "<a href="&request.servervariables("URL")&"?page=1>首页</a> "
    response.write "<a href="&request.servervariables("URL")&"?page="&page-1&">上一页</a> "
  end if
  if page<rs.pagecount then
    response.write "<a href="&request.servervariables("URL")&"?page="&page+1&">下一页</a> "
    response.write "<a href="&request.servervariables("URL")&"?page="&rs.pagecount&">尾页</a> "
  end if
    response.write "共"&rs.recordcount&"条 每页显示"&pagecount&"条 共"&rs.pagecount&"页 "
  %>
  <script language="JavaScript">
  <!--
  function FP_jumpMenu(el,frm,sel) {//v1.0
    var href=el.options[el.selectedIndex].value; if(sel) el.selectedIndex=0;
    if('_new'==frm) open(href); else eval(frm+".location='"+href+"'");
    }
    // -->
  </script>
  <select size="1" onchange="FP_jumpMenu(this,'window',false)" id="id1" name="D1" style="font-size: 9pt; border-style: solid; border-width: 1px">
   <%for i=1 to rs.pagecount%>
   <option value="<%=request.servervariables("URL")%>?page=<%=i%>" <%if page=i then response.write "selected"%> style="font-size: 9pt">第<%=i%>页</option>
    <%next%>
   </select>
<%end if%>
</center><BR>
<div align="center">
	<table border="1" cellpadding="3" width="700" id="table4" style="border-collapse: collapse" bordercolor="#C0C0C0">
		<tr>
			<td>滚动的公告调用代码:(如果调用所有公告,编号为空或者等于0[id=0]即可)<br>
			&lt;marquee direction=&quot;up&quot; scrollamount=&quot;2&quot; scrolldelay=&quot;120&quot; 
			height=&quot;145&quot;&gt;&lt;script language=&quot;javascript&quot; src=&quot;<%=finddir(request.servervariables("URL"))%>ggjs.asp?id=<font color="#0000FF">编号</font>&amp;ttt=1&quot;&gt;&lt;/script&gt;&lt;/marquee&gt;<p>
			ttt=1    显示标题和内容全部信息,如果ttt=0那么只显示内容,其它不显示。ttt=2,只显示标题。ttt=4,横向显示。</td>
		</tr>
	</table>
</div>

<%
rs.close
set rs=nothing
conn.close
set conn=nothing
%>