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


<script type="text/javascript"> 
function SaveSub(){
		var pass= checkform();
		if(pass){
			var queryString = $('#form_add').serialize();
			$.post("update.aspx?IsAdd=20", queryString,function(msg){
				if(msg>0){ 
					Alert('保存信息成功!',1);Common.Refresh();

				}else{
	
					AlertErr("保存失败(代码"+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: "AdminName",type:"mustRegular", par:/[^\u4e00-\u9fa5]{2,20}$/,funSuccess: function(ctr){ funSucc(ctr.id,"");},funFailed:function(ctr){funFail(ctr.id,"后台用户名字数:2~20字以内，不允许中文。");}}
		,{id: "AdminRealName",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: "AdminPhone",type:"mustRegular", par:/[\d]{11,12}$/,funSuccess: function(ctr){ funSucc(ctr.id,"");},funFailed:function(ctr){funFail(ctr.id,"手机11位，电话11或12位含区号");}}     

		,{id: "AdminEmail",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 style="height:auto;border:0px;WIDTH:700px">
	<form id="form_add">
<div class="TableUpdateDiv"  style="width:98%;">
<div style="width:99%;">
	<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="AdminName" name="AdminName" type="text" class="input" style="width:100px;"  value="<%=DataInfo.AdminName%>" <%=(SystemType==WinLibClass.Entity.Cache.AdminType.SystemAdmin)?"":"readonly"%>  />


		<%//如果是修改,则该值默认为非修改状态%>
		真实姓名:
		<input id="AdminRealName" name="AdminRealName" type="text" class="input" style="width:100px;"  value="<%=DataInfo.AdminRealName%>" />
类型:
		<select id="AdminType" name="AdminType" style="width:100px;" <%=(DataInfo.ID==1 ||(DataInfo.ID==0 && CurrentAdminUserId==1  || SystemType!=WinLibClass.Entity.Cache.AdminType.SystemAdmin) ? "readonly":"")%>>
		<option value="1000" <%=((DataInfo.AdminType==0)?"selected":"")%> >请选择</option>
		<option value="1000" <%=((DataInfo.AdminType==1000)?"selected":"")%> >*系统管理员*</option>
		<option value="1" <%=((DataInfo.AdminType==1)?"selected":"")%> >网站管理员</option>
		</select>
状态:
		<select id="IsChecked" name="IsChecked" style="width:50px;" <%=(DataInfo.ID==1 || (DataInfo.ID==0 && CurrentAdminUserId==1  || SystemType!=WinLibClass.Entity.Cache.AdminType.SystemAdmin ) ? "readonly":"")%>>
		<option value="1" <%=((DataInfo.ID==1 || DataInfo.IsChecked==1)?"selected":"")%> >启用</option>
		<option value="0" style="color:red" <%=((DataInfo.ID>1 && DataInfo.IsChecked==0)?"selected":"")%> >停用</option>
		</select>
	</td>
	</tr>
	


	<tr>
	<td >	
		
		手机或电话:
		<input id="AdminPhone" name="AdminPhone" type="text" class="input" style="width:100px;" value="<%=DataInfo.AdminPhone%>" />
		邮箱:
		<input id="AdminEmail" name="AdminEmail" type="text" class="input" value="<%=DataInfo.AdminEmail%>" style=" width:340px;" title="邮箱" />		
		&nbsp;
	</td>
	</tr>
	
	<tr>
	<td >
		
		住址:<BR />
			<textarea id="AdminAddress" name="AdminAddress" class="input textarea" style="width:550px; height:100px;"  title="详细街道门牌" ><%=DataInfo.AdminAddress %></textarea>
		
	</td>
	</tr>



	<tr>
	<td >
	
		备注:<BR />
		
			<textarea id="AdminRemark" name="AdminRemark" class="input textarea" style="width:550px; height:100px;" title="如果您有什么补充，请备注说明" ><%=DataInfo.AdminRemark %></textarea>
		
	</td>
	</tr>
	
	
	</table>
	

	</div>
</div>	


	
	</form>
	
</div>
