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

📄 countadmin.asp

📁 一个不错的企业网站源代码!
💻 ASP
字号:
<%@ Language=VBScript%>
<%
Response.Buffer=false
Response.Expires=0
%>
<!-- #include file="../dsn.asp" -->
<!-- #include file="../links.asp" -->
<%
if session("adminusername")="" then
		session("xhy")=1
		Response.Redirect linkwarn
end if
enable=""
id=Request.QueryString("id")
pid=Request.QueryString("pid")
delid=Request.QueryString("delid")
enable=Request.QueryString("enable")
pageno=Request.QueryString("pageno")
yxid=Request.QueryString("yxid")
ppid=Request.QueryString("ppid")
englishflag=Request.QueryString ("englishflag")
if englishflag="" then
		englishflag=0
	else
		englishflag=cint(englishflag)
end if
if englishflag=0 then
		tabname="count"
	else
		tabname="ecount"	
end if		
htmlname=linkcountadmin&"?pid="&pid&"&ppid="&ppid&"&englishflag="&englishflag
yzhtml=linkcountadmin&"?pid="&pid&"&ppid="&ppid
addhtml=linkcountedit&"?pid="&pid&"&ppid="&ppid&"&englishflag="&englishflag
set cn=Server.CreateObject("ADODB.Connection")
cn.Open mycnstr
set rs1=server.CreateObject("ADODB.Recordset")
set rs2=server.CreateObject("ADODB.Recordset")
if delid<>"" then
	sqltext3="delete from "+tabname+" where id="&delid
	cn.Execute sqltext3
	delid=""
end if

if yxid="" then
		yxid=0
	else
		yxid=cint(yxid)
end if
if yxid<>0 then
		sqltext4="select * from "+tabname+" where id="&yxid
		rs1.Open sqltext4,cn,1,2
		if not rs1.EOF then
				if rs1("enable")=1 then
						rs1("enable")=0
					else
						rs1("enable")=1
				end if
				yxid=0
		end if
		rs1.Update 
		rs1.Close 
end if
if id="" then
		id=0
	else
		id=cint(id)
end if

if pid<>"" then
	sqltext1="select * from classes where id="&pid
	rs1.Open sqltext1,cn,1,1
	if not rs1.EOF then
			classname=rs1("name")
	end if
	rs1.Close
end if
if ppid<>"" then
	sqltext1="select * from scool where id="&ppid
	rs1.Open sqltext1,cn,1,1
	scoolname=rs1("name")
	rs1.Close 
end if

if englishflag=0 then
		classname=classname&"<font color=red>(中文版)</font>"
	else
		classname=classname&"<font color=blue>(中文版)</font>"	
end if		
htmltitle="基本数据管理"

%>
<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: 宋体;line-height:130%}
.t1 {font:12px 宋体;color=000000} 
.t2 {font:12px 宋体;color:ffffff} 
.t3 {font:12px 宋体;color:336699} 
.t4 {font:12px 宋体;color:ff0000} 
.t5 {font:12px 宋体;color:ff6600} 


.bt1 {font:14px 宋体;color=000000} 
.bt2 {font:12px 宋体;color:ffffff} 
.bt3 {font:14px 宋体;color:336699} 
.bt4 {font:14px 宋体;color:ff0000} 
.bt5 {font:14px 宋体;color:0000ff}
.bt10 {font:14px 宋体;color:0000ff}

.td1 {font-size:12px;background-color:#3388bb;color:#ffffff}
.td2 {font-size:12px;background-color:#ffffff;color:#000000;}

A:link {color: #000077}
A:visited {color: #000077}
A:hover {color: #ff0000}

A.r1:link {text-decoration:none;color:#304556;}
A.r1:visited {text-decoration:none;color:#304556;}
A.r1:hover {text-decoration:underline;color:ff6600;}

A.r2:link {text-decoration:none;color:#ffffff;}
A.r2:visited {text-decoration:none;color:#ffffff;}
A.r2:hover {text-decoration:underline;color:cccc00;}

-->
</style>
</head>
<body topmargin=5>
<table width="100%" align=center>
	<tr>
	<td valign="top" align="left" width="100%">
		<table width="100%" height="20" border="0">
			<tr>
			<td style="font-size:12px;"></td>
			<td><font class=t5>当前位置:<%=scoolname%>→ <%=classname%></font></td>
			<td align="right">
			</td>
			</tr>
			</table>
			</td>
			</tr>
			</table>
		<table width="100%" height="20" border="0">
			<tr>
		<%
		'Response.Write sqltext
				sqltext1="select * from "+tabname+" order by pl"
			rs1.Open sqltext1,cn,1,1
		listcs=30
		rs1.PageSize=listcs
		if pageno="" then 
			pageno=1
		else
			pageno=cint(pageno)	
		end if	
		if rs1.PageCount>0 then rs1.AbsolutePage=pageno
	%>		<td class=t1 align="left" width=300>
			<a href="Javascript:window.location.reload()">[刷新列表]</a>
			<a href="<%=addhtml%>">[增加]</a>
		<%if englishflag=0 then%>
				<a href="<%=yzhtml%>&englishflag=1">[英文版]</a>
			<%else%>
				<a href="<%=yzhtml%>&englishflag=0">[中文版]</a>
		<%end if%>
		</td>
		<td align="right">
		<%if rs1.PageCount>1 then%>
			[第<b><font color=ff6600><%=pageno%></font></b>页, 共<b><font color=ff6600><%=rs1.PageCount%></font></b>页<b><font color=ff6600><%=rs1.RecordCount%></font></b>条记录		              			<%if pageno>1 then%>
				<a class=r href="<%=htmlname%>&pageno=1">首页</a>              
				<a class=r href="<%=htmlname%>&pageno=<%=pageno-1%>">上页</a>              
			<%end if              
			if pageno<rs1.PageCount then%>              
				<a class=r href="<%=htmlname%>&pageno=<%=pageno+1%>">下页</a>              
				<a class=r href="<%=htmlname%>&pageno=<%=rs1.PageCount%>">末页</a>              
			<%end if%>              
		<%end if              
		%>              
		</td></tr>
		</table>
		
		
		<table width="100%" border="0" cellspacing="1" cellpadding="1" style="font-size:14.5px;line-height:100%">
			<tr bgcolor="336699" style="color:#ffffff" align="center">
				<td class=bt2>删除</td>
				<td class=bt2>有效性</td>
				<td class=bt2 width=50>序号</td>
				<td class=bt2>部门名称</td>
			</tr>
		<%
		i=0
		do while not rs1.EOF and i<listcs 
			if (i mod 2)=1 then
				Response.Write("<tr bgcolor=fefefe>")
			else
				Response.Write("<tr bgcolor=efefef>")
			end if	
		%>
		<td width="35" align="center" onclick="Javascript:delrec('<%=rs1("id")%>','<%=trim(rs1("name"))%>')"><img  src="delete.gif"></td>
		<td width="50" align="center"><input type="checkbox" name="yxc" onclick="Javascript:yx('<%=rs1("id")%>')"  <%if rs1("enable")=1 then Response.Write ("checked")%>></td>
		<td width="50" align="center"><%=rs1("pl")%></td>
		<td align=left><a href="<%=addhtml%>&id=<%=rs1("id")%>"><%=rs1("name")%></a></td>
			</tr>
			<%rs1.MoveNext 
			i=i+1
			loop%>
					</table>
</body>
</html>
<script language="Javascript">

	function delrec(code,topic)
	{
		if (confirm('您确认要删除“'+topic+'”吗?')==true)
		{
			window.location.href="<%=htmlname%>&delid="+code+""
		return false;
		}
	}
			function yx(code)
	{	window.location.href="<%=htmlname%>&yxid="+code+""
	}
	
	function editimage(keyno)
	{
		var str
		str="upload.asp?" ;
		str=str+"id="+keyno+"&tablename=<%=tabname%>"
	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 + -