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

📄 instance_admin.asp

📁 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")
flag=Request.QueryString("flag")
method=Request.QueryString("method")
keyno=Request.QueryString("keyno")

if classcode="" then Response.End

htmltitle="图片管理"
tablename="instance"

addhtml="instance_admin.asp?classcode="+classcode

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


sqltext="select classname from instance_class where classcode='"+classcode+"'"
rs.Open sqltext,cn,1,1
if not rs.EOF then
	classname=trim(rs(0))
else
	Response.End
end if
rs.Close

if keyno<>"" then
	sqltext="delete from instance where keyno="&keyno
	cn.Execute(sqltext)
end if 
if method="add" then
	if flag<>"1" then
		flag="0"
	end if
	sqltext="insert into instance (classcode,picflag,flag) values ('"+classcode+"','0','"+flag+"')"
	cn.Execute sqltext
end if

orderby=" order by flag ,keyno"
%>
<html>
<head>
<title><%=htmltitle%></title>
<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="0">
	<tr><td align="left">
		<table width="100%" border="0" cellspacing="0" cellpadding="0"  height=18>
			<tr>
				<td style="font-size:12px;">&nbsp;<font color="navy" style="font-size:14px"><b><%=htmltitle%></b>(<%=classname%>)</font></td>
			</tr>
		</table>
	</td></tr>
	<tr><td>		
		<table width="100%" border="0">
			<tr>
	<%
		sqltext="select * from "+tablename+" where classcode='"+classcode+"' "+orderby
		rs.Open sqltext,cn,1,1

	%>
			<td class=t1 align="left">
				<a href="Javascript:window.location.reload()">[刷新列表]</a>
				<a href="<%=addhtml%>&method=add&flag=0">[增加效果图]</a>
				<a href="<%=addhtml%>&method=add&flag=1">[增加现场实景]</a>
			</td>
			</tr>
			</table>
	</td></tr>
	<tr><td>
		<table width="100%" border="0" cellspacing="1" cellpadding="1">
			<tr bgcolor="336699" style="color:#ffffff" align="center">
				<td width="35" class=t2></td>
				<td width="80" class=t2><a class=r2 href="<%=htmlname2%>&orderby=1">标题</td>
				<td width="100" class=t2>图片</td>
				<td width="150" class=t2>放大图片</td>
				<td class=t2></td>
			</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="35" align=right>
				<div align=center><img onclick="delrec('<%=rs("keyno")%>')" src="../admin/delete.gif" style="cursor:hand"></div>
			</td>
			<td width="80" align="center" height=20>
			<%if rs("flag")="1" then 
					Response.Write("现场实景")
			  else		
					Response.Write("效果图")
			  end if	
			%>
			</td>
			<td width="100" align="center">
				<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>
			<td width="150" align="center">
				<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>
			<td></td>
			</tr>
		<%	
			i=i+1
			rs.MoveNext
		loop
		%>
		 </table>
	</td></tr>
</table>
</body>
</html>

<script language="Javascript">

	function delrec(code)
	{
		if (confirm('您确认要删除吗?')==true)
		{
		window.location.href="<%=addhtml%>&keyno="+code
		}
	}

	function editimage(keyno)
	{
		var str
		str="../admin/upload.asp?" ;
		str=str+"keyno="+keyno+"&tablename=instance&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/upload.asp?" ;
		str=str+"keyno="+keyno+"&tablename=instance&keyword=keyno&strflag=0&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")		
	}
	
</script>

⌨️ 快捷键说明

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