<%@page contentType="text/html; charset=utf-8"%>
<%@page import="org.acts.common.*" %>
<%@page import="org.acts.common.html.*" %>
<%@page import="org.acts.member.*" %>
<%@include file="../include/check_login.jsp" %>

<%@include file="../include/header.jsp" %>
<%msbean.setCur_menu_node(MenuItem.MEMBER__INFO);%>
<script type="text/javascript">
function update(){
	var login_id=document.stdform.login_id.value;
	if(login_id!=""){
		if(login_id.length < <%=Constants.MIN_MEMBER_LOGIN_ID_LENGTH%>
			|| login_id.length > <%=Constants.MAX_MEMBER_LOGIN_ID_LENGTH%>
			){
	        alert("自定登入編號必須是"+<%=Constants.MIN_MEMBER_LOGIN_ID_LENGTH%>+"至"+<%=Constants.MAX_MEMBER_LOGIN_ID_LENGTH%>+"個字元之間,而且是英文或數字");
	        return;
	    }
	}
    opSubmit("member.MemberModuleAction.info.update");
}
</script>
<%@include file="../include/body.jsp" %>
<%
Member member=new Member(msbean.getMember_seq());

HtmlTable t=new HtmlTable(new int[]{950});
t.addTitleCell(0,0,msbean.getCur_menu_node().getName());
t.toHtml(out);

t=new HtmlTable(new int[]{125,350,125,350});
t.addDescCell(0,0,"會眾編號");
t.addDescCell(0,1,"姓名(中文)");
t.addDescCell(0,2,"自定登入編號");
t.addDescCell(0,3,"電郵");

TextBox loginNameTB=new TextBox("login_id",msbean.getSData("login_id"),Constants.MAX_MEMBER_LOGIN_ID_LENGTH,Constants.MAX_MEMBER_LOGIN_ID_LENGTH);
TextBox emailTB=new TextBox("email",msbean.getSData("email"),40,50);
String loginNameMsg="(編號必須是"+Constants.MIN_MEMBER_LOGIN_ID_LENGTH+"至"+Constants.MAX_MEMBER_LOGIN_ID_LENGTH+"個字元之間，而且是英文或數字。清空代表不使用自定登入編號)";
if(request.getParameter("err")!=null && request.getParameter("err").equals("login_id")){
	loginNameMsg="<font color=red>這個登入編號已被使用</font>"+loginNameMsg;
}

t.addLCell(1,0,member.getMember_id());
t.addLCell(1,1,member.getName_chi());
t.addLCell(1,2,3,1,loginNameTB.toHtml()+loginNameMsg);
t.addLCell(1,3,3,1,emailTB.toHtml());

t.addDescCell(2,0,"受洗日期");
t.addDescCell(2,1,"姓名(英文)");

t.addLCell(3,0,TimeUtil.getStringByDate(member.getBaptist_date()));
t.addLCell(3,1,member.getName_eng());

t.toHtml(out);
%>

<center>
<input type=button value="確定" onclick=update()>
</center>

<%@include file="../include/footer.jsp" %>