📄 column.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"> </td>
</tr>
<tr>
<td class="9V"><table border="0" width="755" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" bgcolor="#000000" >
<div align="center">
<%
if request("column")="" then
sqlStr="select * from tblcolumn where fldsubcolumn='—' order by fldpriviledge"
else
sqlStr="select * from tblcolumn where fldcolumn='" & request("column") & "' and fldsubcolumn<>'—' order by id"
end if
Set rs = Server.CreateObject("ADODB.Recordset")
rs.open sqlStr,dataConn,1,1
if rs.eof and rs.bof then
'response.write "<span class=white9v> 还 没 有 任 何 内 容</span>"
showContent
showpage 0,MaxPerPage,"column.asp"
else
priviledge = rs("fldpriviledge")
totalPut=rs.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,"column.asp"
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showContent
showpage totalput,MaxPerPage,"column.asp"
else
currentPage=1
showContent
showpage totalput,MaxPerPage,"column.asp"
end if
end if
rs.close
end if
set rs=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" class="white9v">
<td width="45" height="20" align="center">序号</td>
<td width="140" align="center">栏目名称</td>
<td width="80" align="center">模板</td>
<td width="70" align="center">显示顺序</td>
<td width="100" align="center">子栏目</td>
<td width="80" align="center">URL</td>
<td width="72" align="center">图片</td>
<td width="60" align="center">删除</td>
</tr>
<form method="post" action="saveColumn.asp?column=<%=request("column")%>">
<%do while not rs.eof%>
<tr>
<td height="23" width="45" align="center" bgcolor="#EDEFEF"> <%=trim(rs("id"))%></td>
<td width="140" align="center" bgcolor="#FFFFff">
<input name=<%="column" & i%> type="text" class="textboxface" id="<%="column" & i%>" value='<%=trim(rs("fldcolumn"))%>' size="15"></td>
<td width="60" align="center" bgcolor="#FFFFff"><input name=<%="template" & i%> type="text" class="textboxface" id="<%="template" & i%>" value='<%=trim(rs("fldtemplate"))%>' size="13"></td>
<td width="70" align="center" bgcolor="#EDEFEF"><input name=<%="priviledge" & i%> type="text" class="textboxface3" id="<%="privilege" & i%>" value='<%=trim(rs("fldpriviledge"))%>' size="12"></td>
<td width="100" align="center" bgcolor="#EDEFEF">
<%
if request("column")="" then
response.write "<a href='column.asp?column=" & trim(rs("fldcolumn")) & "'><acronym title='点击显示子栏目'>—</acronym></a>"
response.write "<input name='subcolumn" & i & "' type='hidden' class='textboxface' value='" & trim(rs("fldsubcolumn")) & "' size=12>"
else
%>
<input name="<%="subcolumn" & i%>" type="text" class="textboxface3" value='<%=trim(rs("fldsubcolumn"))%>' size="12">
<%end if%> </td>
<td width="80" align="center" bgcolor="#ffffff">
<input name="<%="url" & i%>" type="text" class="textboxface" value='<%=trim(rs("fldurl"))%>' size="12"> </td>
<td width="72" align="center" bgcolor="#EDEFEF" onDblClick="javascript:popphoto(<%=rs("id")%>)">
<input name="<%="image" & i%>" type="text" class="textboxface1" value='<%=trim(rs("fldimage"))%>' size="12"></td>
<td width="60" align="center" bgcolor="#FFFFff"><a href="delete.asp?id=<%=rs("id")%>&dbname=column&backpage=<%=currentPage%>&column=<%=request("column")%>">×</a></td>
</tr>
<% i=i+1
if i>=MaxPerPage then
exit do
end if
rs.movenext
loop
%>
<tr>
<td height="23" width="45" align="center" bgcolor="#EDEFEF"> </td>
<td colspan="5" align="center" bgcolor="#FFFFff">请在下面的单元格中输入要添加的记录</td>
<td width="72" align="center" bgcolor="#EDEFEF">
<input type="reset" name="reset" value="恢复" class="button"> </td>
<td width="60" align="center" bgcolor="#EDEFEF">
<input type="hidden" name="mode" value="更改">
<input type="submit" name="submit" value="更改" class="button">
<input type="hidden" name="number" value="<%=i%>">
<input name="page" type="hidden" id="page" value="<%=currentPage%>"> </td>
</tr>
</form>
<tr>
<td height="23" width="45" align="center" bgcolor="#EDEFEF"> </td>
<form name="addform" method="post" action="saveColumn.asp?column=<%=request("column")%>">
<td width="140" align="center" bgcolor="#FFFFff">
<%if request("column")="" then%>
<input name="column" type="text" class="textboxface" size="15">
<%
else
response.write "<input name='column' type='hidden' class='textboxface' size=15 value=" & request("column") & ">"
response.write request("column")
end if
%> </td>
<td width="60" align="center" bgcolor="#FFFFff"><input name="template" type="text" class="textboxface" id="template" size="13"></td>
<td width="70" align="center" bgcolor="#EDEFEF"><input name="priviledge" type="text" value="<%=priviledge%>" class="textboxface3" size="12"></td>
<td width="100" align="center" bgcolor="#EDEFEF">
<%if request("column")<>"" then%>
<input name="subcolumn" type="text" class="textboxface3" size="12">
<%
else
response.write "<input name='subcolumn' type='hidden' class='textboxface' size=12 value='—'>"
response.write "—"
end if
%> </td>
<td width="80" align="center" bgcolor="#ffffff">
<input name="url" type="text" class="textboxface" size="12"> </td>
<td width="72" align="center" bgcolor="#EDEFEF">
<input type="reset" name="Reset" value="清除" class="button"> </td>
<td width="60" align="center" bgcolor="#EDEFEF">
<input type="submit" name="submit" value="追加" class="button">
<input type="hidden" name="mode" value="追加">
<input name="page" type="hidden" id="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&"><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&">"
response.write "<font style='font-size:9pt'>下一页</font></a> <a href="&filename&"?page="&n&"><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 + -