📄 user1.asp
字号:
<!--#include file="../include/buyok_shop_30_conn.asp"-->
<!--#include file="../chopchar.asp"-->
<!--#include file="checkadmin.asp"-->
<script language=javascript src=../include/mouse_on_title.js></script>
<%call checkmanage("05")%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="manage.css" type="text/css">
<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 background="../images/admin/back.gif">
<%
action=request("action")
if action="" then call user()
if action="useredit" then
if request("edit")="ok" then
call save()
else
call edit()
end if
end if
if action="del" then call userdel()
sub user()
'会员首页
%>
<table width="98%" border="1"style="border-collapse: collapse; border-style: dotted; border-width: 0px"bordercolor="#333333" cellspacing="0" cellpadding="2">
<form action=user1.asp method=post name=user>
<td colspan=7 class=td height=25>注册会员管理 </td></tr>
<%
usersql=request.cookies("buyok")("usersql")
if request("show")="yes" then
response.cookies("buyok")("usersql")=""
end if
pages = 20
set rs=server.createobject("adodb.recordset")
sql="select * from buyok_user where UserNum is not null "
if request("show")<>"yes" then sql=sql+usersql
sql=sql+" order by SignDate desc"
rs.open sql,conn,1,3
if rs.eof and rs.bof then
response.write "<tr><td colspan=7 align=center height=50>暂时没有会员</td></tr>"
response.end
else
totalrs=rs.RecordCount
rs.pageSize = pages
allPages = rs.pageCount
page = Request("page")
If not isNumeric(page) then page=1
if isEmpty(page) or int(page) <=1 then
page = 1
elseif int(page) > allPages then
page = allPages
end if
rs.AbsolutePage = page
%>
<tr>
<td align=center width=5%>选</td>
<td align=center width='18%'>会员ID</td>
<td align=center width='18%'>会员姓名</td>
<td align=center width='15%'>会员级别</td>
<td align=center width='16%'>注册日期</td>
<td align=center width='16%'>上次登陆</td>
<td align=center width='12%'>登陆次数</td>
</tr>
<% Do While Not rs.eof and pages>0
usertype=rs("usertype")
if usertype="2" then
usertype=type2
elseif usertype="3" then
usertype=type3
elseif usertype="4" then
usertype=type4
elseif usertype="5" then
usertype=type5
elseif usertype="6" then
usertype=type6
else
usertype=type1
end if
%>
<tr><td><input type='checkbox' value='<%=rs("UserNum")%>' name=num></td>
<td><a href='user1.asp?action=useredit&id=<%=rs("UserId")%>'><%=rs("UserId")%></a></td>
<td><%=rs("UserName")%></td><td><%=usertype%></td>
<td><span alt="<%=rs("SignDate")%>"><%=split(rs("SignDate")," ")(0)%></span></td>
<td><span alt="<%=rs("lastlogin")%>"><%=split(rs("lastlogin")," ")(0)%></span></td>
<td align=center><%=rs("totallogin")%></td></tr>
<%
pages = pages - 1
rs.movenext
if rs.eof then exit do
loop
end if
%>
<tr><td colspan=7>
<input type='checkbox' name=chkall onclick='CheckAll(this.form)'>全选
<input type=hidden name=action value="del">
<input type=submit value="删除" onclick="{if(confirm('确认要删除选定的会员吗?')){this.document.user.submit();return true;}return false;}">
</td></tr>
</form>
</table>
<%
'if allpages<=1 then exit sub
response.write "<br>总会员数<font color=red>"&totalrs&"</font> 每页<font color=red>20</font> "
if page <= 1 then
response.write "<font color=darkgray>首页 前页</font>"
else
response.write "<a href=user1.asp?keywords="&keywords&"&page=1>首页</a> <a href=user1.asp?keywords="&keywords&"&page="&page-1&">前页</a>"
end if
if page = allpages then
response.write "<font color=darkgray> 下页 末页</font>"
else
response.write " <a href=user1.asp?keywords="&keywords&"&page="&page+1&">下页</a> <a href=user1.asp?keywords="&keywords&"&page="&allpages&">末页</a>"
end if
response.write " 第"&page&"页 共"&allpages&"页"
end sub
sub edit()
'修改会员资料
name=request("id")
set rs=conn.execute("select * from buyok_user where UserId='"&name&"'")
if rs.eof and rs.bof then
response.write "<script language='javascript'>"
response.write "alert('出错了,没有此用户。');"
response.write "location.href='javascript:history.go(-1)';"
response.write "</script>"
response.end
end if
usertype=rs("usertype")
if usertype="2" then
usertype=type2
userkou=kou2
elseif usertype="3" then
usertype=type3
userkou=kou3
elseif usertype="4" then
usertype=type4
userkou=kou4
elseif usertype="5" then
usertype=type5
userkou=kou5
elseif usertype="6" then
usertype=type6
userkou=kou6
else
usertype=type1
userkou=kou1
end if
%>
<table width="98%" border="1"style="border-collapse: collapse; border-style: dotted; border-width: 0px"bordercolor="#333333" cellspacing="0" cellpadding="2">
<form name="myinfo" action="user1.asp?action=useredit" method="post">
<tr><td colspan=2 class=td height=25>查看/编辑会员资料 </td></tr>
<tr><td width='20%' align=right height=25>会员ID </td>
<td><%=Name%></td>
</tr>
<tr><td width='20%' align=right height=25>推荐人 </td>
<td><%=rs("tjr")%></td>
</tr>
<tr><td width='20%' align=right height=25>注册时间 </td>
<td><%=rs("SignDate")%></td>
</tr>
<tr><td width='20%' align=right height=25>上次登陆时间 </td>
<td><%=rs("lastlogin")%></td>
</tr>
<tr><td width='20%' align=right height=25>上次登陆IP </td>
<td><%=rs("IP")%></td>
</tr>
<tr><td width='20%' align=right height=25>登陆次数 </td>
<td><%=rs("totallogin")%> 次</td>
</tr>
<tr><td align=right height=25>消费总金额 </td>
<td><input type="text" name="totalsum" value="<%if rs("totalsum")<>"" then response.write formatnum(rs("totalsum"),2)%>" maxlength=8> <img src=../images/admin/memo.gif alt="订单完成后,会自动追加金额<br>管理员亦可手工修改此处金额"> </td></tr>
<tr><td width='20%' align=right height=25>会员等级 </td>
<td><select size="1" name="usertype">
<option value="1" <%if usertype=type1 then%>selected<%end if%>><%=type1%></option>
<%if type2<>"" then%>
<option value="2" <%if usertype=type2 then%>selected<%end if%>><%=type2%></option>
<%if type3<>"" then%>
<option value="3" <%if usertype=type3 then%>selected<%end if%>><%=type3%></option>
<%if type4<>"" then%>
<option value="4" <%if usertype=type4 then%>selected<%end if%>><%=type4%></option>
<%if type5<>"" then%>
<option value="5" <%if usertype=type5 then%>selected<%end if%>><%=type5%></option>
<%if type6<>"" then%>
<option value="6" <%if usertype=type6 then%>selected<%end if%>><%=type6%></option>
<%
end if
end if
end if
end if
end if%>
</select>
</td></tr>
<tr><td width='20%' align=right height=25>购物折扣 </td>
<td><input type="text" name="userkou"value="<%=FormatNumber(userkou,2)%>" disabled></td>
</tr>
<tr><td align=right height=25>会员密码 </td>
<td><input type="text" name="Userpassword" value="" maxlength="16">
<img src=../images/admin/memo.gif alt="若不修改密码,请空出">
</td></TR>
<tr><td width='20%' align=right height=25>真实姓名 </td>
<td><input type="text" name="Username" value="<%=rs("UserName")%>" maxlength="16"></td>
</tr>
<tr><td align=right height=25>电子邮箱 </td>
<td><input type="text" name="UserMail" value="<%=rs("UserMail")%>" maxlength="100">
<a href='sendmail.asp?<%=rs("UserMail")%>'><img alt='发邮件' border=0 src='../images/small/e-mail.gif'></a>
</td></tr>
<tr><td align=right height=25>联系地址 </td>
<td><input type="text" name="Address" value="<%=rs("Address")%>" maxlength="100"></td>
</tr>
<tr><td align=right height=25>邮政编码 </td>
<td><input type="text" name="ZipCode" value="<%=rs("ZipCode")%>" maxlength="8"></td>
</tr>
<tr><td align=right height=25>联系电话 </td>
<td><input type="text" name="HomePhone" value="<%=rs("HomePhone")%>" maxlength="20"></td>
</tr>
<tr><td align=right height=25>移动电话 </td>
<td><input type="text" name="CompPhone" value="<%=rs("CompPhone")%>" maxlength="20"></td>
</tr>
<tr><td align=right height=25>腾讯QQ </td>
<td><input type="text" name="UserQQ" value="<%=rs("UserQQ")%>" maxlength="11">
<%if rs("UserQQ")<>"" then%><a target=blank href=http://wpa.qq.com/msgrd?V=1&Uin=<%=rs("UserQQ")%>&Site=<%=sitename%>&Menu=yes><img border="0" SRC=http://wpa.qq.com/pa?p=1:<%=rs("UserQQ")%>:6 alt="与该会员交谈或留言"></a><%end if%>
</td></tr>
<tr><td align=right height=25>ICQ号 </td>
<td><input type="text" name="UserICQ" value="<%=rs("UserICQ")%>" maxlength="15"></td>
</tr>
<tr><td align=right height=25>MSN号 </td>
<td><input type="text" name="UserMSN" value="<%=rs("UserMSN")%>" maxlength="100"></td>
</tr>
<tr><td align=right height=25>国家 </td>
<td><input type="text" name="Country" value="<%=rs("Country")%>"></td>
</tr>
<tr><td align=right height=25>省份 </td>
<td><input type="text" name="Province" value="<%=rs("Province")%>"></td>
</tr>
<tr><td align=right height=25>城市 </td>
<td><input type="text" name="City" value="<%=rs("City")%>"></td>
</tr>
<tr><td align=right height=25>性别 </td>
<td><input name="Sex" type="radio" value="1" <%if rs("Sex")="1" then response.write "checked"%>>帅哥
<input type="radio" name="Sex" value="0" <%if rs("Sex")="0" then response.write "checked"%>>靓妹
</td></tr>
<tr><td align=right height=25>生日 </td>
<td><input type="text" name="Birthday" value="<%=rs("Birthday")%>"></td>
</tr>
<tr><td align=right height=25>个人说明 </td>
<td><TEXTAREA style="overflow:auto;" type="text" name="Memo" ROWS="3" COLS="40"><%=rs("Memo")%></TEXTAREA></td>
</tr>
<tr><td align=right height=25>管理附言 </td>
<td><TEXTAREA style="overflow:auto;background-color: #FFFFCC;" type="text" name="Memo2" ROWS="3" COLS="40"><%=rs("Memo2")%></TEXTAREA>
<img src=../images/admin/memo.gif alt="管理员此处添加的信息<br>会员只能查看不能修改<br>此信息在会员的个人资料页中滚动提示"> </td></tr>
<tr><td align=right height=25>会员状态 </td>
<td>
<input name="Status" type="radio" value="1" <%if rs("Status")<>"0" then%>checked<%end if%>>正常/通过审核
<input name="Status" type="radio" value="0" <%if rs("Status")="0" then%>checked<%end if%>>锁定/未审核
</tr>
<tr><td colspan=2>
<input name="id" type="hidden" value="<%=rs("UserId")%>">
<input name="edit" type="hidden" value="ok">
<input type="submit" name="Submit" value="确认修改">
<input alt='给此会员发送站内消息' type="button" value="发送站内消息" onClick="javascript:location.href='hand2.asp?back=user&name=<%=rs("UserId")%>';" >
</td></tr>
</form>
</table>
<%
set rs=nothing
end sub
sub save()
'保存会员资料
name=request("id")
sql = "select * from buyok_user where UserId='"&name&"'"
set rs=Server.Createobject("ADODB.RecordSet")
rs.Open sql,conn,1,3
if rs.eof and rs.bof then
response.write "<script language='javascript'>"
response.write "alert('出错了,没有此会员。');"
response.write "location.href='user1.asp';"
response.write "</script>"
response.end
rs.close
set rs=nothing
end if
rs("Usertype") = request("usertype")
rs("userkou") = request("usertype")
rs("Username") = trim(request("Username"))
rs("Sex") = request("Sex")
if trim(request("totalsum"))<>"" then rs("totalsum")= trim(request("totalsum"))
rs("UserQQ") = trim(request("UserQQ"))
rs("UserICQ") = trim(request("UserICQ"))
rs("UserMSN") = trim(request("UserMSN"))
rs("Birthday") = trim(request("Birthday"))
rs("HomePhone")= trim(request("HomePhone"))
rs("CompPhone") = trim(request("CompPhone"))
rs("UserMail") = trim(request("UserMail"))
rs("Country") = trim(request("Country"))
rs("Province") = trim(request("Province"))
rs("City") = trim(request("City"))
rs("Address") = trim(request("Address"))
rs("ZipCode") = trim(request("ZipCode"))
rs("Memo") = request("Memo")
rs("Memo2") = request("Memo2")
rs("Status") = request("Status")
if trim(request("Userpassword"))<>"" then rs("Userpassword")=md5(trim(request("Userpassword")))
rs.update
rs.close
set rs = nothing
response.write "<script language='javascript'>"
response.write "alert('操作成功,会员资料已保存!');"
response.write "location.href='user1.asp?action=useredit&id="&name&"';"
response.write "</script>"
response.end
end sub
sub userdel()
delnum=request("num")
if delnum="" or isnull(delnum) then
response.write "<script language='javascript'>"
response.write "alert('出错了,您什么也没有选择!');"
response.write "location.href='user1.asp';"
response.write "</script>"
response.end
end if
conn.execute("delete from buyok_user where UserNum in ("&delnum&")")
response.write "<script language='javascript'>"
response.write "alert('操作成功,选定的会员已被删除!');"
response.write "location.href='user1.asp';"
response.write "</script>"
response.end
conn.close
set conn=nothing
end sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -