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

📄 miscell_info.asp

📁 商会 商会 商会 商会 商会 商会 商会 商会 商会 商会 商会 商会 商会
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<%@ 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" -->
<%
myflag=Request.QueryString("myflag")
keyno=Request.QueryString("keyno")
pageno=Request.QueryString("pageno")
classcode=Request.QueryString("classcode")
miscellno=Request.QueryString("miscellno")

delkeyno=Request.QueryString("delkeyno")
if myflag="" then myflag="0"
if keyno="" then keyno="0"

tablename="miscell_info"
		
set cn=server.CreateObject("ADODB.Connection")
cn.Open mycnstr
set rs=server.CreateObject("ADODB.Recordset")
set rs2=server.CreateObject("ADODB.Recordset")

sqltext="select title from miscell where keyno="&miscellno
rs.Open sqltext,cn,1,1
if not rs.EOF then
	mistitle=trim(rs("title"))
end if	
rs.Close
if len(mistitle)>=15 then mistitle=left(mistitle,15)+"..."

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
if mid(qxflag,7,1)="1" then picflag2="1" else picflag2="0"

htmlname="miscell_info.asp?classcode="+classcode+"&miscellno="+miscellno+"&pageno="+pageno
backhtml="miscell_admin.asp?classcode="+classcode+"&pageno="+pageno

if Request.ServerVariables("REQUEST_METHOD")="POST" then
	bz="0"
	if Request.Form("submit")<>"" then
		sortnum=trim(Request.Form("sortnum"))
		if keyno="0" then
			
			sql = "select max(keyno) from "&tablename
			rs.Open sql, cn, 0, 1, 1
			if not rs.EOF and rs(0) > 0 then
				keyno = rs(0) + 1
			else
				keyno = 1
			end if
			rs.Close

			if not isnumeric(sortnum) then
				sqltext="select sortnum from "+tablename+" where miscellno="&miscellno&" order by sortnum desc "
				rs2.Open sqltext,cn,1,1
				if not rs2.EOF then
					sortnum=rs2(0)+1
				else
					sortnum=1
				end if
				rs2.Close
			end if
			rs.Open tablename,cn,3,3
			rs.AddNew
			rs("keyno")=keyno
			rs("miscellno")=miscellno
			bz="1"
		else
			sqltext="select * from "+tablename+" where keyno="&keyno
			rs.Open sqltext,cn,3,3
		end if
		if isnumeric(sortnum) then rs("sortnum")=sortnum
	
		rs("title")=trim(Request.Form("title"))
		rs("content")=trim(Request.Form("content"))
		rs("flag")=Request.Form("flag")
		rs("picalign")=Request.Form("picalign")

		rs.Update
		rs.Close
		myflag="0"
	else	
		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="delete from "+tablename+" where keyno="&seleitem
				cn.Execute sqltext
				cn.CommitTrans
				bz="1"
			end if
		next
	end if
	if bz="1" then
		sql="select count(keyno) from miscell_info where miscellno="&miscellno		
		rs.Open sql,cn,1,1
		sql="update miscell set infocount="&rs(0)&" where keyno="&miscellno
		cn.Execute sql
		rs.Close
	end if
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+" where miscellno="&miscellno&" order by sortnum asc"
		rs.Open sqltext,cn,1,1

	%>
	<tr><td align="left">
		<table width="100%" border="0" cellspacing="0" cellpadding="0" height=24>
			<form name="xxform" method=post >
			<tr valign=bottom>
				<td style="font-size:12px;">&nbsp;
				<font color=ff6600 style="font-size:12px"><b><%=Server.HTMLEncode(mistitle)%></b></font>
				<a href="<%=htmlname%>">[刷新列表]</a>
				<a href="<%=backhtml%>">[返回]</a>
				<a href="<%=htmlname%>&myflag=1">[增加]</a>
				</td>
				<td>
				</td>
			</tr>
			</form>
	     </table>
	</td></tr>
	<tr><td height=180 valign=top>
		<table width="100%" border="0" cellspacing="1" cellpadding="1">
		   <form name=form1 method="post" action="<%=htmlname%>">
			<tr bgcolor="527c72" style="color:#ffffff" align="center">
				<td width=10 height=20 align=center>
				<td class=t2 width=40>序号</td>
				<td class=t2 align=center>图片标题</td>
				<td class=t2 align=center>显示标题</td>
				<td class=t2 align=center>图片位置</td>
				<td class=t2 align=center>图片维护</td>
				<%if picflag2="1" then%>
				<td class=t2 align=center>放大图片</td>
				<%end if%>
			</tr>
		<%
		i=1
		do while not rs.EOF
			if (i mod 2)=0 then
				Response.Write("<tr bgcolor=fefefe>")
			else
				Response.Write("<tr bgcolor=efefef>")
			end if	
		%>
			<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>
			<td width=40 align="center" height=20><%=rs("sortnum")%></td>
			<td height=20>
			<a href="<%=htmlname%>&myflag=1&keyno=<%=rs("keyno")%>"><%=Server.HTMLEncode(trim(rs("title")))%></td>
			<td width=60 align="center" height=20>
				<%Select Case trim(rs("flag"))
					case "0"
						Response.Write("<font color=008000>不显示</font>")
					case else
						Response.Write("<font color=000000>显示</font>")
				 end select		
				%>
			</td>
			<td width=60 align="center" height=20>
				<%Select Case trim(rs("picalign"))
					case "left"
						Response.Write("<font color=008000>左对齐</font>")
					case "right"
						Response.Write("<font color=008000>右对齐</font>")
					case else
						Response.Write("<font color=000000>居中</font>")
				 end select		
				%>
			</td>
			<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>
			<%if picflag2="1" then%>
			<td width=90 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
		rs.Close
		%>
	 	 	<input type=hidden value="<%=i-1%>" name=rectot>
		</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>
				<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><td align=right height=30>
			[共<b><font color=ff6600><%=i-1%></font></b>条记录]			
			</td></tr>              
		</table>
	</td></tr>
	</form>	
</table>
<%if myflag="1" then%>
<table width="100%" border="0" cellspacing="1" cellpadding="1" align="center">
<form action="<%=htmlname%>&keyno=<%=keyno%>" method=post name=editform onsubmit="return checkform(editform)" autocomplete = "off">
	<%
	 if keyno="0" then
		picalign="center"
		flag="0"
		sqltext="select sortnum from "+tablename+" where miscellno="&miscellno&" order by sortnum desc "
		rs2.Open sqltext,cn,1,1
		if not rs2.EOF then
			sortnum=rs2(0)+1
		else
			sortnum=1
		end if

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -