<!--#include file="Include/Gaobei_setup.asp"-->
<!--#include file="conn.asp"-->
<!--#include file="Include/check.asp"-->
<!--#include file="other/Gaobei_md5.asp" -->
<%CheckAdmin3%>
<%
function cutstr(str,strlen,more,url)
if len(str)>strlen then
str=left(str,strlen) & "......"
end if
if (len(str)>strlen) and more then
str=str+" [url="+url+"]点这里查看详情[/url]"
end if
cutstr=str
end function
function AutoUrl(str)
on error resume next
Set url=new RegExp
url.IgnoreCase =True
url.Global=True
url.MultiLine = True
url.Pattern = "^(http://[A-Za-z0-9\./=\?%\-&_~`@:+!]+)"
str = url.Replace(str,"[url=$1]$1[/url]")
url.Pattern = "(http://[A-Za-z0-9\./=\?%\-&_~`@:+!]+)$"
str = url.Replace(str,"[url=$1]$1[/url]")
url.Pattern = "^(www.[A-Za-z0-9\./=\?%\-&_~`@:+!]+)"
str = url.Replace(str,"[url=http://$1]$1[/url]")
url.Pattern = "(www.[A-Za-z0-9\./=\?%\-&_~`@:+!]+)$"
str = url.Replace(str,"[url=http://$1]$1[/url]")
set url=Nothing
AutoUrl=str
end function
Rem 判断数字是否整形
function isInteger(para)
on error resume next
dim str
dim l,i
if isNUll(para) then
isInteger=false
exit function
end if
str=cstr(para)
if trim(str)="" then
isInteger=false
exit function
end if
l=len(str)
for i=1 to l
if mid(str,i,1)>"9" or mid(str,i,1)<"0" then
isInteger=false
exit function
end if
next
isInteger=true
if err.number<>0 then err.clear
end function
Function FormatStr(String)
on Error resume next
String = Replace(String, CHR(13), "")
String = Replace(String, CHR(32), " ")
String = Replace(String, "", " ")
String = Replace(String, "<", "<")
String = Replace(String, ">", ">")
String = Replace(String, CHR(10) & CHR(10), "<BR><BR>")
String = Replace(String, CHR(10), "<BR>")
FormatStr = String
End Function
Function Ubb2Html(str, showemot, showimg)
ON ERROR RESUME NEXT
if not str<>"" then exit function
tmpstr="uNobwab"
str=UbbStr(str,"url")
str=UbbStr(str,"quote")
str=UbbStr(str,"color")
str=UbbStr(str,"size")
str=UbbStr(str,"face")
if showemot then
for i=1 to 16
str=replace(str,":em"&i&":","<img src='emot/em"&i&".gif'>",1,6,1)
str=replace(str,":em"&i&":","",1,-1,1)
next
end if
if showimg then
str=UbbStr(str,"img")
str=UbbStr(str,"swf")
str=UbbStr(str,"dir")
str=UbbStr(str,"rm")
str=UbbStr(str,"mp")
str=UbbStr(str,"qt")
end if
str=UbbStr(str,"frame")
str=replace(str,"","<b>",1,-1,1)
str=replace(str,"","</b>",1,-1,1)
str=replace(str,"","<u>",1,-1,1)
str=replace(str,"","</u>",1,-1,1)
str=replace(str,"
","<br>",1,-1,1)
str=replace(str,"
","<center>",1,-1,1)
str=replace(str,"
str=replace(str,"[fly]","<marquee>",1,-1,1)
str=replace(str,"[/fly]","</marquee>",1,-1,1)
str=replace(str,"["&tmpstr,"[",1,-1,1)
str=replace(str,tmpstr&"]","]",1,-1,1)
str=replace(str,"/"&tmpstr,"/",1,-1,1)
Ubb2Html=str
End Function
%>
<%
'日期格式转换函数
function DateTimeFormat(DateTime,Format)
select case Format
case "1"
DateTimeFormat=""&year(DateTime)&"年"&month(DateTime)&"月"&day(DateTime)&"日"
case "2"
DateTimeFormat=""&month(DateTime)&"月"&day(DateTime)&"日"
case "3"
DateTimeFormat=""&year(DateTime)&"-"&month(DateTime)&"-"&day(DateTime)&""
case "4"
DateTimeFormat=""&year(DateTime)&"/"&month(DateTime)&"/"&day(DateTime)&""
case "5"
DateTimeFormat=""&month(DateTime)&"/"&day(DateTime)&""
case "6"
DateTimeFormat=""&year(DateTime)&"年"&month(DateTime)&"月"&day(DateTime)&"日<font color=red> "&FormatDateTime(DateTime,4)&"</font>"
case "7"
temp="星期日,星期一,星期二,星期三,星期四,星期五,星期六"
temp=split(temp,",")
DateTimeFormat=temp(Weekday(DateTime)-1)
case else
DateTimeFormat=DateTime
end select
end function
%>
<HTML><HEAD><TITLE>商品管理系统 -- 商品管理</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<link href="other/Admin.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
a:link {
color: #663399;
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #663399;
}
a:hover {
text-decoration: underline;
color: #CC3300;
}
a:active {
text-decoration: none;
}
-->
</style>
<SCRIPT LANGUAGE=javascript>
//实现反向选择
<!--
function SelectAll() {
for (var i=0;i<document.selform.selUserID.length;i++) {
var e=document.selform.selUserID[i];
e.checked=!e.checked;
}
}
//-->
</script>
</HEAD>
<p align="center">客户管理系统 V 1.0<br><br><a href="admin_khedit.asp?action=newsoft">添加客户信息</a> | <a href="admin_kehu.asp?action=list">修改客户信息</a></p>
<body>
<%
dim selUserID
if not isempty(request("selUserID")) then
selUserID=request("selUserID")
if request("action")="删除" then
call delUser()
elseif request("action")="激活" then
call kh_isactive()
elseif request("action")="锁定" then
call noActive()
elseif request("action")="设为普通客户" then
call general()
elseif request("action")="设为VIP客户" then
call vipuser()
elseif request("action")="设为大宗客户" then
call dzkhuser()
else
response.write "无效的参数!"
response.end
end if
end if
sub delUser()
conn.execute("delete from kehu_table where kh_id in ("&selUserID&")")
end sub
sub kh_isactive()
conn.execute("update kehu_table set kh_isactive=1 where kh_id in ("&selUserID&")")
end sub
sub noActive()
conn.execute("update kehu_table set kh_isactive=0 where kh_id in ("&selUserID&")")
end sub
sub general()
conn.execute("update kehu_table set kh_grade=0 where kh_id in ("&selUserID&")")
end sub
sub vipuser()
conn.execute("update kehu_table set kh_grade=1 where kh_id in ("&selUserID&")")
end sub
sub dzkhuser()
conn.execute("update kehu_table set kh_grade=2 where kh_id in ("&selUserID&")")
end sub
set rs=server.createobject("adodb.recordset")
%>
<% if request.querystring("action")="list" then
dim keyword,colname,totalsoft,Currentpage,totalpages,i
keyword=trim(replace(request.form("keyword"),"'",""))
colname=request("colname")
sql="select kh_id,kh_bianhao,kh_name,kh_bir,kh_address,kh_shangping,kh_money,kh_jifen,kh_tel,kh_email,kh_grade,kh_sex,kh_time,kh_isactive from kehu_table order by kh_time desc"
if keyword<>"" and colname<>"0" then
sql="select kh_id,kh_bianhao,kh_name,kh_bir,kh_address,kh_shangping,kh_money,kh_jifen,kh_tel,kh_email,kh_grade,kh_sex,kh_time,kh_isactive from kehu_table where "&colname&" like '%"&keyword&"%' order by kh_time desc"
else
sql="SELECT kh_id,kh_bianhao,kh_name,kh_bir,kh_address,kh_shangping,kh_money,kh_jifen,kh_tel,kh_email,kh_grade,kh_sex,kh_time,kh_isactive from kehu_table order by kh_time desc"
end if
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
%>
<table width="98%" align="center" border="0" cellspacing="0" cellpadding="4" style="border-collapse: collapse">
<tr>
<form name="form1" method="post" action="admin_kehu.asp?action=list"><td align="center">
<select name="colname"><option value=0 selected>--==客户信息检索==--</option><option value="kh_bianhao">客户编号</option><option value="kh_name">客户姓名</option><option value="kh_shangping">客户购买商品</option><option value="kh_address">客户地址</option></select> <input type="text" name="keyword" class="textarea" size="40"> <input type="submit" name="Submit" value="开 始 搜 索" class="button"></form>
</td></tr></table>
<table align="center" width="98%" border="1" cellspacing="0" cellpadding="4" style="border-collapse: collapse">
<tr>
<td width="10%" align="center"><b><font color="#ff0000">客户编号</font></b></td>
<td width="4%" align="center"><b><font color="#ff0000">选择</font></b></td>
<td width="6%" align="center"><b><font color="#ff0000">姓名</font></b></td>
<td width="4%" align="center"><b><font color="#ff0000">性别</font></b></td>
<td width="12%" align="center"><b><font color="#ff0000">加入时间</font></b></td>
<td width="4%" align="center"><b><font color="#ff0000">积分</font></b></td>
<td width="8%" align="center"><b><font color="#ff0000">联系电话</font></b></td>
<td width="10%" align="center"><b><font color="#ff0000">客户状态*级别</font></b></td>
<td width="10%" align="center"><b><font color="#ff0000">管理操作</font></b></td>
</tr>
</table>
<table align="center" width="98%" border="1" cellspacing="0" cellpadding="2" style="border-collapse: collapse">
<%
dim softperpage
softperpage = 10
if not rs.eof then
rs.movefirst
rs.pagesize=softperpage
if trim(request("page"))<>"" then
currentpage=clng(request("page"))
if currentpage>rs.pagecount then
currentpage=rs.pagecount
end if
else
currentpage=1
end if
totalsoft=rs.recordcount
if currentpage<>1 then
if (currentpage-1)*softperpage<totalsoft then
rs.move(currentpage-1)*softperpage
dim bookmark
bookmark=rs.bookmark
end if
end if
if (totalsoft mod softperpage)=0 then
totalpages=totalsoft\softperpage
else
totalpages=totalsoft\softperpage+1
end if
i=0
do while not rs.eof and i<softperpage
%>
<form name="selform" method="post" action="admin_kehu.asp?action=list">
<tr>
<td height="18" align="center" width="10%" class="forumRow"><%=rs("kh_bianhao")%></td>
<td width="4%" align="center" class="forumRow"><input type="checkbox" name="selUserID" id="selUserID" value="<%=rs("kh_id")%>" style="border:0PX "></td>
<td align="center" width="6%" class="forumRow"><font color="#663366"><b><a href="Admin_khshow.asp?ID=<%=rs("kh_id")%>&action=show" title=显示客户资料 class="ArticleList"><%=rs("kh_name")%></a></b></font></td>
<td align="center" width="4%">
<%
if rs("kh_sex")=0 then
response.write "男"
else
response.write "女"
end if
%>
</td>
<td align="center" width="12%"><%=rs("kh_time")%></td>
<td align="center" width="4%"><%=rs("kh_jifen")%></td>
<td align="center" width="8%"><%=rs("kh_tel")%></td>
<td align="center" width="10%">
<%
if rs("kh_isactive")=1 then
response.write "正常"
else
response.write "锁定"
end if
%>
*
<font color="#ff0000"><%if rs("kh_grade")=0 then%>
普通客户
<%end if%>
<%if rs("kh_grade")=1 then%>
VIP 客户
<%end if%>
<%if rs("kh_grade")=2 then%>
大宗客户
<%end if%>
</font>
</td>
<td width="10%" align="center"><font color="#0000ff"><a href="Admin_khedit.asp?ID=<%=rs("kh_id")%>&action=editsoft" title=编辑客户资料 class="ArticleList">编辑</a>|<a href="Admin_khedit.asp?ID=<%=rs("kh_id")%>&action=delsoft" title=删除客户资料 class="ArticleList">删除</a></font>|<a href="Admin_khbuy.asp?ID=<%=rs("kh_id")%>&action=list" title=此客户购买 class="ArticleList">购买商品</a></font></td>
</tr>
<%i=i+1
rs.movenext
loop
else
if rs.eof and rs.bof then%>
<tr>
<td align="center">暂时还没有客户!</td>
</tr>
<%end if
end if%>
<tr bgcolor="#EAEAEA" >
<td colspan="9" class="forumRow" align="center">管理操作:反选→<input type="checkbox" name="checkbox" value="checkbox" onClick="javascript:SelectAll()" style="border:0PX ">
<input class="kuang" onClick="{if(confirm('确定删除选定的客户吗?')){this.document.selform.submit();return true;}return false;}" type=submit value=删除 name=action>
<input class="kuang" onClick="{if(confirm('确定激活选定的客户吗?')){this.document.selform.submit();return true;}return false;}" type=submit value=激活 name=action>
<input class="kuang" onClick="{if(confirm('确定锁定选定的客户吗?')){this.document.selform.submit();return true;}return false;}" type=submit value=锁定 name=action>
<input class="kuang" onClick="{if(confirm('确定把选定的客户设为普通客户吗?')){this.document.selform.submit();return true;}return false;}" type=submit value=设为普通客户 name=action>
<input class="kuang" onClick="{if(confirm('确定把选定的客户设为VIP客户吗?' )){this.document.selform.submit();return true;}return false;}" type=submit value=设为VIP客户 name=action>
<input class="kuang" onClick="{if(confirm('确定把选定的客户设为大宗客户吗?' )){this.document.selform.submit();return true;}return false;}" type=submit value=设为大宗客户 name=action>
<input class="kuang" type=button name="Submit" value="所有客户" onClick="self.location='Admin_kehu.asp?action=list'" > </td>
</tr>
</form>
</table>
<table align="center" width="98%">
<form name="form3" method="post" action="admin_kehu.asp?action=list&keyword=<%=request("keyword")%>&colname=<%=request("colname")%>">
<tr>
<td align="right">当前第<%=currentpage%>页,共<%=totalpages%>页,共<%=totalsoft%>条记录,每页<%=softperpage%>条记录。页码:
<%
i=1
showye=totalpages
if showye>10 then
showye=10
end if
for i=1 to showye
if i=currentpage then
%>
<%=i%>
<%else%>
<a href="admin_kehu.asp?action=list&page=<%=i%>&keyword=<%=request("keyword")%>&colname=<%=request("colname")%>"><%=i%></a>
<%end if
next
if totalpages>currentpage then
if request("page")="" then
page=1
else
page=request("page")+1
end if%>
<a href="admin_kehu.asp?action=list&page=<%=i%>" title="下一页">>></a>
<%end if%>
写入页码:
<input type="text" name="page" class="textarea" size="4">
<input type="submit" name="Submit" value="转到所需页" class="button">
</td>
</tr>
</form>
</table>
</body></html>
<%
end if
rs.close
set rs=nothing
%>
[此贴子已经被作者于2006-8-28 13:46:51编辑过]