📄 miscell_class.asp
字号:
<%@ Language=VBScript %>
<%
Response.Buffer = true
Response.Expires = 0
if Session("userqx") = "1" or Session("userqx") = "9" then
else
Response.Redirect "warn.asp"
end if
%>
<!-- #include file="../dsn.asp" -->
<%
myflag=Request.QueryString("myflag")
keyno=Request.QueryString("keyno")
delkeyno=Request.QueryString("delkeyno")
if myflag="" then myflag="0"
if keyno="" then keyno="0"
set cn = Server.CreateObject("ADODB.Connection")
cn.Open mycnstr
set rs = Server.CreateObject("ADODB.Recordset")
set rs2 = Server.CreateObject("ADODB.Recordset")
'如果是删除记录
if delkeyno<>"" then
sqltext="delete from miscell_class where classcode='"+delkeyno+"'"
cn.Execute sqltext
reflag="1"
end if
htmltitle="网站管理设置"
htmlname="miscell_class.asp?x=1"
if Request.ServerVariables("REQUEST_METHOD")="POST" then
classcode = trim(Request.Form("classcode"))
classname = trim(Request.Form("title"))
flag = trim(Request.Form("flag"))
sortby = trim(Request.Form("sortby"))
listcount = cint(Request.Form("listcount"))
qxflag=""
for i=1 to 12
if Request.Form("qxflag"&i)="1" then
qxflag=qxflag+"1"
else
qxflag=qxflag+"0"
end if
next
if isnumeric(classcode) then sortnum = classcode else sortnum = 0
if flag="0" then
baseclass="101"
else
baseclass=classcode
end if
if keyno = "0" then
sql = "insert into miscell_class (sortnum, classcode, classname, baseclass, qxflag, flag, sortby, listcount)"_
& "values ("&sortnum&", '"&classcode&"', '"&classname&"', '"&baseclass&"', '"&qxflag&"', '"&flag&"', '"&sortby&"', "&listcount&")"
else
sql = "update miscell_class set sortnum="&sortnum&", classname='"&classname&"',baseclass='"&baseclass&"', qxflag='"&qxflag&"', "_
& "flag='"&flag&"', sortby='"&sortby&"', listcount="&listcount&" where classcode='"&classcode&"'"
end if
cn.Execute sql
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style>
body,table,tr
{
font-size:12px;
font-family:宋体;
line-height:20px;
}
A:link {color: #000077}
A:visited {color: #000077}
A:hover {color: #ff0000}
</style>
<script language="javascript">
function check()
{
var obj = document.form1;
if (obj.classcode.value == '')
{
alert("请输入类别编号");
obj.classcode.focus();
return false;
}
if (obj.title.value == '')
{
alert("请输入类别名称!");
obj.title.focus();
return false;
}
return true;
}
function del(keyno, title)
{
if (confirm("您确定要删除 [" + title + "] 吗?"))
{
window.location = "<%=htmlname%>&delkeyno=" + keyno;
}
}
</script>
</head>
<body bgcolor="#FFFFFF" topmargin="5">
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr height="30">
<td width="100" style="color:#2F4F4F;font-weight:bold;font-size:14px;"><%=htmltitle%></td>
<td>
<a href="<%=htmlname%>">[刷新列表]</a>
<a href="<%=htmlname%>&myflag=1">[增加]</a>
</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="1" cellpadding="1" align="center">
<tr align="center" bgcolor="527c72" style="color:#ffffff">
<td></td>
<td>类别编号</td>
<td>类别名称</td>
<td>排序方式</td>
<td>每页记录数</td>
<td>下设分类</td>
<td>权限</td>
</tr>
<%
sql = "select * from miscell_class where baseclass='101' or flag='1' order by flag, classcode"
rs.Open sql, cn, 0, 1, 1
i = 1
do while not rs.EOF
if (i mod 2)=0 then
Response.Write("<tr bgcolor='#efefef' align=center>")
else
Response.Write("<tr bgcolor='#fefefe' align=center>")
end if
%>
<td>
<%
if rs("flag") = "1" then
sql = "select count(*) from miscell_class where baseclass='"&rs("classcode")&"' and flag='0'"
else
sql = "select count(*) from miscell where classcode='"&rs("classcode")&"'"
end if
rs2.Open sql, cn, 0, 1, 1
if rs2(0) = 0 then
%>
<img onclick="del('<%=rs("classcode")%>', '<%=rs("classname")%>')" src="images/delete.gif" style="cursor:hand;">
<%
end if
rs2.Close
%>
</td>
<td><%=rs("classcode")%></td>
<td><a href="<%=htmlname%>&myflag=1&keyno=<%=rs("classcode")%>"><%=rs("classname")%></a></td>
<td>
<%Select Case rs("sortby")
case "0"
Response.Write("<font color=black>降序</font>")
case "1"
Response.Write("<font color=red>升序</font>")
end select
%>
</td>
<td><%=rs("listcount")%></td>
<td>
<%Select Case rs("flag")
case "0"
Response.Write("<font color=black>无</font>")
case "1"
Response.Write("<font color=red>有</font>")
end select
%>
</td>
<td><%=rs("qxflag")%></td>
</tr>
<%
i = i + 1
rs.MoveNext
loop
rs.Close
%>
</table>
<%
'如果新增记录或修改记录
if myflag = "1" then
xgcode = "1"
if keyno = "0" then
classcode = ""
flag = "0"
sortby = "0"
listcount = 30
else
sql = "select * from miscell_class where classcode='" & keyno & "'"
rs.Open sql, cn, 0, 1, 1
if not rs.EOF then
sortnum = rs("sortnum")
classcode=rs("classcode")
title=rs("classname")
qxflag=rs("qxflag")
flag=rs("flag")
sortby=rs("sortby")
listcount=rs("listcount")
end if
rs.Close
if flag = "1" then
sql = "select count(*) as cnt from miscell_class where baseclass='"&classcode&"'"
else
sql = "select count(*) from miscell where classcode='"+classcode+"'"
end if
rs.Open sql, cn, 0, 1, 1
if rs(0) <> 0 then xgcode = "0"
rs.Close
end if
%>
<table width="100%" border="0" cellspacing="1" cellpadding="1" align="center">
<form action="<%=htmlname%>&keyno=<%=keyno%>" method="post" name="form1" onsubmit="return check();" autocomplete="off">
<tr height="10">
<td></td>
</tr>
<tr height="20" bgcolor="#898989">
<td colspan="2" style="color:#FFFFFF">具体内容</td>
</tr>
<tr height="10">
<td></td>
</tr>
<tr>
<td width="70" align="right">类别编号:</td>
<td>
<span style="color:#800000;"><%=classcode%></span>
<%if xgcode = "1" then%>
<input type="text" name="classcode" value="<%=classcode%>" size="5" maxlength="3"> <font color=ff4500>*</font>
<%else%>
<input type="hidden" name="classcode" value="<%=classcode%>">
<%end if%>
</td>
</tr>
<tr>
<td align="right">类别名称:</td>
<td><input type="text" value="<%=title%>" name=title maxlength=20 size=30> <font color=ff4500>*</font></td>
</tr>
<tr>
<td align="right">排序方式:</td>
<td>
<input type=radio name=sortby value="0" <%if sortby="0" then Response.Write("checked")%>>降序
<input type=radio name=sortby value="1" <%if sortby="1" then Response.Write("checked")%>>升序
每页显示记录数:
<input type="text" value="<%=listcount%>" name=listcount maxlength=3 size=3>
</td>
</tr>
<tr>
<td align="right">下设分类:</td>
<td>
<%
if xgcode="1" then
%>
<input type=radio name=flag value="0" <%if flag="0" then Response.Write("checked")%>>无
<input type=radio name=flag value="1" <%if flag="1" then Response.Write("checked")%>>有
<%
else
if flag="1" then Response.Write("<font color=800000>有</font>") else Response.Write("<font color=800000>无</font>")
%>
<input type="hidden" name="flag" value="<%=flag%>">
<%
end if
%>
</td>
</tr>
<tr><td align=right>类别属性:</td>
<td>
<input type=checkbox name=qxflag1 value="1" <%if mid(qxflag,1,1)="1" then Response.Write("checked")%>>点击次数
<input type=checkbox name=qxflag2 value="1" <%if mid(qxflag,2,1)="1" then Response.Write("checked")%>>是否显示
<input type=checkbox name=qxflag3 value="1" <%if mid(qxflag,3,1)="1" then Response.Write("checked")%>>是否推荐
<input type=checkbox name=qxflag4 value="1" <%if mid(qxflag,4,1)="1" then Response.Write("checked")%>>禁止增删
</td>
</tr>
<tr>
<td></td>
<td>
<input type=checkbox name=qxflag5 value="1" <%if mid(qxflag,5,1)="1" then Response.Write("checked")%>>友情链接
<input type=checkbox name=qxflag6 value="1" <%if mid(qxflag,6,1)="1" then Response.Write("checked")%>>禁止图片
<input type=checkbox name=qxflag7 value="1" <%if mid(qxflag,7,1)="1" then Response.Write("checked")%>>放大图片
<input type=checkbox name=qxflag8 value="1" <%if mid(qxflag,8,1)="1" then Response.Write("checked")%>>关 键 字
</td>
</tr>
<tr>
<td></td>
<td>
<input type=checkbox name=qxflag9 value="1" <%if mid(qxflag,9,1)="1" then Response.Write("checked")%>>图文混排
<input type=checkbox name=qxflag10 value="1" <%if mid(qxflag,10,1)="1" then Response.Write("checked")%>>显示作者
<input type=checkbox name=qxflag11 value="1" <%if mid(qxflag,11,1)="1" then Response.Write("checked")%>>显示出处
<input type=checkbox name=qxflag12 value="1" <%if mid(qxflag,12,1)="1" then Response.Write("checked")%>>英文版
</td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="确定提交"></td>
</tr>
</form>
</table>
<%end if%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -