<%'guidedisplay=1%>
<!--#include file="admin_start.asp" -->
<%
id=request("id")
if not MySys.check.isInteger(id) then
   MySys.Error.info = "请提交合法的栏目id！"
   MySys.Error.location = "back"
   MySys.Error.err()
End If

id=int(id)

rs.open"select * from jins_customer_list where customer_id="&id&" ",conn,1,1
if rs.eof then
   MySys.Error.info = "您请求的用户不存在！"
   MySys.Error.location = "back"
   MySys.Error.err()
End If
%>
<body topmargin="30" marginwidth="10" marginheight="10">
<form name=edit_html target=admin_edit_html method=post><input type=hidden name=c value=''><input type=hidden name=formname value=''><input type=hidden name=inputname value=''></form>
<form name=user_customer action="admin_user_customer_edit_handle.asp?action=edit&id=<%=id%>" method=post>
<table cellpadding="3" cellspacing="4" width="90%" height="30" align=center style='border:1px solid #ebebeb' >
	<tr>
		<td width="2%" align=right><img alt='点击弹开编辑框' onclick="opencat(basic_open)" style='CURSOR: hand' src="Images/index_search.gif" width="8" height="16"></td>
		<td  width="98%" align=left>
		<font color="#ebebeb"> | </font>
		<img alt='点击弹开提示信息框' onclick="opencat(help_ads_open)" style='CURSOR: hand' src="Images/icon_info.gif" width="13" height="13" hspace="0" align="absmiddle">			
		<font color="#ebebeb"> | </font>
		用户资料编辑
		<font color="#ebebeb"> | </font>
		<img src="Images/plusf.gif" onclick="opencat(order_open)"  width="15" height="15" alt='查看订单摘要信息' style='CURSOR: hand'> <a  href='admin_user_customer_order_list.asp?s_n=3,customer_name,1&customer_name=<%=rs("customer_reg_name")%>'>订单管理</a>
		<font color="#ebebeb"> | </font>
		<img src="Images/plusf.gif" onclick="opencat(consume_open)"  width="15" height="15" alt='查看帐户摘要信息' style='CURSOR: hand'> <a  href='admin_user_customer_consume_list.asp?s_n=3,customer_name,1&customer_name=<%=rs("customer_reg_name")%>'>帐户管理</a>
		<font color="#ebebeb"> | </font>
		<img src="Images/plusf.gif" onclick="opencat(count_open)"  width="15" height="15" alt='查看积分摘要信息' style='CURSOR: hand'> <a  href='admin_user_customer_count_list.asp?s_n=3,customer_name,1&customer_name=<%=rs("customer_reg_name")%>'>积分管理</a>
		<font color="#ebebeb"> | </font>
		<a  href="javascript:newwin=window.open('admin_user_customer_count_add.asp?customer_name=<%=rs("customer_reg_name")%>','admin_user_customer_count_add','toolbar=no,location=no,status=no, menubar=no,scrollbars=yes,resizable=no,width=400,height=320');newwin.focus();">增加积分</a>
		<font color="#ebebeb"> | </font>
		<a  href="javascript:newwin=window.open('admin_user_customer_consume_add.asp?customer_name=<%=rs("customer_reg_name")%>','admin_user_customer_consume_add','toolbar=no,location=no,status=no, menubar=no,scrollbars=yes,resizable=no,width=400,height=320');newwin.focus();">帐户充值</a>
	    </td>
	</tr>		
	<tr id="order_open" style="display: none ">
		<td colspan="10" align=left>
		<table cellpadding="4" cellspacing="2" bgcolor='#f7f7f7' width="99%" height="30" align=center style='border:1px dashed #B7B7B7' >
			<tr>
				<td colspan="8" width='100%' style="line-height:150% ">
				<%
				order_n=conn.execute("select count(customer_order_id) from jins_customer_order_list where customer_name='"&rs("customer_reg_name")&"' ")(0)
				order_n_c=conn.execute("select count(customer_order_id) from jins_customer_order_list where customer_name='"&rs("customer_reg_name")&"' and customer_order_stat=5 ")(0)
				order_sum=conn.execute("select sum(customer_order_money) from jins_customer_order_list where customer_name='"&rs("customer_reg_name")&"' ")(0)
				if order_sum>=0 then order_sum=order_sum else order_sum=0
				%>
				·订单信息摘要：用户总订单：<font color=red ><%=order_n%></font>
				 | 已完成的订单：<font color=red ><%=order_n_c%></font>
				 | 未完成的订单：<font color=red ><%=order_n-order_n_c%></font>
				 | 订单总金额：<font color=red ><%=MySys.info.unit_money(1)%><%=order_sum%></font>
				</td>
			</tr>
		</table>
		</td>
	</tr>
	<tr id="consume_open" style="display: none ">
		<td colspan="10" align=left>
		<table cellpadding="4" bgcolor='#f7f7f7' cellspacing="2" width="99%" height="30" align=center style='border:1px dashed #B7B7B7' >
			<tr>
				<td colspan="8" width='100%' style="line-height:150% ">
				<%
				'consume_sum_in=-1
				'consume_sum_out=-1
				consume_n=conn.execute("select count(customer_consume_id) from jins_customer_consume_list where customer_name='"&rs("customer_reg_name")&"' ")(0)
				consume_sum_in=conn.execute("select sum(customer_consume_sum) from jins_customer_consume_list where customer_name='"&rs("customer_reg_name")&"' and customer_consume_temp=1 and customer_consume_out='人帐' ")(0)
				consume_sum_out=conn.execute("select sum(customer_consume_sum) from jins_customer_consume_list where customer_name='"&rs("customer_reg_name")&"' and customer_consume_temp=1 and customer_consume_out='出帐' ")(0)
				if consume_sum_in>=0 then consume_sum_in=consume_sum_in else consume_sum_in=0
				if consume_sum_out>=0 then consume_sum_out=consume_sum_out else consume_sum_out=0
				%>
				·帐户信息摘要：交易记录：<font color=red ><%=consume_n%> 条</font>
				 | 帐户入账：<font color=red ><%=MySys.info.unit_money(1)%><%=consume_sum_in%></font>
				 | 帐户出账：<font color=red ><%=MySys.info.unit_money(1)%><%=consume_sum_out%></font>
				 | 帐户总余额：<font color=red ><%=MySys.info.unit_money(1)%><%=consume_sum_in-consume_sum_out%></font>
				</td>
			</tr>
		</table>
		</td>
	</tr>
	<tr id="count_open" style="display: none ">
		<td colspan="10" align=left>
		<table cellpadding="4" bgcolor='#f7f7f7' cellspacing="2" width="99%" height="30" align=center style='border:1px dashed #B7B7B7' >
			<tr>
				<td colspan="8" width='100%' style="line-height:150% ">
				<%
				count_n=conn.execute("select count(customer_count_id) from jins_customer_count_list where customer_name='"&rs("customer_reg_name")&"' ")(0)
				count_sum_in=conn.execute("select sum(customer_count_sum) from jins_customer_count_list where customer_name='"&rs("customer_reg_name")&"'  and customer_count_out='增加' ")(0)
				count_sum_out=conn.execute("select sum(customer_count_sum) from jins_customer_count_list where customer_name='"&rs("customer_reg_name")&"'  and customer_count_out='减少' ")(0)
				if count_sum_in>=0 then count_sum_in=count_sum_in else count_sum_in=0
				if count_sum_out>=0 then count_sum_out=count_sum_out else count_sum_out=0
				%>
				·积分信息摘要：积分操作记录：<font color=red ><%=count_n%> 条</font>
				 | 积分增加：<font color=red ><%=count_sum_in%></font>
				 | 积分减少：<font color=red ><%=count_sum_out%></font>
				 | 剩余积分：<font color=red ><%=count_sum_in-count_sum_out%></font>
				</td>
			</tr>
		</table>
		</td>
	</tr>
	<tr id="help_ads_open" style="display:  ">
		<td colspan="10" align=left>
		<table cellpadding="4" cellspacing="2" width="99%" height="30" align=center style='border:1px dashed #B7B7B7' >
			<tr>
				<td colspan="8" width='100%' style="line-height:150% ">
				·您可以更改用户的类型<br>
				·通过更改登陆ip锁定可以解除用户错误的操作造成的无法登陆！<br>
				·通过重置取回密码问题和答案可以帮助用户在忘记密码和密码提示问题的情况下恢复用户权限！<br>
			</td>
			</tr>
		</table>
		</td>
	</tr>
	
	<tr id="basic_open" >
		<td colspan="10" align=left style='padding-bottom:5px'>
		<table cellpadding="4" cellspacing="2" bgcolor='#f7f7f7' width="99%" height="30" align=center style='border:1px dashed #808080;padding:20px' >
			<tr>
				<td  width="25%" align=right>用户名:</td>
				<td  width="75%" align=left>
				  <%=rs("customer_reg_name")%>
				</td>
			</tr>
			<tr>
				<td  width="25%" align=right>用户类型:</td>
				<td  width="75%" align=left>
				<select name=sort_id >
				<%
				set rs_t=conn.execute("select sort_open,sort_description,sort_id  from jins_customer_sort order by sort_grade ")
				do while not rs_t.eof
					response.write "<option value="&rs_t("sort_id") 
					if rs("sort_id")=rs_t("sort_id") then response.write " selected "
					response.write " >"&rs_t("sort_description")
					if rs_t("sort_open")=0 then response.write "*"
					response.write "</option>"
					rs_t.movenext
				loop
				set rs_t=nothing
				%>
				</select> 带 * 表示此分类已经被暂时关闭
				</td>
			</tr>
			<tr>
				<td  width="25%" align=right>开关:</td>
				<td  width="75%" align=left>
				<select name=customer_open >
				<option value=1 <%if rs("customer_open")=1 then response.write "selected"%> >打开</option>
				<option value=0 <%if rs("customer_open")=0 then response.write "selected"%> >关闭</option>
				</select>
				</td>
			</tr>
			<tr>
				<td  width="25%" align=right>是否审核:</td>
				<td  width="75%" align=left>
				<select name=customer_reg_admin >
				<option value=1 <%if rs("customer_reg_admin")=1 then response.write "selected"%> >通过</option>
				<option value=0 <%if rs("customer_reg_admin")=0 then response.write "selected"%> >等待</option>
				</select>
				</td>
			</tr>
			<tr>
				<td  width="25%" align=right>取回密码提示问题:</td>
				<td  width="75%" align=left>
				<input value='<%=rs("customer_reg_Password_verify_question")%>' name='customer_reg_password_verify_question' size=52>
				</td>
			</tr>
			<tr>
				<td  width="25%" align=right>取回密码答案:</td>
				<td  width="75%" align=left>
				<input value='' name='customer_reg_password_verify_answer' size=52> 帮助用户取回密码时填写！
				</td>
			</tr>
		</table><br>
		<%
		'////////////////////////////////////////////////////////////////////////////////////////////////////////
		%>
		<table cellpadding="4" cellspacing="2" bgcolor='#f7f7f7' width="99%" height="30" align=center style='border:1px dashed #808080;padding:20px' >
			<tr>
				<td  width="25%" align=right >真实姓名:</td>
				<td  width="75%" align=left >
				  <input name=customer_reg_realname type=text value="<%=rs("customer_reg_realname")%>" size=52>
				</td>
			</tr>
			<tr>
				<td  width="25%" align=right >性别:</td>
				<td  width="75%" align=left >
				<select name=customer_reg_sex >
				<option value=1 <%if rs("customer_reg_sex")=1 then response.write "selected"%> >男</option>
				<option value=0 <%if rs("customer_reg_sex")=0 then response.write "selected"%> >女</option>
				</select>
				</td>
			</tr>
			<tr>
				<td  width="25%" align=right >年龄:</td>
				<td  width="75%" align=left >
				  <input name=customer_reg_age type=text value="<%=rs("customer_reg_age")%>" size=5>
				</td>
			</tr>
			<tr>
				<td  width="25%" align=right >地址:</td>
				<td  width="75%" align=left >
				  <input name=customer_reg_address type=text value="<%=rs("customer_reg_address")%>" size=52>
				</td>
			</tr>
			<tr>
				<td  width="25%" align=right >邮编:</td>
				<td  width="75%" align=left >
				  <input name=customer_reg_postcode type=text value="<%=rs("customer_reg_postcode")%>" size=5>
				</td>
			</tr>
			<tr>
				<td  width="25%" align=right >联系电话:</td>
				<td  width="75%" align=left >
				  <input name=customer_reg_telnumber type=text value="<%=rs("customer_reg_telnumber")%>" size=52>
				</td>
			</tr>
			<tr>
				<td  width="25%" align=right >QQ号码:</td>
				<td  width="75%" align=left >
				  <input name=customer_reg_qqnumber type=text value="<%=rs("customer_reg_qqnumber")%>" size=52>
				</td>
			</tr>
			<tr>
				<td  width="25%" align=right >电子邮箱:</td>
				<td  width="75%" align=left >
				  <input name=customer_reg_email type=text value="<%=rs("customer_reg_email")%>" size=52>
				</td>
			</tr>
		</table><br>
		<%
		'////////////////////////////////////////////////////////////////////////////////////////////////////////
		%>		
		<table cellpadding="4" cellspacing="2" bgcolor='#f7f7f7' width="99%" height="30" align=center style='border:1px dashed #808080;padding:20px' >
			<tr>
				<td  width="25%" align=right>用户登陆次数:</td>
				<td  width="75%" align=left>
				<%=rs("customer_login_time")%>
				</td>
			</tr>
			<tr>
				<td  width="25%" align=right>最后登录时间:</td>
				<td  width="75%" align=left>
				<%=rs("customer_login_date_last")%>
				</td>
			</tr>
			<tr>
				<td  width="25%" align=right>最后登录 IP :</td>
				<td  width="75%" align=left>
				<%=rs("customer_login_ip_last")%>
				</td>
			</tr>
			<tr>
				<td  width="25%" align=right>登陆 IP 锁定:</td>
				<td  width="75%" align=left>
				<select name=customer_login_ip_lock >
				<option value=1 <%if rs("customer_login_ip_lock")=1 then response.write "selected"%> >已锁定</option>
				<option value=0 <%if rs("customer_login_ip_lock")=0 then response.write "selected"%> >未锁定</option>
				</select>
				</td>
			</tr>
			<tr>
				<td  width="25%" align=right>登陆锁定 IP :</td>
				<td  width="75%" align=left>
				<%=rs("customer_login_ip_locked")%>
				</td>
			</tr>
		</table><br>
		</td>
	</tr>

	<tr>
		<td height='1' colspan="9" background='images/dot03.gif'></td>
	</tr>
	
	<tr>
	  <td height='30' colspan="8" width='100%' align=center >
	  <input type=submit value="提交设置！" >
	   <input type=reset value="重置" > 
	   <input onclick='history.back(-1)' type=button value="返回" >	  </td>
	</tr>
</table>		
<SCRIPT language=javascript>
	function opencat(cat)
	{
 	 	if(cat.style.display=="none"){
     	cat.style.display="";
  		} else {
     	cat.style.display="none"; 
  		}
	}</SCRIPT>
</form>
<%
rs.close
%>
<!--#include file="admin_end.asp" -->