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

📄 admin_client.asp

📁 广告策划中心整站程序
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<!--#include file="../Comm/subconn.asp"-->
<%
dim cls
if session("admin")="" then
	Response.Redirect("admin.asp")	
else
	if session("flag")<>"0" then
	
		cls = Instr(session("flag"), "client")
		if cls <= 0 then
	%>
		<script language="javascript">
			if (confirm("您的操作权限不够,系统拒绝你的访问,请点确定返回,或者点取消退出重新登录"))
			  location.href="admin.asp";
			else
			  location.href="quit.asp";
		</script>
	<%
		end if
	end if
end if
%>
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="admin.css" type="text/css">
<title>客户管理</title>
<style type="text/css"><!--
a:link {color: #FFFFFF;text-decoration: none;}
a:visited {color: #FFFFFF;text-decoration: none;}
a:hover {color: #FFFF99;text-decoration: underline;}
.b{color:#cccc99;font-size:10pt;border:dotted 1px}
--></style>
<script language=javascript>
<!--
function CheckAll(form)  {
  for (var i=0;i<form.elements.length;i++)    {
    var e = form.elements[i];
    if (e.name != 'chkall')       e.checked = form.chkall.checked; 
   }
  }
-->
</script>

</head>

<body bgcolor="#336699" background="../images/bggreen.gif" text=#ffffff topmargin="0">
<!--#include file="top.asp"-->

<table border="0" cellpadding="2" cellspacing="5" style="border-collapse: collapse" bordercolor="#222222" width="772" height="150" bgcolor="#336699" align="center">
    <tr><td width=125 valign="top">
<!--#include file="admin_left.asp"--> 
      </td>
      <td  valign="top" width=647>      
        <table border="1" cellpadding="2" cellspacing="4" style="border-collapse: collapse" bordercolor="#222222" width="100%">
      <tr><td width="100%">当前位置:<a href="admin.asp">网站管理中心</a>--客户管理</td>
          </tr>
          <tr>
            <td width="100%">
<%action=request("action")
if request("search") = "ok" then	
	if request("men") <> "" then
	session("men")  = request("men")
	else
	session("men")  = ""
	end if
	
	if request("city") <> "" then
	session("city") = request("city")
	else
	session("city") = ""
	end if
	
	if request("Signup")<>"" then
	session("Signup")= request("Signup")
	else
	session("Signup") = ""
	end if
else
end if


if action="detail" then
	name=request("id")
	if request("send")="ok" then
		call saveinfo()
	else
		call detail()
	end if
end if

if action="删除" then
delnum=replace(request("num")," ","")
call clientdel()
end if

if action="增加" then
response.write "<tr><td height=50 align=center>增加客户模块开发中,请暂时从前台页面添加客户吧!</td></tr>"
response.write "<meta http-equiv=refresh content=""2;URL=admin_client.asp"">"
end if
if action="" then
%>
	<br>
	<table width=100% border=0 cellpadding=2 cellspacing=2>
	<form action="admin_client.asp" name="search" method=post><tr>
	<td>客户名 <input type="text" name="men" size="10" maxlength="20"></td>
	<td>城市 <input type="text" name="city" size="10" maxlength="20"></td>
	<td>注册时间<input type="radio" name="Signup" value="yesterday">昨天
	<input type="radio" name="Signup" value="today">今天
	<input type="radio" name="Signup" value="" checked>所有
	</td><input type="hidden" name="search" value="ok">
	<td><input type="submit" value="搜索"></td></tr>
	</form></table>
	<hr width="100%" size="1" noshade color=white><br>
	<table border="1" style="border-collapse: collapse;border:dotted 1px" bordercolor="#333333" cellpadding=3 width=100%>
	<form name=Prodlist action=admin_client.asp method=post><tr bgcolor="#003366">	
	<td nowrap align=center width=40>编号</td> 
	<td nowrap width=50  align=center>登陆名</td>
	<td nowrap align=center>真实名</td>
	<td nowrap width=80 align=center>城市</td>	
	<td nowrap align=center>注册日期</td>
	<td nowrap width=140 align=center>状态</td>
	<td>选</td>
	</tr>

<%
men=session("men")
city=session("city")
signup=session("Signup")
	dim rs,msg_per_page
	dim sqllist
	msg_per_page = 10 '定义每页显示记录条数
	set rs=server.createobject("adodb.recordset")
	sqllist="select * from UserMain where UserNum is not null"
	if men<>"" then sqllist=sqllist+ " and Username='"&men&"'"
	if city<>"" then sqllist=sqllist+ " and City='"&city&"'"
	if signup= "today" then sqllist = sqllist+ " and SignDate=Date()"
	if signup= "yesterday" then sqllist = sqllist+ " and SignDate=Date()-1"
	sqllist= sqllist+ " order by SignDate desc"

	rs.cursorlocation = 3 '使用客户端游标,可以使效率提高
	rs.pagesize = msg_per_page '定义分页记录集每页显示记录数
	rs.open sqllist,conn,1,1 
	if err.number<>0 then '错误处理
		response.write "<br><br><br>数据库操作失败:" & err.description
		err.clear
	else
		if not (rs.eof and rs.bof) then '检测记录集是否为空
			totalrec = RS.RecordCount 'totalrec:总记录条数
			if rs.recordcount mod msg_per_page = 0 then '计算总页数,recordcount:数据的总记录数
			n = rs.recordcount\msg_per_page 'n:总页数
			else 
			n = rs.recordcount\msg_per_page+1 
			end if 
			currentpage = request("page") 'currentpage:当前页
			If currentpage <> "" then
				currentpage = cint(currentpage)
				if currentpage < 1 then 
					currentpage = 1
				end if 
				if err.number <> 0 then 
					err.clear
					currentpage = 1
				end if
			else
				currentpage = 1
			End if 
			if currentpage*msg_per_page > totalrec and not((currentpage-1)*msg_per_page < totalrec)then 
				currentPage=1
			end if
			rs.absolutepage = currentpage 'absolutepage:设置指针指向某页开头
			rowcount = rs.pagesize 'pagesize:设置每一页的数据记录数
			dim i
			dim k

		Do While Not rs.eof and rowcount>0
		response.write "<tr><td class=b>"&rs("UserNum")&"</td><td class=b><a href='admin_client.asp?action=detail&id="&rs("UserId")&"'>"&rs("UserId")&"</a></td><td class=b>"&rs("UserName")&"</td><td class=b>"&rs("City")&"</td><td class=b>"&rs("SignDate")&"</td><td class=b>"&rs("Status")&"</td><td class=b><input type='checkbox' value='"&rs("UserNum")&"' name=num></td></tr>"
		rowcount=rowcount-1
		rs.movenext
		if rs.eof then
		exit do
		end if
		loop
	else
		response.write "<tr><td colspan=9 align=center class=b><BR>无满足搜索的条件客户<BR><BR></td></tr>"
	end if
	end if
	rs.close
	conn.close
	set rs=nothing
	set coon=nothing
%>
	<tr><td class=b><input type="submit" name="action" value="增加"></td><td colspan=5 class=b align=right>	
	<input type="submit" name="action" value="删除" onclick="{if(confirm('该操作不可恢复!\n\n确实删除选定的客户?')){this.document.Prodlist.submit();return true;}return false;}"> 	
	</td><td><input type='checkbox' name=chkall onclick='CheckAll(this.form)'></td></tr></form></table>
	<%call listPages()
end if%>

</td></tr></table>
</td></tr>
<tr>
      
    <td  height="10" align=center colspan="2">程序美工设计:九江市大地广告策划中心<%=sitever%></td>
    </tr>
	</table>
</body>
</html>


<%
sub listPages() 
if n <= 1 then exit sub 
%>
<p>>> 
<%if currentpage = 1 then%>
<font color=darkgray>首页</font>
<%else%> 
<font color=black face="arial"><a href="<%=request.ServerVariables("script_name")%>?page=1">
首页</font></a>
 <a href="<%=request.ServerVariables("script_name")%>?page=<%=currentpage-1%>">
<font color=black face="arial" >前页</a></font>

⌨️ 快捷键说明

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