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

<%@include file="../include/header.jsp" %>
<%msbean.setCur_menu_node(MenuItem.ATTENDANCE__SEARCH);%>
<script type="text/javascript">
function search(){
	opSubmit("attendance.AttendanceModuleAction.search.load");
}

function take(member_id){
	var f=document.stdform;
	f.s_member_id.value=member_id;
	opSubmit("attendance.AttendanceModuleAction.search.take");
}
</script>
<%@include file="../include/body.jsp" %>
<%
TextBox memberTB=new TextBox("s_member",msbean.getSData("s_member"),265,1000);
memberTB.addAttribute("onkeydown=\"if(event.keyCode == 13){search();}\"");

HtmlTable t=new HtmlTable(new int[]{350,200,300,100});
t.addTitleCell(0,0,msbean.getCur_menu_node().getName());
t.addRCell(1,0,Lang.set("姓名"));
t.addLCell(2,0,memberTB);
t.addRCell(3,0,new Button("搜尋","javascript:search()"));
t.toHtml(out);

int row=0;
t=new HtmlTable(new int[]{170,440,160,160});

t.addHeaderCell(0,row,"會眾編號");
t.addHeaderCell(1,row,"姓名");
t.addHeaderCell(2,row,"現況");
t.addHeaderCell(3,row,"功能"+(new Hidden("s_member_id","")).toHtml());

RecordList r=Attendance.getMemberInAllowedGroup(
	msbean.getIData("activity_seq")
	,msbean.getSData("s_member")
	);

for(int i=0;i<r.size();i++){
    r.setCurrentRow(i);
	row++;
    t.addLCell(0,row,r.getS("member_id"));
    t.addLCell(1,row,r.getS("display_name"));
    t.addLCell(2,row,r.getS("status"));
	t.addLCell(3,row,new Button("點到","take('"+r.getS("member_id")+"')"));
}

t.toHtml(out);
%>
<script type="text/javascript">
document.stdform.s_member.focus();
</script>
<%@include file="../include/footer.jsp" %>