<%@page pageEncoding="utf-8" contentType="text/html; charset=utf-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<!--[if lt IE 7 ]><html lang="en" class="ie6 ielt7 ielt8 ielt9"><![endif]-->
<!--[if IE 7 ]><html lang="en" class="ie7 ielt8 ielt9"><![endif]-->
<!--[if IE 8 ]><html lang="en" class="ie8 ielt9"><![endif]-->
<!--[if IE 9 ]><html lang="en" class="ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!-->
<html lang="en">
<!--<![endif]-->
<head>
<%@include file="/WEB-INF/navigation/JsAndCss.jsp" %>
<script type="text/javascript" src="/datePicker/WdatePicker.js"></script>
<script type="" src="/js/ajaxfileupload.js"></script>
<link href="${path }/css/glDatePicker.default.css">
<script type="text/javascript">
	function checkMobile(){
		var checkMobile = $("#mobile").val();
		var orginMobile = $("#orginMobile").val();
		if(checkMobile==null||checkMobile==""||checkMobile==undefined){
			$("#mobile").val(orginMobile);
			$('#new-project')[0].submit();
		}else{
		$.post("checkMobile.do",{"checkMobile":checkMobile},function(data){
			if(data){
				alert("修改的手机号码已存在");
				return;
			}
				$('#new-project')[0].submit();
			});
		}
	}
</script>
</head>
<body>
	<div class="container">
		<div class="navbar">
			<div class="navbar-inner">
				<%@include file="../navigation/menu.jsp"%>
			</div>
		</div>
		<div class="row">
			<%@include file="../navigation/navigation.jsp"%>
			<div class="span9">
				<form method="post" id="new-project"  action="updateUser.do" onsubmit="return sub();">
					<fieldset>
						<legend>编辑用户信息</legend>
						<div class="control-group">
						<input name="uid" value="${user.uid}" type="hidden"/>
						<label class="control-label" for="input00">姓名</label>
							<input id="input00" name="name" value="${user.name}" type="text" /> 
							<label class="control-label" for="input01">手机号码</label>
							<div class="controls">
								<input type="text" class="input-xlarge"  id="orginMobile"
									 value="${user.mobile}" readonly/>
									&nbsp;&nbsp;&nbsp;修改号码 <input type="text" id="mobile" name="mobile" />
							</div>
							
							
						</div>
                        <div class="control-group">
						<label class="control-label" for="input0">注册认证信息</label>
							<div class="controls">
								<input type="text" class="input-xlarge" id="input0"
									name="verifyReg" value="${user.verifyReg}" />
							</div>
						</div>
						<div class="control-group">
							<label class="control-label" for="select01">所属公司</label>
							<div class="controls">
								<select name="companyId" class="input-xlarge" id="select01">
									<option value="0">--选择公司--</option>
									<c:forEach items="${companies}" var="c">
										<option value="${c.companyId}"
											<c:if test="${c.companyId==user.companyId}">selected</c:if>>
											<c:if test="${c.shorterName!=null}" >${c.shorterName}</c:if>
											<c:if test="${c.shorterName==null}" >${c.companyName}</c:if>
											</option>
									</c:forEach>
								</select>
							</div>
						</div>
						
						<div class="control-group">
							<label class="control-label" for="input03">角色</label>
							<div class="controls">
								<input type="radio" class="input-xlarge" id="input03"
									name="role" value="1"
									<c:if test="${user.role==1}">checked</c:if> />理财师
								&nbsp;&nbsp; 
								<input type="radio" class="input-xlarge"
									name="role" value="2"
									<c:if test="${user.role==2}">checked</c:if> />普通用户
							</div>
						</div>
						<div class="control-group">
							<label class="control-label" for="input04">电子邮箱</label>
							<div class="controls">
								<input type="text" class="input-xlarge" id="input04"
									name="email" value="${user.email}"/>
							</div>
						</div>
						<div class="control-group">
							<label class="control-label" for="select03">性别</label>
							<div class="controls">
								<select class="input-xlarge" id="select03" name="gender">
									<option value="0"
										<c:if test="${user.gender==0}">selected</c:if>>保密</option>
									<option value="1" <c:if test="${user.gender==1}">selected</c:if>>男</option>
									<option value="2" <c:if test="${user.gender==2}">selected</c:if>>女</option>
									</select>
								</div>
							</div>
							<div class="control-group">
								<label class="control-label" for="input05">出生日期</label>
								<div class="controls">
									<input type="text" class="input-xlarge Wdate" id="input05" name="birthday"
									value="${user.birthday}"
									onclick="WdatePicker()" 
									/>
								</div>
							</div>
							
							<div class="control-group">
								<label class="control-label" for="select02">学历</label>
								<div class="controls">
									<select class="input-xlarge" id="select02" name="education" >
									<option value="">--选择学历--</option>
									<c:forEach items="${education}" var="e">
									<option value="${e.subclassId}"
										<c:if test="${user.education==e.subclassId}">selected</c:if>>${e.title}</option>
									</c:forEach>
								</select>
								</div>
							</div>
							<div class="control-group">
								<label class="control-label" for="fileInput">名片</label>
									<div class="controls">
									<c:choose>
										<c:when test="${user.cardUri!=null&&user.cardUri!=''}">
											<img src="/${user.cardUri}" />
										</c:when>
										<c:otherwise>
											尚未上传名片
										</c:otherwise>
									</c:choose>
									</div>
							</div>
							<c:if test="${user.role!=2}">
							<div class="control-group">
								<label class="control-label" for="check">是否认证</label>
									<div class="controls">
										<input type="checkbox" id="check" name="isVerify" value="1"
											<c:if test="${user.isVerify==1}">checked</c:if>
										/>
									</div>
							</div>
							</c:if>
							
							<div class="control-group">
								<label class="control-label" for="fileInput">用户头像</label>
									<div class="controls">
									<c:choose>
										<c:when test="${user.portraitUri!=null&&portraitUri!=''}">
											<img src="/${user.portraitUri}" />
										</c:when>
										<c:otherwise>
											尚未上传用户头像
										</c:otherwise>
									</c:choose>
									</div>
							</div>
							
							<div class="controls">
								<button type="button" class="btn btn-primary" onclick="checkMobile();">保存</button> 
								<button class="btn" type="reset" onclick="history.back()">取消</button>
							</div>
					</fieldset>
				</form>
			</div>
		</div>
	</div>
	
</body>
</html>
