📄 essay.asp
字号:
<%@ Language=VBScript %>
<!--#include file="connect.asp"-->
<%
if session("adminok")="" then
response.redirect "login.asp"
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>玉环人大</title>
<script language=javascript src="../yuhuan.js"></script>
<link rel="stylesheet" type="text/css" href="../yuhuan.css">
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
-->
</style></head>
<%
const MaxPerPage=13
dim totalPut
dim CurrentPage
dim TotalPages
dim i,j
if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if
if trim(request("column"))<>"" then
column=request("column")
else
column="村庄简介"
end if
if trim(request("subcolumn"))<>"" then
subcolumn=request("subcolumn")
else
subcolumn="─"
end if
%>
<body bgcolor="#FFFFFF" onMouseMove=HideMenu();>
<div align="center"><center>
<font face="Verdana, Arial, Helvetica">
<table width="771" height="90" border="0" align="center" cellpadding="0" cellspacing="0" background="../images/top.gif" class="9v">
<tr>
<td width="26%" height="51" align="right" valign="bottom" ><img src="../images/log1.gif" width="124" height="28" vspace="3">
</td>
<td width="74%" align="center" > </td>
</tr>
<tr>
<td width="26%" align="right" class="white11v" ><font face="Verdana, Arial, Helvetica">www.yuhuanrd.gov.cn </font></td>
<form name="lanmu">
<td align="center" class="white11v" ><a href="http://www.yuhuanrd.gov.cn"><font color="#ffffff">本站首页</font></a> | <a href="essay.asp"><font color="#ffffff">文章管理</font></a> | <a href="column.asp"><font color="#ffffff">栏目管理</font></a> | <a href="javascript:popupload()"><font color="#ffffff">文件上传</font></a> | <a href="javascript:popchangepass()"><font color="#ffffff">修改密码</font></a> | <a href="mail.asp"><font color="#ffffff">留言管理</font></a> | FAQ </td>
</form>
</tr>
<tr>
<td valign="top" colspan="2" height="1" ></td>
</tr>
</table>
<br>
</font>
<table width="771" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="right" class="9V">相关栏目:
<select name="columns" size="1" onChange="top.location=this.options[selectedIndex].value" class="9v" >
<%dim sqlStr
sqlStr="select fldcolumn,fldpriviledge from tblcolumn where fldsubcolumn='—' order by fldpriviledge"
Set rs_column = Server.CreateObject("ADODB.Recordset")
rs_column.open sqlStr,dataConn,1,1
do while not rs_column.eof
if column=trim(rs_column("fldcolumn")) then
selected = "selected"
else
selected = ""
end if
response.write "<option value='essay.asp?column=" & trim(rs_column("fldcolumn")) & "'" & selected & ">" & trim(rs_column("fldcolumn")) & "</option>"
rs_column.movenext
loop
rs_column.close
set rs_column=nothing
%>
</select>
子栏目:
<select name="subcolumns" size="1" onChange="top.location=this.options[selectedIndex].value" class="9v" >
<option selected value="essay.asp">────</option>
<%
sqlStr="select fldsubcolumn from tblcolumn where fldsubcolumn<>'—' and fldcolumn='" & column & "'"
Set rs_subcolumn = Server.CreateObject("ADODB.Recordset")
rs_subcolumn.open sqlStr,dataConn,1,1
do while not rs_subcolumn.eof
if subcolumn=trim(rs_subcolumn("fldsubcolumn")) then
selected = "selected"
else
selected = ""
end if
response.write "<option value='essay.asp?column=" & column & "&subcolumn=" & trim(rs_subcolumn("fldsubcolumn")) & "' " & selected & ">" & trim(rs_subcolumn("fldsubcolumn")) & "</option>"
rs_subcolumn.movenext
loop
rs_subcolumn.close
set rs_subcolumn=nothing
%>
</select>
</td>
</tr>
<tr>
<td class="9V"><table border="0" width="755" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" bgcolor="#000000" >
<div align="center">
<%
sqlStr="select id,fldorder,fldtopic,fldphoto,fldurl,fldhits,flddate from tblessay where fldcolumn='" & column & "' and fldsubcolumn='" & subcolumn & "' order by fldorder desc"
Set rs_essay = Server.CreateObject("ADODB.Recordset")
rs_essay.open sqlStr,dataConn,1,1
'if rs_essay.eof and rs_essay.bof then
'response.write "<span class=white9v> 还 没 有 任 何 内 容</span>"
'else
totalPut=rs_essay.recordcount
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
if currentPage=1 then
showContent
showpage totalput,MaxPerPage,"essay.asp"
else
if (currentPage-1)*MaxPerPage<totalPut then
rs_essay.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs_essay.bookmark
showContent
showpage totalput,MaxPerPage,"essay.asp"
else
currentPage=1
showContent
showpage totalput,MaxPerPage,"essay.asp"
end if
end if
rs_essay.close
'end if
set rs_essay=nothing
dataConn.close
set dataConn=nothing
sub showContent
dim i
i=0
%>
<div align="center">
<center>
<table border="0" cellspacing="1" width="100%" cellpadding="5" class=9v height="100%" >
<tr bgcolor="#d10000">
<td width="100" height="21" align="center" class="white9v">日期</td>
<td width="200" height="21" align="center" class="white9v">文章标题</td>
<td width="100" height="21" align="center" class="white9v">URL</td>
<td width="100" height="21" align="center" class="white9v">图片</td>
<td width="60" height="21" align="center" class="white9v">顺序</td>
<td width="45" height="21" align="center" class="white9v">内容</td>
<td width="45" height="21" align="center" class="white9v">删除</td>
</tr>
<form name="updateForm" method="post" action="saveEssay.asp?column=<%=column%>&subcolumn=<%=subcolumn%>">
<%do while not rs_essay.eof%>
<tr>
<td height="23" width="100" align="center" bgcolor="#EDEFEF"><%=Formatdatetime(rs_essay("flddate"),vbshortdate)%></td>
<td width="200" align="center" bgcolor="#FFFFFF">
<input type="text" name=<%="topic" & i%> class="textboxface" size="27" value='<%=trim(rs_essay("fldtopic"))%>'>
</td>
<td width="100" align="center" bgcolor="#FFFFFF">
<input name=<%="url" & i%> type="text" class="textboxface" id="<%="url" & i%>" value='<%=trim(rs_essay("fldurl"))%>' size="12">
</td>
<td width="100" align="center" bgcolor="#FFFFFF" onDblClick="javascript:popphoto(<%=rs_essay("id")%>,'<%=rs_essay("fldphoto")%>')">
<input type="text" name=<%="photo" & i%> class="textboxface" size="16" value='<%=trim(rs_essay("fldphoto"))%>'>
</td>
<td width="60" align="center" bgcolor="#EDEFEF"><input name=<%="order" & i%> type="text" class="textboxface3" id="<%="order" & i%>" value='<%=trim(rs_essay("fldorder"))%>' size="6"></td>
<td width="45" align="center" bgcolor="#EDEFEF"> <a href="javascript:popwin(<%=rs_essay("id")%>,'essay')"> <img src="../Images/modify.gif" width="13" height="14" border="0"></a></td>
<td width="45" align="center" bgcolor="#FFFFFF"><a href="delete.asp?id=<%=rs_essay("id")%>&dbname=essay&backpage=<%=currentPage%>&column=<%=column%>&subcolumn=<%=subcolumn%>">×</a></td>
</tr>
<% i=i+1
if i>=MaxPerPage then
exit do
end if
rs_essay.movenext
loop
%>
<tr>
<td height="23" width="100" align="center" bgcolor="#EDEFEF"> </td>
<td colspan="3" align="center" bgcolor="#FFFFFF">请在下面的单元格中输入要添加的记录</td>
<td width="60" align="center" bgcolor="#EDEFEF"> </td>
<td width="45" align="center" bgcolor="#EDEFEF">
<input type="reset" name="reset" value="恢复" class="button">
</td>
<td width="45" align="center" bgcolor="#FFFFFF">
<input type="hidden" name="mode" value="更改">
<input type="submit" name="submit" value="更改" class="button">
<input type="hidden" name="number" value="<%=i%>">
<input type="hidden" name="page" value="<%=currentPage%>">
</td>
</tr>
</form>
<tr>
<td height="23" width="100" align="center" bgcolor="#EDEFEF"><%=Formatdatetime(date(),vbshortdate)%></td>
<form name="addForm" method="post" action="saveEssay.asp?column=<%=column%>&subcolumn=<%=subcolumn%>">
<td width="200" align="center" bgcolor="#FFFFFF">
<input type="text" name="topic"class="textboxface" size="27">
</td>
<td width="100" align="center" bgcolor="#FFFFFF">
<input name="url" type="text" class="textboxface" id="url2" size="12"></td>
<td width="100" align="center" bgcolor="#FFFFFF">
<input type="text" name="photo" class="textboxface" size="16">
</td>
<td width="60" align="center" bgcolor="#EDEFEF"> <input name=order type="text" class="textboxface3" id="<%="priviledge" & i%>" size="6"></td>
<td width="45" align="center" bgcolor="#EDEFEF">
<input type="reset" name="Reset" value="清除" class="button">
</td>
<td width="45" align="center" bgcolor="#FFFFFF">
<input type="submit" name="submit" value="追加" class="button">
<input type="hidden" name="mode" value="追加">
<input type="hidden" name="page" value="<%=currentPage%>">
</td>
</form>
</tr>
</table>
</center>
</div>
</div></td>
</tr>
<tr>
<td width="100%" align="center" >
<%
end sub
function showpage(totalnumber,maxperpage,filename)
dim n
if totalnumber mod maxperpage=0 then
n= totalnumber \ maxperpage
else
n= totalnumber \ maxperpage+1
end if
response.write "<form method=Post action="&filename&">"
response.write "<p align='center'><a href=#><acronym title='修改后请按更改键,否则数据库不会被更新!'><font color='red' style='font-size:9pt'>重要说明</font></acronym></a> "
if CurrentPage<2 then
response.write "<font style='font-size:9pt'>首页 上一页</font> "
else
response.write "<a href=" & filename & "?page=1&" & "column=" & column & "><font style='font-size:9pt'>首页</font></a> "
response.write "<a href=" & filename & "?page=" & CurrentPage-1 & "&column=" & column & "&subcolumn=" & subcolumn & "><font style='font-size:9pt'>上一页</font></a> "
end if
if n-currentpage<1 then
response.write "<font style='font-size:9pt'>下一页 尾页</font>"
else
response.write "<a href="&filename&"?page="&(CurrentPage+1)& "&column=" & column & "&subcolumn=" & subcolumn & ">"
response.write "<font style='font-size:9pt'>下一页</font></a> <a href="&filename&"?page="&n&"&column=" & column &"&subcolumn=" & subcolumn &"><font style='font-size:9pt'>尾页</font></a>"
end if
response.write "<font style='font-size:9pt'> 页次:</font><strong><font color=red style='font-size:9pt'>"&CurrentPage&"</font><font style='font-size:9pt'>/"&n&"</strong>页</font> "
response.write "<font style='font-size:9pt'> 共<b>"&totalnumber&"</b>条记录 <b>"&maxperpage&"</b>条记录/页</font> "
response.write " <font style='font-size:9pt'>转到:</font><input type='text' name='page' size=4 maxlength=10 class=9v value="¤tpage&">"
response.write "<input class=button type='submit' value='Go>>' name='cndok'></span></p></form>"
end function
%>
</td>
</tr>
</table>
<br>
<br>
<table width=755 height="21" border=0 cellpadding="0" cellspacing = "0" class="9v">
<tr valign="middle">
<td height="24" align=center nowrap bgcolor="#d10000" class="white9v">© 2004 版权所有 玉环人大 All Rights Reserved </td>
</tr>
</table> </td>
</tr>
</table>
</center>
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -