📄 miscell_admin.asp
字号:
<%@ Language=VBScript%>
<%
Response.Buffer=true
Response.Expires=0
if Session("userqx")>="1" and Session("userqx")<="9" then
else
Response.Redirect "../warn.asp"
end if
%>
<!-- #include file="../dsn.asp" -->
<%
classcode=Request.QueryString("classcode")
pageno=Request.QueryString("pageno")
keyno=Request.QueryString("keyno")
ordername=Request.QueryString("ordername")
byasc=Request.QueryString("byasc")
if ordername="" then ordername="sortnum"
if byasc="" then byasc="desc"
ordertxt=" order by "+ordername+" "+byasc
htmlname="miscell_admin.asp?classcode="+classcode+"&ordername="+ordername+"&byasc="+byasc
htmlname2="miscell_admin.asp?classcode="+classcode
addhtml="miscell_edit.asp?classcode="+classcode+"&ordername="+ordername+"&byasc="+byasc
set cn=server.CreateObject("ADODB.Connection")
cn.Open mycnstr
set rs=server.CreateObject("ADODB.Recordset")
set rs2=server.CreateObject("ADODB.Recordset")
tablename="miscell"
if keyno<>"" then
sqltext="delete from miscell where keyno="&keyno
cn.Execute(sqltext)
sqltext="delete from picfiles where (code='miscell' or code='miscell2') and keyno="&keyno
cn.Execute(sqltext)
end if
if classcode="" then
sqltext="select top 1 * from miscell_class order by classcode"
rs.Open sqltext,cn,1,1
if not rs.EOF then
classcode=rs("classcode")
classname=trim(rs("classname"))
basclass=trim(rs("basclass"))
qxflag=trim(rs("qxflag"))
else
Response.End
end if
rs.Close
else
sqltext="select * from miscell_class where classcode='"+classcode+"'"
rs.Open sqltext,cn,1,1
if not rs.EOF then
classcode=rs("classcode")
classname=trim(rs("classname"))
basclass=trim(rs("basclass"))
qxflag=trim(rs("qxflag"))
else
Response.End
end if
rs.Close
end if
htmltitle="网站管理"
wheretxt=" where classcode='"+classcode+"'"
%>
<HTML>
<HEAD>
<meta HTTP-EQUIV="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
body {font-size: 12px; color: #000000; font-family: 宋体}
td {font-size: 12px; color: #000000; font-family: 宋体;}
.t1 {font:12px 宋体;color=000000}
.t2 {font:12px 宋体;color:ffffff}
.bt1 {font:14px 宋体;color=000000}
.bt2 {font:14px 宋体;color:ffffff}
A:link {color: #000066}
A:visited {color: #000066}
A:hover {color: #ff0000}
A.r1:link {font-size:12px;text-decoration:underline;color:#000000;}
A.r1:visited {font-size:12px;text-decoration:underline;color:#000000;}
A.r1:hover {font-size:12px;text-decoration:underline;color:#ff6600;}
A.r2:link {font-size:12px;text-decoration:underline;color:#ffffff;}
A.r2:visited {font-size:12px;text-decoration:underline;color:#ffffff;}
A.r2:hover {font-size:12px;text-decoration:underline;color:#ff6600;}
-->
</style>
</HEAD>
<body topmargin=5 leftmargin=5 bgcolor=#ffffff>
<table width="100%" align=center border="0" cellspacing="0" cellpadding="2">
<tr><td align="left">
<table width="100%" border="0" cellspacing="0" cellpadding="0" height=24>
<tr valign=bottom>
<td style="font-size:12px;">
<font color="DarkSlateGray" style="font-size:14px"><b><%=htmltitle%></b></font>
<font color=ff6600><%=classname%></font>
<a href="<%=htmlname%>&pageno=<%=pageno%>">[刷新列表]</a>
<%if mid(qxflag,4,1)="0" or (Session("username")="xu256" and Session("userqx")="9") then%>
<a href="<%=addhtml%>">[增加]</a>
<%end if%>
</td>
<td align="right">
</td>
</tr>
</table>
</td></tr>
<%
sqltext="select * from miscell "+wheretxt+ordertxt
'Response.Write sqltext
'Response.End
rs.Open sqltext,cn,1,1
listcount=30
rs.PageSize=listcount
if pageno="" then pageno=1 else pageno=cint(pageno)
if rs.PageCount>0 then rs.AbsolutePage=pageno
%>
<tr><td valign=top height=360>
<table width="100%" border="0" cellspacing="1" cellpadding="1">
<tr bgcolor="527c72" style="color:#ffffff" align="center">
<%if mid(qxflag,4,1)="0" or (Session("username")="xu256" and Session("userqx")="9") then%>
<td class=t2 width="35">删除</td>
<%end if%>
<%if classcode="999" then%>
<td class=t2 width="120">栏目类型</td>
<%end if%>
<td class=t2 height=20 width="35">序号</td>
<td class=t2><a class=r2 href="<%=htmlname2%>&ordername=title&byasc=<%=selectxh("title",ordername,byasc,"asc")%>">标题名称</a></td>
<%if mid(qxflag,2,1)="1" then%>
<td class=t2 width="60"><a class=r2 href="<%=htmlname2%>&ordername=flag&byasc=<%=selectxh("flag",ordername,byasc,"desc")%>">显示</a></td>
<%end if%>
<%if mid(qxflag,3,1)="1" then%>
<td class=t2 width="60"><a class=r2 href="<%=htmlname2%>&ordername=nomflag&byasc=<%=selectxh("nomflag",ordername,byasc,"desc")%>">推荐</a></td>
<%end if%>
<%if mid(qxflag,1,1)="1" then%>
<td class=t2 width="40"><a class=r2 href="<%=htmlname2%>&ordername=querycount&byasc=<%=selectxh("querycount",ordername,byasc,"desc")%>">点击</a></td>
<%end if%>
<%if mid(qxflag,6,1)="0" then%>
<td class=t2 width="70"><a class=r2 href="<%=htmlname2%>&ordername=picflag&byasc=<%=selectxh("picflag",ordername,byasc,"desc")%>">图片</a></td>
<%end if%>
<%if mid(qxflag,7,1)="1" then%>
<td class=t2 width="80"><a class=r2 href="<%=htmlname2%>&ordername=picflag2&byasc=<%=selectxh("picflag2",ordername,byasc,"desc")%>">放大图</a></td>
<%end if%>
</tr>
<%
i=1
do while not rs.EOF and i<=listcount
if (i mod 2)=0 then
Response.Write("<tr bgcolor=fefefe>")
else
Response.Write("<tr bgcolor=efefef>")
end if
%>
<%if mid(qxflag,4,1)="0" or (Session("username")="xu256" and Session("userqx")="9") then%>
<td width="35" align=right>
<div align=center><img onclick="delrec('<%=rs("keyno")%>','<%=trim(rs("title"))%>')" src="../admin/delete.gif"></div>
</td>
<%end if%>
<%if classcode="999" then%>
<td width="120" align="center"><%=trim(rs("keyword"))%></td>
<%end if%>
<td width="35" align="center"><%=rs("sortnum")%></td>
<td align=left><a href="<%=addhtml%>&keyno=<%=rs("keyno")%>&pageno=<%=pageno%>">
<%Response.Write Server.HTMLEncode(trim(rs("title")))%></a>
</td>
<%if mid(qxflag,2,1)="1" then%>
<td width="60" align="center">
<%Select Case trim(rs("flag"))
case "0"
Response.Write("<font color=008080>不显示</font>")
case "1"
Response.Write("<font color=000000>正常</font>")
end select
%>
</td>
<%end if%>
<%if mid(qxflag,3,1)="1" then%>
<td width="60" align="center">
<%Select Case trim(rs("nomflag"))
case "0"
Response.Write("<font color=000000>不推荐</font>")
case "1"
Response.Write("<font color=ff4500>推荐</font>")
end select
%>
</td>
<%end if%>
<%if mid(qxflag,1,1)="1" then%>
<td width=40 align="center" height=20><%=rs("querycount")+rs("querycount2")%></td>
<%end if%>
<%if mid(qxflag,6,1)="0" then%>
<td width=70 align="center" height=20>
<a href="Javascript:editimage('<%=rs("keyno")%>')">图片</a>
<%if rs("picflag")="1" then Response.Write("<font color=red style='font-size:12px'>(有)</font>") else Response.Write("<font color=navy style='font-size:12px'>(无)</font>")%>
</td>
<%end if%>
<%if mid(qxflag,7,1)="1" then%>
<td width=80 align="center" height=20>
<a href="Javascript:editimage2('<%=rs("keyno")%>')">放大图</a>
<%if rs("picflag2")="1" then Response.Write("<font color=red style='font-size:12px'>(有)</font>") else Response.Write("<font color=navy style='font-size:12px'>(无)</font>")%>
</td>
<%end if%>
</tr>
<%
i=i+1
rs.MoveNext
loop
%>
</table>
</td></tr>
<tr><td valign=top height=30>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td bgcolor="696969" height=1></td></tr>
<tr><td align=right height=30>
[第<font color=ff6600><b><%=pageno%></font></b>页, 共<b><font color=ff6600><%=rs.PageCount%></font></b>页<b><font color=ff6600><%=rs.RecordCount%></font></b>条记录]
<%if pageno>1 then%>
<a class=r1 href="<%=htmlname%>&pageno=1">[首页]</a>
<a class=r1 href="<%=htmlname%>&pageno=<%=pageno-1%>">[上页]</a>
<%end if
if pageno<rs.PageCount then%>
<a class=r1 href="<%=htmlname%>&pageno=<%=pageno+1%>">[下页]</a>
<a class=r1 href="<%=htmlname%>&pageno=<%=rs.PageCount%>">[末页]</a>
<%end if%>
</td></tr>
</table>
<%
rs.Close
%>
</td></tr>
</table>
</body>
</html>
<%
function selectxh(fieldname,ordername,byasc,defaultasc)
if defaultasc<>"asc" then defaultasc="desc"
if fieldname=ordername then
if byasc="desc" then
selectxh="asc"
else
selectxh="desc"
end if
else
selectxh=defaultasc
end if
end function
%>
<script language="Javascript">
function delrec(code,topic)
{
if (confirm('您确认要删除('+topic+')吗?')==true)
{
window.location.href="<%=htmlname%>&pageno=<%=pageno%>&keyno="+code
}
}
function editimage(keyno)
{
var str
str="../admin/pic_uploadacc.asp?" ;
str=str+"keyno="+keyno+"&tablename=miscell&keyword=keyno&strflag=0"
window.open(str,"mywin","toolbar=no,location=no,directories=no,status=no,resizable=no,menubar=no,scrollbars=yes,width=550,height=400,left=120,top=70")
}
function editimage2(keyno)
{
var str
str="../admin/pic_uploadacc.asp?" ;
str=str+"keyno="+keyno+"&tablename=miscell&keyword=keyno&strflag=0&flagfield=picflag2&code=miscell2&picsize=500000"
window.open(str,"mywin","toolbar=no,location=no,directories=no,status=no,resizable=no,menubar=no,scrollbars=yes,width=550,height=400,left=120,top=70")
}
</script>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -