<%@page contentType="text/html; charset=utf-8" %>
<%@page import="java.util.*" %>
<%@page import="org.acts.member.*" %>

<%
String login_id=request.getParameter("login_id");
String password=request.getParameter("password");

String result="";
String member_id="<unknown>";
String name_chi="<unkwon>";
String name_eng="<unkwon>";

int member_seq=Member.getMember_seq(login_id);
if(Member.isPasswordValid(login_id,password)){
    Member m=new Member(member_seq);
    result="pass";
    member_id=m.getMember_id();
    name_chi=m.getName_chi();
    name_eng=m.getName_eng();
}else
if(member_seq!=-1){ //find a member with such login_id, but the password is wrong
    result="pwd_incorrect";
}else{
    result="id_incorrect";
}

out.println("result:"+result);
out.println("member_id:"+member_id);
out.println("name_chi:"+name_chi);
out.println("name_eng:"+name_eng);
out.println("login_id:"+login_id);

%>