<!--#include file="../inc/DAL.asp"-->
<!--#include file="../inc/md5.asp"-->
<!--#include file="../inc/page.asp"-->
<!--#include file="Check.asp"-->
<%
Dim ConfigRS
Set ConfigRS=Server.CreateObject( "ADODB.Recordset" )
if request.form("Method")="ED" then
    ConfigRS.OPEN "select * from [i_User_Info] where [i_User_ID]="&request.form("User_ID") , DB_CONN , 1 , 3
    ConfigRS("i_User_NickName")=vbsEscape(request.form("User_NickName"))
    if request.form("User_Pass")<>"" then  ConfigRS("i_User_Pass")=md5(request.form("User_Pass"))
    ConfigRS("i_User_Sex")=request.form("User_Sex")
    ConfigRS("i_User_Mail")=request.form("User_Mail")
    ConfigRS("i_User_Face")=request.form("User_Pic")
    ConfigRS("i_User_QQ")=request.form("User_QQ")
    ConfigRS("i_User_IsLock")=request.form("IsCheck")
    ConfigRS("i_User_Class")=request.form("User_Power")
    ConfigRS("i_User_Label")=vbsEscape(request.form("User_Note"))
    ConfigRS("i_User_Money")=request.form("User_Money")
    ConfigRS("i_User_PayNum")=request.form("User_PayNum")
    ConfigRS("i_User_IncomeNum")=request.form("User_IncomeNum")
    ConfigRS("i_User_Signing")=request.form("User_Signing")
    ConfigRS("i_User_IsRecommend")=request.form("User_IsRecommend")
    
    ConfigRS.update()
    ConfigRS.close()
	
	CreatRoomInfoJSFiel request.form("User_ID")
	
    RW "<script>alert('修改成功!');location.href='User_Manage.asp';</script>":response.end()
end if
Set ConfigRS=DB_CONN.EXECUTE("select * from [i_User_Info] where [i_User_ID]="&request.QueryString("UID"))


Sub CreatRoomInfoJSFiel(UID)
	RS_End
	dim SumPay,SumIncome,CurrentPage,k,Re,RID,isManager,RoomID
	Re="var DRoomJS=""{data:["
	Set RS=DB_CONN.EXECUTE("select a.*,b.* from [i_User_Info] a join [i_Sys_Room] b on a.[i_User_ID]=b.[i_Sys_Room_AdminUserID] where a.[i_User_ID]="&UID)
	while (not RS.eof)
		Re=Re&"{face:'"&RS("i_User_Face")&"',unick:'"&RS("i_User_NickName")&"',uid:'"&RS("i_User_ID")&"',rname:'"&RS("i_Sys_Room_Name")&"',pubnotice:'"&RS("i_Sys_Room_PubNotice")&"',pubnoticehref:'"&RS("i_Sys_Room_PubNoticeHref")&"',prinotice:'"&RS("i_Sys_Room_PriNotice")&"',prinoticehref:'"&RS("i_Sys_Room_PriNoticeHref")&"',background:'"&RS("i_Sys_Room_BackGround")&"',backgroundfix:'"&RS("i_Sys_Room_BackGroundFix")&"',styletop:'"&RS("i_Sys_Room_StyleTop")&"',stylecss:'"&RS("i_Sys_Room_StyleCss")&"',maxnum:"&RS("i_Sys_Room_MaxNum")&"}"
		RoomID=RS("i_Sys_Room_ID")
		RS.MoveNext
	Wend
	Re=Re&"]}"";"
	RS_End
	
	dim objStream,strFile
	strFile=server.mappath("/d/room/"&RoomID&".js")
	Set objStream = Server.CreateObject("ADODB.Stream")
	With objStream
        .Type = 2
        .Open
        .Charset = "utf-8"
        .Position = objStream.Size
        .WriteText = Re
        .SaveToFile strFile,2
        .Close
    End With
    Set objStream = Nothing
End Sub
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>ImChat v1.5 Manage System</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="styles/layoutContent.css" rel="stylesheet" type="text/css" />
<link href="themes/blue/styles.css" rel="stylesheet" type="text/css" />
<script language="javascript" src="../JS_Custom/pcasunzip.js"></script>
<style>
.JSTB{border:#ccc solid 1px;border-right:none;border-bottom:none;margin-top:20px;}
.JSTB th,.JSTB td{border-bottom:#ccc solid 1px; border-right:#ccc solid 1px;}
</style>
</head>
<body>
<div class="contentcontainer">
    <div class="headings alt">
        <h2>用户编辑&nbsp;&nbsp;&nbsp;<a href="javascript:history.back();" style="text-decoration:none;">返回</a>&nbsp;&nbsp;&nbsp;<a href="javascript:\\;" onclick="location.reload();" style="text-decoration:none;">刷新</a>&nbsp;&nbsp;&nbsp;用户ID：<%=request.QueryString("UID")%>&nbsp;&nbsp;&nbsp;注册时间：<%=ConfigRS("i_User_RegTime")%></h2>
    </div>
    <div class="contentbox">
        
        <form action="#" method="post" >
            <table class="CB" width="100%" cellpadding="0" cellspacing="0" border="0">
                <tr>
                    <td width="350">
                        <label for="User_NickName"><strong>昵称:</strong></label>
                        <input type="text" id="User_NickName" name="User_NickName" class="inputbox" value="<%=vbsUnEscape(ConfigRS("i_User_NickName"))%>"/>
                    </td>
                    <td>
                        <label for="User_Name"><strong>登录账号:</strong></label>
                        <input type="text" id="User_Name" name="User_Name" class="inputbox" readonly value="<%=ConfigRS("i_User_Name")%>"/>
                    </td>
                </tr>
                <tr>
                    <td>
                        <label for="User_Pass"><strong>密码(<font color="red">*</font>不修改请留空):</strong></label>
                        <input type="text" id="User_Pass" name="User_Pass" class="inputbox" value=""/>
                    </td>
                    <td>
                        <label for="User_BankInfo"><strong>银行账号:</strong></label>
                        <input type="text" id="User_BankInfo" name="User_BankInfo" class="inputbox" value="<%=ConfigRS("i_User_BankInfo")%>"/>
                    </td>
                </tr>
                <tr>
                    <td>
                        <label for="User_Money"><strong>金钱:(数字)</strong></label>
                        <input type="text" id="User_Money" name="User_Money" class="inputbox" value="<%=ConfigRS("i_User_Money")%>"/>
                    </td>
                    <td>
                        <label for="User_Signing"><strong>签约主播:</strong></label>
						<select id="User_Signing" name="User_Signing">
                            <option value="1" <%if Cstr(ConfigRS("i_User_Signing"))="1" then RW "selected=""selected"""%>>是</option>
                            <option value="0" <%if Cstr(ConfigRS("i_User_Signing"))="0" then RW "selected=""selected"""%>>否</option>
                        </select>
                    </td>
                </tr>
                
                <tr>
                    <td>
                        <label for="User_IncomeNum"><strong>收入总额:(数字)</strong></label>
                        <input type="text" id="User_IncomeNum" name="User_IncomeNum" class="inputbox" value="<%=ConfigRS("i_User_IncomeNum")%>"/>
                    </td>
                    <td>
                        <label for="User_PayNum"><strong>消费总额:(数字)</strong></label>
                        <input type="text" id="User_PayNum" name="User_PayNum" class="inputbox" value="<%=ConfigRS("i_User_PayNum")%>"/>
                    </td>
                </tr>
                <tr>
                    <td width="350">
                        <label for="User_Sex"><strong>性别:</strong></label>
                        <select id="User_Sex" name="User_Sex">
                            <option value="1" <%if Cstr(ConfigRS("i_User_Sex"))="1" then RW "selected=""selected"""%>>男</option>
                            <option value="0" <%if Cstr(ConfigRS("i_User_Sex"))="0" then RW "selected=""selected"""%>>女</option>
                        </select>
                    </td>
                    <td>
                        <label for="User_Mail"><strong>邮箱:</strong></label>
                        <input type="text" id="User_Mail" name="User_Mail" class="inputbox" value="<%=ConfigRS("i_User_Mail")%>"/>
                    </td>
                </tr>
                <tr>
                    <td width="350">
                        <label for="User_Pic"><strong>头像:</strong></label>
                        <input type="text" id="User_Pic" name="User_Pic" class="inputbox" value="<%=ConfigRS("i_User_Face")%>"/>
                    </td>
                    <td>
                        <img src="<%=ConfigRS("i_User_Face")%>" onerror="this.src='/i/v1/images/face.png'" width="100" border="0"/>
                    </td>
                </tr>
                <tr>
                    <td width="350">
                        <label for="User_QQ"><strong>Q&nbsp;Q:</strong></label>
                        <input type="text" id="User_QQ" name="User_QQ" class="inputbox" value="<%=ConfigRS("i_User_QQ")%>"/>
                    </td>
                    <td>
                        <label for="IsCheck"><strong>状态:</strong></label>
                        <select id="IsCheck" name="IsCheck">
                            <option value="0" <%if Cstr(ConfigRS("i_User_IsLock"))="0" then RW "selected=""selected"""%>>正常</option>
                            <option value="1" <%if Cstr(ConfigRS("i_User_IsLock"))="1" then RW "selected=""selected"""%>>禁用</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td>
                        <label for="User_Power"><strong>角色:</strong></label>
                        <select id="User_Power" name="User_Power">
                            <%
                            set GPRS=Server.CreateObject( "ADODB.Recordset" )
                            set GPRS=DB_CONN.EXECUTE("select * from [i_User_Class] order by [i_User_Class_Sort] desc")
                            while not GPRS.eof
                                dim Selected
                                Selected=""
                                if Cstr(GPRS("i_User_Class_ID"))=Cstr(ConfigRS("i_User_Class")) then Selected="Selected='selected'"
                                RW "<option value='"&GPRS("i_User_Class_ID")&"' "&Selected&" >"&GPRS("i_User_Class_Name")&"</option>"
                            GPRS.movenext()
                            wend
                            %>
                        </select>
                    </td>
					<td>
                        <label for="User_IsRecommend"><strong>是否推荐:</strong></label>
						<select id="User_IsRecommend" name="User_IsRecommend">
                            <option value="1" <%if Cstr(ConfigRS("i_User_IsRecommend"))="1" then RW "selected=""selected"""%>>是</option>
                            <option value="0" <%if Cstr(ConfigRS("i_User_IsRecommend"))="0" then RW "selected=""selected"""%>>否</option>
                        </select>
                    </td>
                <tr>
                    <td colspan="2">
                        <label for="User_Note"><strong>签名:</strong></label>
                        <textarea id="User_Note" name="User_Note" rows="2" cols="100"><%=vbsUnEscape(ConfigRS("i_User_Label"))%></textarea>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <input type="hidden" value="<%=request("UID")%>" name="User_ID"/>
                        <input type="hidden" value="ED" name="Method"/>
                        <input type="submit" value="修改" class="btn" />
                    </td>
                </tr>
            </table>
        </form>
    </div>
</div>
</body>
</html>
