<%
'程序名称：千纸鹤网站管理系统
'程序作者：千纸鹤
'作者邮箱：qzhxxw@sina.com
'作者 Q Q：138999501
'作者电话：0000000000
'官方主页：http://www.qqzzhh.com/
'官方论坛：http://www.qqzzhh.com/bbs
%>
<!--#include file="inc/conn.asp"-->
<!--#include file="inc/set.asp"-->
<!--#include file="inc/dll.asp"-->
<!--#include file="inc/md5.asp"-->
<%
call hacker()
if session("superlogin")<>yecao then
response.Write "<script>alert('您还没有登陆！');this.location.href='index.asp';</script>"
Response.End
elseif session("superadmin")<>"admin" then
response.Write "<script>alert('您不是超级管理员！您的权限不足！');this.location.href='index.asp';</script>"
Response.End
end if%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script src=img/adminjs.js></script>
<link rel="STYLESHEET" type="text/css" href="img/admin.css"><body style="margin:0;padding:0">
<%if request("action")="del" then
Conn.Execute("Delete * From YC_user Where id="&Request.QueryString("id"))
Response.Write("<script>alert('删除成功！');this.location.href='admin_user.asp';</script>")
response.end
end if
if request.form("edit")<>"" then
set rs=server.CreateObject("adodb.recordset")
sql="select * from YC_user where id="&request("id")
rs.open sql,conn,1,3
rs("user_name")=request.Form("user")
if request("pass")<>"" then
rs("user_Pass")=MD5(trim(replace(request("pass"),"'","")))
end if
rs("user_question")=request.Form("question")
if request("answer")<>"" then
rs("user_answer")=MD5(trim(replace(request("answer"),"'","")))
end if
rs("user_true_name")=request.Form("truename")
rs("user_sex")=request.Form("sex")
rs("user_web")=request.Form("web")
rs("user_qq")=request.Form("qq")
rs("user_mail")=request.Form("mail")
rs("user_money")=request.Form("money")
rs("user_face")=request.Form("face")
rs("user_address")=request.Form("address")
rs("user_admin")=request.Form("admin")
rs.update
rs.close
response.Redirect"admin_user.asp"
set rs=nothing
elseif  request.form("new")<>"" then
set rs=server.CreateObject("adodb.recordset")
rs.open "YC_user",conn,1,3
rs.addnew
rs("user_name")=request.Form("user")
rs("user_pass")=MD5(trim(replace(request("pass"),"'","")))
rs("user_question")=request.Form("question")
rs("user_answer")=MD5(trim(replace(request("answer"),"'","")))
rs("user_true_name")=request.Form("truename")
rs("user_sex")=request.Form("sex")
rs("user_web")=request.Form("web")
rs("user_qq")=request.Form("qq")
rs("user_face")=request.Form("face")
rs("user_mail")=request.Form("mail")
rs("user_address")=request.Form("address")
rs("user_admin")=request.Form("admin")
rs.update
rs.close
set rs=nothing
response.write"<script>location.href='admin_user.asp';</script>"
elseif request("action")="nopass" then
Conn.Execute("update YC_user set pass=false where id="&request.querystring("id"))
response.Redirect"admin_user.asp"
elseif request("action")="pass" then
Conn.Execute("update YC_user set pass=true where id="&request.querystring("id"))
response.Redirect"admin_user.asp"
elseif request("action")=""then%>
<table width="100%" align=center border="0" cellpadding="0" cellspacing="0" bordercolor="<%=border%>" rules=none class=3d> 
<tr><td height="22" colspan="8" class=title><b>&nbsp;<img src=img/ie.gif border=0 width=15 height=15 align=absMiddle>&nbsp;用户管理</b></td></tr>
<form  method="post" name="form" id="form" action="del.asp" onsubmit="return downdel();">
<tr class=bg height="25"><td width="5%"  align=center>选定</td>
<td width="25%" align=center>会员名</td>
<td width="5%"align=center>性别</td>
<td width="10%"align=center>点数</td>
<td width="10%"align=center>登陆</td>
<td width="20%"align=center>级别</td>
<td width="15%"align=center>状态</td>
<td width="10%" align=center>操作</td></tr><tr><td class="hr" colspan="8"></td></tr>
<%set rs=server.CreateObject("adodb.recordset")
sql="select * from YC_user order by id desc"
rs.open sql,conn,1,1
if not rs.bof and not rs.eof then
rs.pagesize=cint(adminpage)
i=1
mypage=request("page")
if mypage="" then
mypage=1
else
mypage=cint(mypage)
end if
pages=rs.pagecount
rs.absolutepage=mypage
do while not rs.eof%>
<tr height=25 class=bg  onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#efefef'">
<td align=center>
<input name='SoftID' type='checkbox' onclick="unselectall()" id="SoftID" value='<%=rs("id")%>'></td>
<td><img src="<%=rs("user_face")%>" title="<img src=<%=rs("user_face")%> border=1>" width=16 height=16 border=1 align=absmiddle>&nbsp;<a href="?action=edit&id=<%=rs("id")%>"><%=rs("user_name")%></a></td>
<td align=center><%=rs("user_sex")%></td>
<td align=center><%=rs("user_money")%></td><td width="10%"align=center><%=rs("user_login_time")%></td>
<td align=center>
<%if rs("user_admin")="1" then 
response.write "普通会员" 
elseif rs("user_admin")="2" then
response.write "<font color=blue>VIP 会员</font>"
elseif rs("user_admin")="3" then
response.write "<font color=red>管理人员</font>"
else
response.write "非法会员"
end if%>
</td>
<td align=center>
<%if rs("pass")=false then%>
&nbsp;<a href="?action=pass&id=<%=rs("id")%>"><font color=red><b>等待通过</b></font></a>
<%else%>
&nbsp;<a href="?action=nopass&id=<%=rs("id")%>">取消通过</a>
<%end if%>
</td>
<td align=center>&nbsp;<a href="?action=edit&id=<%=rs("id")%>">编辑</a>
</td></tr><tr><td class="hr" colspan="8"></td></tr>
<%
if i=rs.pagesize then exit do end if
i=i+1
rs.movenext
loop
end if
if rs.eof and rs.bof then
response.write"<tr><td colspan=6 height=100 align=center>暂时没有注册会员！</td></tr>"
else%>
<tr class=bg><td  height=25 colspan=6>
<table width=100% border=0><tr><td width=200>
&nbsp;<input name="chkAll" type="checkbox" id="chkAll" onclick=CheckAll(this.form) value="checkbox">
<input name="submit" type="submit" onClick="document.form.Action.value='Del'" value="删 除" class=adminbutton>
<input name="Action" type="hidden" id="Action" value="Del">
<input name="tab" type="hidden" id="tab" value="YC_user">
<input name="url" type="hidden" id="url" value="admin_user.asp">
</td><td>
&emsp;&emsp;共有会员<font color=red><%=rs.recordcount%></font>条，每页<font color=red><%=rs.pagesize%></font>条，分<font color=red><%=mypage%></font>/<%=rs.pagecount%>页&emsp;&emsp;&emsp;
<script language="javascript">
function showPageLink(sUrl,iPage,iCount){
var i;
i=Math.max(1,iPage-1);
document.write("<a href=\""+sUrl+"1\"><FONT face=Webdings>9</FONT></a> ");
document.write("<a href=\""+sUrl+i+"\"><FONT face=Webdings>7</FONT></a> <b>");
for(i=Math.max(1,iPage-5);i<iPage;i++){
document.write("<a href=\""+sUrl+i+"\">"+i+"</a> ");}
document.write("<font color='#ff3333'>"+iPage+"</font> ");
for(i=iPage+1;i<=Math.min(iCount,iPage+5);i++){
document.write("<a href=\""+sUrl+i+"\">"+i+"</a> ");}
i=Math.min(iCount,iPage+1);
document.write("</b><a href=\""+sUrl+i+"\"><FONT face=Webdings>8</FONT></a> ");
document.write("<a href=\""+sUrl+iCount+"\"><FONT face=Webdings>:</FONT></a> ");}
showPageLink("?page=",<%=mypage%>,<%=pages%>);
</script>
</td></tr>
</table>
</td></tr>
</form>
<%end if%>
</table>
<%
rs.close
set rs=nothing%>
<%elseif request("action")="new" then%><br>
<form method="post" name="form" id="form">
<table width="400" align=center border="0" cellpadding="0" cellspacing="0" bordercolor="<%=border%>" rules=none class=3d>
<tr><td height="22"  class=title><b>&nbsp;<img src=img/ie.gif border=0 width=15 height=15 align=absMiddle>&nbsp;添加会员</b></td></tr>
<tr class=bg height=25><td>&nbsp;会员名称：<input name="user" type="text" id="user"  size="20" class=yecao style="width:120px">
</td></tr>
<tr height="25" class=bg><td>&nbsp;会员密码：<input name="pass" type="text"  id="pass" size="20" class=yecao style="width:120px"></td></tr>
<tr height="25" class=bg><td>&nbsp;密码问题：<input name="question" type="text"  id="pass" size="20" class=yecao style="width:120px"></td></tr>
<tr height="25" class=bg><td>&nbsp;问题答案：<input name="answer" type="text"  id="pass" size="20" class=yecao style="width:120px"></td></tr>
<tr class=bg height="25"><td>&nbsp;会员级别：<select name="admin" class=yecao>
<option value="3">管理人员</option>
<option value="2">贵宾会员</option>
<option value="1">普通会员</option>
</select>
</td></tr>
<tr height="25" class=bg><td>&nbsp;真实姓名：<input name="truename" type="text"  id="truename" size="20" class=yecao style="width:120px"></td></tr>
<TR height=28><TD colspan=2>
<table border=0 width=100%>
<TR height=28><TD width=200>&nbsp;您的性别：<INPUT type=radio  value="男" name="sex" CHECKED>帅&nbsp;哥&nbsp;&nbsp;<INPUT type=radio value="女" name="sex">美&nbsp;女</TD><TD rowspan=2 ><img alt=点击选择头像  id=myface src="img/face/1.gif" border=1 width=40 height=40  onclick="document.all.upart.style.display=(document.all.upart.style.display=='none')?'':'none'" style="cursor:hand"></TD></TR>
<TR height=28><TD >&nbsp;选择头像：<input name="face" type="text"  id=face size="20" class=yecao style="width:120px"></TD></TR></table>
</TD></TR>
<tr height="25" class=bg><td>&nbsp;会员主页：<input name="web" value="http://" type="text"  id="web" size="20" class=yecao style="width:120px"></td></tr>
<tr height="25" class=bg><td>&nbsp;会员电话：<input name="tel" value="http://" type="text"  id="tel" size="20" class=yecao style="width:160px"></td></tr>
<tr height="25" class=bg><td>&nbsp;身 份 证：<input name="passport" value="http://" type="text"  id="passport" size="20" class=yecao style="width:160px" ></td></tr>
<tr height="25" class=bg><td>&nbsp;邮箱地址：<input name="mail" type="text"  id="mail" size="20" class=yecao style="width:120px"></td></tr>
<tr height="25" class=bg><td>&nbsp;腾讯&nbsp;Q&nbsp;Q：<input name="qq" type="text"  id="qq" size="20" class=yecao style="width:120px"></td></tr>
<tr height="25" class=bg><td>&nbsp;详细地址：<input name="address" type="text"  id="address" size="20" class=yecao style="width:120px"></td></tr>
<tr><td class="hr"></td></tr>
<tr height="30" class=foot><td align="center">
<input name="new" type="submit" class="adminbutton" id="new" value="添 加">&nbsp;<input name="Submit2" type="reset" class="adminbutton" value="清 空"></td></tr>
</table> 
</form>
<%elseif request("action")="edit"then
set rs=server.CreateObject("adodb.recordset")
sql="select * from [YC_user] where id="&request.QueryString("id")
rs.open sql,conn,1,3%><br>
<form method="post" name="form" id="form">
<table width="400" align=center border="0" cellpadding="0" cellspacing="0" bordercolor="<%=border%>" rules=none class=3d>
<tr><td height="22"  class=title><b>&nbsp;<img src=img/ie.gif border=0 width=15 height=15 align=absMiddle>&nbsp;修改会员</b></td></tr>
<tr class=bg height=25><td>&nbsp;会员名称：<input name="user" type="text" id="user" value="<%=rs("user_name")%>" size="20" class=yecao style="width:120px">
</td></tr>
<tr height="25" class=bg><td>&nbsp;会员密码：<input name="pass" type="text" id="pass" size="20" class=yecao style="width:120px">&nbsp;<font color=red>* 不修改请留空！</font></td></tr>
<tr height="25" class=bg><td>&nbsp;密码问题：<input name="question" type="text"  id="pass" size="20" class=yecao style="width:120px" value="<%=rs("user_question")%>"></td></tr>
<tr height="25" class=bg><td>&nbsp;问题答案：<input name="answer" type="text"  id="pass" size="20" class=yecao style="width:120px">&nbsp;<font color=red>* 不修改请留空！</font></td></tr>
<tr height="25" class=bg><td>&nbsp;会员点数：<input name="money" type="text"  id="money" size="20" class=yecao style="width:120px" value="<%=rs("user_money")%>"></td></tr>
<tr class=bg height="25"><td>&nbsp;会员级别：<select name="admin" class=yecao>
<option value="3" <%if rs("user_admin")="3" then response.write "selected"%>>管理人员</option>
<option value="2" <%if rs("user_admin")="2" then response.write "selected"%>>贵宾会员</option>
<option value="1" <%if rs("user_admin")="1" then response.write "selected"%>>普通会员</option>
</select>
</td></tr>
<tr height="25" class=bg><td>&nbsp;真实姓名：<input name="truename" type="text"  id="truename" size="20" class=yecao style="width:120px" value="<%=rs("user_true_name")%>"></td></tr>
<TR height=28><TD colspan=2>
<table border=0 width=100%>
<TR height=28><TD width=200>&nbsp;您的性别：<input type="radio" name="sex" value="男" <%if rs("user_sex")="男" then response.Write"checked" end if%>>男
<input name="sex" type="radio" value="女" <%if rs("user_sex")="女" then response.Write"checked" end if%>>女</TD><TD rowspan=2 ><img alt=点击选择头像  id=myface src="<%=rs("user_face")%>" border=1 width=40 height=40 onclick="document.all.upart.style.display=(document.all.upart.style.display=='none')?'':'none'" style="cursor:hand"></TD></TR>
<TR height=28><TD >&nbsp;选择头像：<input name="face" type="text"  id="face" size="20" class=yecao style="width:120px" value="<%=rs("user_face")%>"></TD></TR></table>
</TD></TR>
<tr height="25" class=bg><td>&nbsp;会员电话：<input name="tel"  type="text"  id="tel" size="20" class=yecao style="width:160px" value="<%=rs("user_tel")%>"></td></tr>
<tr height="25" class=bg><td>&nbsp;身 份 证：<input name="passport" type="text"  id="passport" size="20" class=yecao style="width:160px" value="<%=rs("user_passport")%>"></td></tr>
<tr height="25" class=bg><td>&nbsp;会员主页：<input name="web" value="http://" type="text"  id="web" size="20" class=yecao style="width:160px" value="<%=rs("user_web")%>"></td></tr>
<tr height="25" class=bg><td>&nbsp;邮箱地址：<input name="mail" type="text"  id="mail" size="20" class=yecao style="width:160px" value="<%=rs("user_mail")%>"></td></tr>
<tr height="25" class=bg><td>&nbsp;腾讯&nbsp;Q&nbsp;Q：<input name="qq" type="text"  id="qq" size="20" class=yecao style="width:160px" value="<%=rs("user_qq")%>"></td></tr>
<tr height="25" class=bg><td>&nbsp;详细地址：<input name="address" type="text"  id="address" size="20" class=yecao style="width:160px" value="<%=rs("user_address")%>"></td></tr>

<tr><td class="hr"></td></tr>
<tr height="30" class=foot><td align="center"><input name="edit" type="submit" class="adminbutton" id="edit" value="修 改">&nbsp;<input name="Submit2" type="reset" class="adminbutton" value="清 空"></td></tr>
</table></form>
<%end if
rs.close
set rs=nothing%>
<table  align=center border="0" cellpadding="0" cellspacing="0" rules=none class=3d  id=upart style="position:absolute;left:0;top:0;display:none">
<tr onmousedown="MDown(upart)" style="cursor:move" height=22><td colspan="2" class="uptitle"><b>&nbsp;<img src=img/ie.gif border=0 width=15 height=15 align=absMiddle>&nbsp;选择头像</b>
<img onclick="document.all.upart.style.display=(document.all.upart.style.display=='none')?'':'none'" style="position:absolute;right:2;top:5;cursor:hand" border="0" src="img/adminclose.gif" align=absMiddle></td></tr>
<tr class=bg>
<td align=center style=padding:4px>
<img src=img/face/1.gif border=1 style="cursor:hand" 
onClick="form.face.value='img/face/1.gif';form.myface.src='img/face/1.gif';document.all.upart.style.display='none';">
<img src=img/face/2.gif border=1 style="cursor:hand" 
onClick="form.face.value='img/face/2.gif';form.myface.src='img/face/2.gif';document.all.upart.style.display='none';">
<img src=img/face/3.gif border=1 style="cursor:hand" 
onClick="form.face.value='img/face/3.gif';form.myface.src='img/face/3.gif';document.all.upart.style.display='none';">
<img src=img/face/4.gif border=1 style="cursor:hand" 
onClick="form.face.value='img/face/4.gif';form.myface.src='img/face/4.gif';document.all.upart.style.display='none';">
<img src=img/face/5.gif border=1 style="cursor:hand" 
onClick="form.face.value='img/face/5.gif';form.myface.src='img/face/5.gif';document.all.upart.style.display='none';"><br>
<img src=img/face/6.gif border=1 style="cursor:hand" 
onClick="form.face.value='img/face/6.gif';form.myface.src='img/face/6.gif';document.all.upart.style.display='none';">
<img src=img/face/7.gif border=1 style="cursor:hand"
onClick="form.face.value='img/face/7.gif';form.myface.src='img/face/7.gif';document.all.upart.style.display='none';">
<img src=img/face/8.gif border=1 style="cursor:hand" 
onClick="form.face.value='img/face/8.gif';form.myface.src='img/face/8.gif';document.all.upart.style.display='none';">
<img src=img/face/9.gif border=1 style="cursor:hand" 
onClick="form.face.value='img/face/9.gif';form.myface.src='img/face/9.gif';document.all.upart.style.display='none';">
<img src=img/face/10.gif border=1 style="cursor:hand" 
onClick="form.face.value='img/face/10.gif';form.myface.src='img/face/10.gif';document.all.upart.style.display='none';"><br>
<img src=img/face/11.gif border=1 style="cursor:hand" 
onClick="form.face.value='img/face/11.gif';form.myface.src='img/face/11.gif';document.all.upart.style.display='none';">
<img src=img/face/12.gif border=1 style="cursor:hand" 
onClick="form.face.value='img/face/12.gif';form.myface.src='img/face/12.gif';document.all.upart.style.display='none';">
<img src=img/face/13.gif border=1 style="cursor:hand" 
onClick="form.face.value='img/face/13.gif';form.myface.src='img/face/13.gif';document.all.upart.style.display='none';">
<img src=img/face/14.gif border=1 style="cursor:hand" 
onClick="form.face.value='img/face/14.gif';form.myface.src='img/face/14.gif';document.all.upart.style.display='none';">
<img src=img/face/15.gif border=1 style="cursor:hand" 
onClick="form.face.value='img/face/15.gif';form.myface.src='img/face/15.gif';document.all.upart.style.display='none';"><br>
</td></tr></table>
</body></html>
<%call closedata()%>
