<%@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 f=document.stdform;
	var login_id=f.login_id.value;
	var receipt_type=f.receipt_type.value;
	var email=f.email.value;
	if(login_id!=""){
		if(login_id.length < <%=Constants.MIN_MEMBER_LOGIN_ID_LENGTH%>
			|| login_id.length > <%=Constants.MAX_MEMBER_LOGIN_ID_LENGTH%>
			){
	        alert("<%=Lang.set("Login ID must be "+Constants.MIN_MEMBER_LOGIN_ID_LENGTH+" to "+Constants.MAX_MEMBER_LOGIN_ID_LENGTH+" numbers or English characters")%>");
	        return;
	    }
	}
	if(receipt_type=="<%=Member.RECEIPT_TYPE__EMAIL%>" && email==""){
		alert("<%=Lang.set("For using email receipt, please enter email")%>");
		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,"Member ID");
t.addDescCell(0,1,"Name");
t.addDescCell(0,2,"Login ID");
t.addDescCell(0,3,"Email");

TextBox loginNameTB=new TextBox("login_id",msbean.getSData("login_id"),200,Constants.MAX_MEMBER_LOGIN_ID_LENGTH);
TextBox emailTB=new TextBox("email",msbean.getSData("email"),200,50);
String loginNameMsg=" (Login ID is "+Constants.MIN_MEMBER_LOGIN_ID_LENGTH+" to "+Constants.MAX_MEMBER_LOGIN_ID_LENGTH+" numbers or English characters. Blank means disable login ID)";
if(request.getParameter("err")!=null && request.getParameter("err").equals("login_id")){
	loginNameMsg="<font color=red>Login ID is registered by others</font>"+loginNameMsg;
}

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

t.addDescCell(2,0,"Baptish Date");
t.addDescCell(2,1,"Name2");
t.addDescCell(2,3,"Receipt Type");

SelectMenu receipt_typeSM=new SelectMenu("receipt_type",SelectMenu.buildItemsByMap(Member.RECEIPT_TYPE_MAP),"name","code",msbean.getSData("receipt_type"));
receipt_typeSM.setNilItemEnable(false);

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

t.toHtml(out);
%>

<center>
<%
(new EmptySpace(15,15)).toHtml(out);
(new Button("Submit","update()")).toHtml(out);
%>
</center>

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