⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 miscell_admin.asp

📁 商会 商会 商会 商会 商会 商会 商会 商会 商会 商会 商会 商会 商会
💻 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")
delkeyno=Request.QueryString("delkeyno")
ordername=Request.QueryString("ordername")
byasc=Request.QueryString("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 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"))
		baseclass=trim(rs("baseclass"))
		qxflag=trim(rs("qxflag"))
		listcount=rs("listcount")
		sortby=trim(rs("sortby"))
	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"))
		baseclass=trim(rs("baseclass"))
		qxflag=trim(rs("qxflag"))
		listcount=rs("listcount")
		sortby=trim(rs("sortby"))
	else
		Response.End	
	end if	
	rs.Close
end if

if sortby="0" then sortby="desc" else sortby="asc"

if ordername="" then ordername="sortnum"
if byasc="" then byasc=sortby
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

htmltitle="网站管理"
wheretxt=" where classcode='"+classcode+"'"

if mid(qxflag,6,1)="0" then piczs=1
if mid(qxflag,7,1)="1" then piczs=piczs+1

if Request.ServerVariables("REQUEST_METHOD")="POST" then
	rectot=Request.Form("rectot")
	for i=1 to rectot
		checksele=Request.Form("checksele"&i)
		if checksele<>"" then
			seleitem=Request.Form("seleitem"&i)
			cn.BeginTrans
			sqltext="delete from picfiles where tablename='"+tablename+"' and keyno="&seleitem
			cn.Execute(sqltext)
			
			sqltext="select keyno from miscell_info where miscellno="&seleitem
			rs.Open sqltext,cn,1,1
			do while not rs.EOF
				sqltext="delete from picfiles where tablename='miscell_info' and keyno="&rs(0)
				cn.Execute sqltext
				rs.MoveNext	
			loop
			rs.Close
			
			sqltext="delete from miscell_info where miscellno="&seleitem
			cn.Execute(sqltext)
			sqltext="delete from miscell where keyno="&seleitem
			cn.Execute sqltext
			cn.CommitTrans
		end if
	next
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:#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>
		   <form name=form1 method="post" action="<%=htmlname%>">
			<tr valign=bottom>
				<td style="font-size:12px;">
				<font color="DarkSlateGray" style="font-size:14px"><b><%=htmltitle%></b></font>
				&nbsp;<font color=ff6600><%=classname%></font>
				&nbsp;<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">
				<input type="button" name="mydele" value="删除" style="width:60px;height:20px" onclick="delmsg(this.form)">
				<input type="checkbox" name="seleall" onclick="checkall(this.form)" >全选
				</td>
			</tr>
			</table>
	</td></tr>
	<%
		sqltext="select * from miscell "+wheretxt+ordertxt
		rs.Open sqltext,cn,1,1
	
		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 width=10 height=20 align=center></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=state&byasc=<%=selectxh("state",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="70"><a class=r2 href="<%=htmlname2%>&ordername=picflag2&byasc=<%=selectxh("picflag2",ordername,byasc,"desc")%>">放大图</a></td>
				<%end if%>
				<%if mid(qxflag,9,1)="1" then%>
				<td class=t2 width="70"><a class=r2 href="<%=htmlname2%>&ordername=infocount&byasc=<%=selectxh("infocount",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=10 height=20 align=center>
					<input type=hidden name="seleitem<%=i%>" value="<%=rs("keyno")%>">
					<input type=checkbox name="checksele<%=i%>" value="0">
				</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("state"))
					case "0"
						Response.Write("<font color=ff0000>不显示</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="right" height=20><%=rs("querycount")%></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=70 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
				 if mid(qxflag,9,1)="1" then
				%>
				<td align="center" height=20>
					<a href="miscell_info.asp?classcode=<%=classcode%>&pageno=<%=pageno%>&miscellno=<%=rs("keyno")%>">图文</a>
					<%
					if rs("infocount")>0 then
						Response.Write ("<font color=ff6600>("&rs("infocount")&")</font>")
					end if	
					%>
				</td>
				<%end if%>
			</tr>
		<%	
			i=i+1
			rs.MoveNext
		loop
		%>
	 	 	<input type=hidden value="<%=i-1%>" name=rectot>
		 </form> 	
		 </table>
	</td></tr>
	<tr><td valign=top height=30>
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
			<tr><td colspan=2 bgcolor="696969" height=1></td></tr>
			<tr><td>
			</td><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>

<!-- #include file="sysfunc.inc.asp" -->

<script language="Javascript">

	function checkall(form)
	 {
		  for (var i=0;i<form.elements.length;i++)
		    {
			    var obj = form.elements[i];
			    var objname=obj.name;
			   
			    if(objname.substring(0,9)=="checksele")
					{
					 obj.checked=form.seleall.checked	
					}
		    }
	  }

	function delmsg(form)
	{
		var flag=false;
		var i,rectot,obj1
		rectot=form.rectot.value;
		for(i=1;i<=rectot;i++)				
		{
			obj1=eval("form.checksele"+i);
			if (obj1.checked) flag=true;	
		}

		if (flag){
			if (confirm('确认删除选择的记录吗?')==true) form.submit();
		}else alert("请先选择要删除的记录!");	
	}

	function editfile(keyno)
	{
		var str
		str="../files/file_upload.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 editfile2(keyno)
	{
		var str
		str="../files/file_upload.asp?" ;
		str=str+"keyno="+keyno+"&tablename=miscell&keyword=keyno&strflag=0&code=miscellb&flagfield=picflag2&filefield=picfile2"
		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 editimage(keyno)
	{
		var str
		str="pic_upload.asp?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="pic_upload.asp?keyno="+keyno+"&tablename=miscell&keyword=keyno&strflag=0&flagfield=picflag2&code=miscell2"
		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 + -