<%@ Page Language="C#" AutoEventWireup="true" debug="true" Inherits="WinLibClass.Form.Admin.Work.User.UI_Update"  CodePage="65001" %>


<script type="text/javascript"> 
$(document).ready(function(){

});

function SaveSub(){
		var pass=checkform();
		if(pass){
			var queryString = $('#form_add').serialize();
			//alert(queryString);
			$.post("User_Update.aspx?IsAdd=20", queryString,function(msg){
				if(msg=='1'){
					Alert('<%=(DataInfo.ID>0?"修改":"添加")%>信息成功!',1,function(){Common.Refresh();});
					//Common.Refresh();
				}else{

					AlertErr("<%=(DataInfo.ID>0?"修改":"添加")%>失败(代码"+msg+",可能会员昵称、电话或邮箱已使用.)");
				}
			});
		}
		return false;
	}


function funSucc(id,msg){}
function funFail(id,msg){Common.ShowTipFaceSmile(false,msg,3);}
function checkform(){
    var ok = jQuery.checkForm2({
        ctrls: [   
        {id: "ID",type:"mustRegular", par:/[\d]{1,}$/,funSuccess: function(ctr){ funSucc(ctr.id,"");},funFailed:function(ctr){funFail(ctr.id,"请填写该后台管理员的编号");}}   
		,{id: "UserNickName",type:"mustRegular", par:/[\w\u4e00-\u9fa5]{2,50}$/,funSuccess: function(ctr){ funSucc(ctr.id,"");},funFailed:function(ctr){funFail(ctr.id,"用户名字数:2~50字以内，允许中文。");}}
		,{id: "UserRealName",type:"mustRegular", par:/[\u4e00-\u9fa5]{2,20}$/,funSuccess: function(ctr){ funSucc(ctr.id,"");},funFailed:function(ctr){funFail(ctr.id,"真实姓名字数:2~20字以内，必须是中文。");}}
//        ,{id: "AdminPhone",type:"mustRegular", par:/1[3~8][\d]{9,9}$/,funSuccess: function(ctr){ funSucc(ctr.id,"");},funFailed:function(ctr){funFail(ctr.id,"手机号码为11位，检查一下呗^_^");}}     
        ,{id: "UserMobile",type:"mustRegular", par:/[\d]{0,12}$/,funSuccess: function(ctr){ funSucc(ctr.id,"");},funFailed:function(ctr){funFail(ctr.id,"手机11位，电话11或12位含区号");}}     
		,{id: "UserEmail",type:"mustRegular", par:/\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/,funSuccess: function(ctr){ funSucc(ctr.id,"");},funFailed:function(ctr){funFail(ctr.id,"(邮箱格式无效)");}}
		
            ]
        //,success: function(){ },failed: function(msg){}
        });
	return ok;	

}




</script> 

<div class="W700">
	<form id="form_add">
<div class="TableUpdateDiv"  style="width:99%;">
<div style="width:98%;">
	<table class="TableUpdate" style="text-align:left;">


	<tr>
	<td >
		
		
		
		<%//如果是修改,则该值默认为非修改状态%>
		<input id="ID" name="ID" type="hidden" class="input" value="<%=DataInfo.ID%>" style=" width:50px;"  />
		
		<input id="UserHeadImage" name="UserHeadImage" type="hidden" class="input" value="<%=DataInfo.UserHeadImage%>" style=" width:50px;"  />
		会员昵称:
		<input id="UserNickName" name="UserNickName" type="text" class="input" style="width:100px;" maxlength="50"  value="<%=DataInfo.UserNickName%>"  />
		真实姓名:
		<input id="UserRealName" name="UserRealName" type="text" class="input" style="width:100px;" maxlength="25" value="<%=DataInfo.UserRealName%>" />
				性别：
		<select id="UserSex" name="UserSex" style="width:80px;" >
		<option value="0" <%=((DataInfo.UserSex==0)?"selected":"")%> >保密</option>
		<option value="1" <%=((DataInfo.UserSex==1)?"selected":"")%> >男</option>
		<option value="2" <%=((DataInfo.UserSex==2)?"selected":"")%> >女</option>
		</select>
		状态：
		<select id="IsChecked" name="IsChecked" style="width:80px;" >
		<option value="1" <%=((DataInfo.IsChecked==1)?"selected":"")%> >启用</option>
		<option value="0" style="color:red" <%=((DataInfo.IsChecked==0)?"selected":"")%> >停用</option>
		</select>		
		
	</td>
	</tr>
	
	<tr>
	<td >	
		手机或电话:
		<input id="UserMobile" name="UserMobile" type="text" class="input" style="width:176px;" maxlength="20" value="<%=DataInfo.UserMobile%>" />		
		<%=DataInfo.Activation==1?"<font color='green'>已验证</font>":"<font color='red'>未验证</font>"%> 
		
		<select id="Activation" name="Activation" style="width:80px;" >
		<option value="1" <%=((DataInfo.Activation==1)?"selected":"")%> >已验证</option>
		<option value="0" style="color:red" <%=((DataInfo.Activation==0)?"selected":"")%> >未验证</option>
		</select>		
		
		
		
		
	</td>
	</tr>
	
	<tr>
	<td >		
		
		邮箱:
		<input id="UserEmail" name="UserEmail" type="text" class="input" style="width:262px;" maxlength="50" value="<%=DataInfo.UserEmail%>" />
&nbsp;
	</td>
	</tr>
	
	<tr>
	<td >


		生日：年
		<select id="UserBirthdayYear" name="UserBirthdayYear" style="width:80px;" >
		<%
		for(int year=1950;year<=2012;year++)
		{
		%>
		<option value="<%=year%>" <%=((DataInfo.UserBirthdayYear==year)?"selected":"")%> ><%=year%></option>
		<%
		}
		%>
		</select>
		月
		<select id="UserBirthdayMonth" name="UserBirthdayMonth" style="width:40px;" >
		<%
		for(int m=1;m<=12;m++)
		{
		%>
		<option value="<%=m%>" <%=((DataInfo.UserBirthdayMonth==m)?"selected":"")%> ><%=m%></option>
		<%
		}
		%>
		</select>
		日
		<select id="UserBirthdayDay" name="UserBirthdayDay" style="width:40px;" >
		<%
		for(int d=1;d<=31;d++)
		{
		%>
		<option value="<%=d%>" <%=((DataInfo.UserBirthdayDay==d)?"selected":"")%> ><%=d%></option>
		<%
		}
		%>
		</select>
		
	</td>
	</tr>
	
	<tr>
	<td >总额:
<%=WinLibClass.Config.Global.WebSiteConfig.PointName_1%>：	
	<input id="Point1" name="Point1" type="text" class="input" style="width:80px;" maxlength="12" value="<%=DataInfo.Point1%>" />
<%=WinLibClass.Config.Global.WebSiteConfig.PointName_2%>：
	<input id="Point2" name="Point2" type="text" class="input" style="width:80px;" maxlength="12" value="<%=DataInfo.Point2%>" />
<%=WinLibClass.Config.Global.WebSiteConfig.PointName_3%>：
	<input id="Point3" name="Point3" type="text" class="input" style="width:80px;" maxlength="12"  value="<%=DataInfo.Point3%>" />
		积分：
<input id="UserPoints" name="UserPoints" type="text" class="input" style="width:80px;" maxlength="12"  value="<%=DataInfo.UserPoints%>" />

	</td>	
	

	</tr>	
	
	
	<tr>
	<td >
	已用:
<%=WinLibClass.Config.Global.WebSiteConfig.PointName_1%>：	
	<input id="UsedPoint1" name="UsedPoint1" type="text" class="input" style="width:80px;" maxlength="12" value="<%=DataInfo.UsedPoint1%>" />
<%=WinLibClass.Config.Global.WebSiteConfig.PointName_2%>：
	<input id="UsedPoint2" name="UsedPoint2" type="text" class="input" style="width:80px;" maxlength="12" value="<%=DataInfo.UsedPoint2%>" />
<%=WinLibClass.Config.Global.WebSiteConfig.PointName_3%>：
	<input id="UsedPoint3" name="UsedPoint3" type="text" class="input" style="width:80px;" maxlength="12"  value="<%=DataInfo.UsedPoint3%>" />
		积分：
<input id="UsedUserPoints" name="UsedUserPoints" type="text" class="input" style="width:80px;" maxlength="12"  value="<%=DataInfo.UsedUserPoints%>" />

	</td>	
	</tr>		
	
	
	<tr style="<%=(DataInfo.IsBaseType==0?"display:none":"")%>  ">
	
	<td >
	
	IP:
	<input id="LastLoginIp" name="LastLoginIp" type="text" class="input" style="width:120px;" maxlength="15" value="<%=DataInfo.LastLoginIp%>" />
	</td>
	</tr>


	
	<tr>

	<td >
	<div style="border:0px;width:250px;">
		住址:<br />		
			<textarea id="UserAddress" name="UserAddress" class="input textarea" maxlength="100" style="width:230px; height:50px;"  title="详细街道门牌" ><%=DataInfo.UserAddress %></textarea>
		</div>
		<div style="border:0px;width:300px;">
		备注:(250字)<br />
		
			<textarea id="UserRemark" name="UserRemark" class="input textarea" maxlength="250" style="width:300px; height:50px;" title="如果您有什么补充，请备注说明" ><%=DataInfo.UserRemark %></textarea>
	</div>
	</td>
	
	</tr>
	

	
	
	
	
	<tr class="Hide">
	
	<td >
		<button type="button" class="button" class="f12" id='add_address'>确认修改</button>
		<input id="AddType" name="AddType" type="hidden" class="input" value="1" style=" width:50px;"  />	
		<input id="IsBaseType" name="IsBaseType" type="hidden" class="input" value="<%=DataInfo.IsBaseType%>" style=" width:50px;"  />	
		<span id="notetip"></span>
		<span id="tips"></span> 
	</td>
</tr>
</table>
		</div>
</div>	
	
	</form>
	
</div>





<!--
<textarea style="width:500px;height:300px" id="testText"></textarea>-->