📄 forum_basclass.asp
字号:
<%@ Language=VBScript %>
<%
Response.Buffer=true
Response.Expires=0
if Session("userqx")>="1" and Session("userqx")<="9" then
else
Response.Redirect "../admin/warn.asp"
end if
%>
<!-- #include file="../dsn.asp" -->
<%
myflag=Request.QueryString("myflag")
classcode=Request.QueryString("classcode")
pageno=Request.QueryString("pageno")
delclass=Request.QueryString("delclass")
if myflag="" then myflag="0"
if basclass="" then basclass="101"
if classcode="" then classcode="0"
tablename="forum_basclass"
set cn=server.CreateObject("ADODB.Connection")
cn.Open mycnstr
set rs=server.CreateObject("ADODB.Recordset")
set rs2=server.CreateObject("ADODB.Recordset")
if delclass<>"" then
sqltext="delete from "+tablename+" where classcode='"+delclass+"'"
cn.Execute sqltext
end if
temp=newtemp()
htmltitle="论坛分类管理"
htmlname="forum_basclass.asp?temp="+temp
if Request.ServerVariables("REQUEST_METHOD")="POST" then
sortnum=Request.Form("sortnum")
manager=trim(Request.Form("manager"))
if classcode="0" then
sqltext="select top 1 classcode from "+tablename+" order by classcode desc"
rs.Open sqltext,cn,1,1
if rs.EOF then
classcode="101"
sql="update forum_class set basclass='101'"
cn.Execute sql
else
classcode=rs(0)+1
end if
rs.Close
if sortnum="" or not isnumeric(sortnum) then
sqltext="select top 1 sortnum from "+tablename+" order by sortnum desc"
rs.Open sqltext,cn,1,1
if rs.EOF then
sortnum=1
else
sortnum=rs(0)+1
end if
rs.Close
end if
rs.Open tablename,cn,3,3
rs.AddNew
rs("classcode")=classcode
rs("topcount")=0
rs("reccount")=0
else
sqltext="select * from "+tablename+" where classcode='"+classcode+"'"
rs.Open sqltext,cn,3,3
end if
if isnumeric(sortnum) then rs("sortnum")=sortnum
rs("classname")=trim(Request.Form("classname"))
rs("state")=Request.Form("state")
rs("flag")=Request.Form("flag1")+Request.Form("flag2")+Request.Form("flag3")
rs("content")=trim(Request.Form("content"))
rs.Update
rs.Close
myflag="0"
end if
%>
<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:#ff0000;}
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;}
A.r3:link {font-size:12px;text-decoration:none;color:#000000;}
A.r3:visited {font-size:12px;text-decoration:none;color:#000000;}
A.r3:hover {font-size:12px;text-decoration:underline;color:#ff0000;}
-->
</style>
</HEAD>
<body topmargin=5 leftmargin=5 bgcolor=#ffffff>
<table width="100%" align=center border="0" cellspacing="0" cellpadding="2">
<%
sqltext="select * from "+tablename+" order by sortnum"
rs.Open sqltext,cn,1,1
%>
<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=#003300 style="font-size:12px"></font>
<a href="<%=htmlname%>&pageno=<%=pageno%>">[刷新列表]</a>
<a href="<%=htmlname%>&pageno=<%=pagecount%>&myflag=1">[增加]</a>
</td>
</tr>
</table>
</td></tr>
<tr><td valign=top height=100>
<table width="100%" border="0" cellspacing="1" cellpadding="1">
<tr bgcolor="527c72" style="color:#ffffff" align="center">
<td height=20 width="35" class=t2></td>
<td class=t2 width=35>序号</td>
<td class=t2 width=66>版块编号</td>
<td class=t2 align=center>版块名称</td>
<td class=t2 align=center width=56>状态</td>
<td class=t2 align=center width=120>版块管理</td>
<td class=t2 align=center width=10></td>
</tr>
<%
i=1
do while not rs.EOF
flag=trim(rs("flag"))
if (i mod 2)=0 then
Response.Write("<tr bgcolor=fefefe>")
else
Response.Write("<tr bgcolor=efefef>")
end if
%>
<td width="35" align=right>
<%
if rs("reccount")=0 then
%>
<div align=center><img onclick="delrec('<%=rs("classcode")%>')" src="../admin/images/delete.gif" style="cursor:hand"></div>
<%
end if
%>
</td>
<td width=40 align="center" height=20><%=rs("sortnum")%></td>
<td width=66 align="center" height=20><%=rs("classcode")%></td>
<td align="left" height=20><a href="<%=htmlname%>&myflag=1&classcode=<%=trim(rs("classcode"))%>&pageno=<%=pageno%>"><%=trim(rs("classname"))%></td>
<td width="56" align="center">
<%Select Case trim(rs("state"))
case "0"
Response.Write("<font color=008080>×暂停</font>")
case "1"
Response.Write("<font color=000000>正常</font>")
end select
%>
</td>
<td align="center" height=20 width=120><a href="forum_class.asp?basclass=<%=trim(rs("classcode"))%>">进入版块管理...</td>
<td></td>
</tr>
<%
i=i+1
rs.MoveNext
loop
rs.Close
%>
</table>
</td></tr>
</table>
<%if myflag="1" then%>
<table width="100%" border="0" cellspacing="1" cellpadding="1" align="center">
<form action="<%=htmlname%>&classcode=<%=classcode%>&pageno=<%=pageno%>" method=post name=form1 onsubmit="return checkform(form1)" autocomplete = "off">
<%
if classcode="0" then
sqltext="select top 1 sortnum from "+tablename+" order by sortnum desc"
rs.Open sqltext,cn,1,1
if rs.EOF then
sortnum=1
else
sortnum=rs(0)+1
end if
rs.Close
colorset="cc6600"
state="1"
classcode="<font color=ff0000>[新]</font>"
else
sqltext="select * from "+tablename+" where classcode='"+classcode+"'"
rs.Open sqltext,cn,1,1
if not rs.EOF then
sortnum=rs("sortnum")
classname=trim(rs("classname"))
manager=trim(rs("manager"))
content=trim(rs("content"))
state=rs("state")
flag=rs("flag")
end if
rs.Close
end if
%>
<tr bgcolor=#898989><td colspan=2 height=20><font class=t2>具体内容</font></td></tr>
<tr><td width=600>
<table width="100%" border="0" cellspacing="1" cellpadding="1" align="center">
<tr><td width=70 class=td1 align=right height=5></td>
<td class=td2></td></tr>
<tr><td width=70 class=td1 align=right>版块编号:</td>
<td class=td2><font color=800000><%=classcode%></font>
序号:<input type="text" value="<%=sortnum%>" name=sortnum maxlength=6 size=4>
</td></tr>
<tr><td class=td1 align=right>版块名称:</td>
<td class=td2>
<input type="text" value="<%=classname%>" name=classname maxlength=30 size=20><font color=ff4500>*</font>
</td></tr>
<tr><td width=70 align=right>目前状态:</td>
<td>
<input type=radio name=state value="1" <%if state="1" then Response.Write("checked")%>>正常
<input type=radio name=state value="0" <%if state="0" then Response.Write("checked")%>>暂停
</td></tr>
<tr><td align=right height=10></td><td align=right></td></tr>
<tr><td class=td1 align=right></td>
<td class=td2>
</td></tr>
<tr><td class=td2 bgcolor=ffffff ></td><td class=td2 bgcolor=ffffff align=left><br>
<input type="submit" name="submit" value="确认提交">
</td></tr>
</table>
</td>
<td> </td>
</tr>
<script language=Javascript>form1.classname.focus()</script>
</form>
</table>
<%end if%>
</body>
</html>
<!-- #include file="sysfunc.inc" -->
<script language="Javascript">
function delrec(code)
{
if (confirm("您确认要删除("+code+")吗?")==true)
{
window.location.href="<%=htmlname%>&pageno=<%=pageno%>&delclass="+code
}
}
function checkform(form)
{
var flag=true;
if(form("classname").value==""){alert("请填写分类名称!");form("classname").focus();return false;}
return flag;
}
</script>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -