<%@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__ATTENDANCE);%>
<%@include file="../include/body.jsp" %>
<%
RecordList atvTypes=Member.getActiveActivities();
SelectMenu atvTypeSM=new SelectMenu("atv_type",atvTypes,"name","code",msbean.getSData("atv_type"));
atvTypeSM.setNilItem(Lang.set("-- All --"),"");

RecordList atvYears=Member.getActiveActivityYears();
SelectMenu atvYearSM=new SelectMenu("atv_year",atvYears,"name","year",msbean.getSData("atv_year"));
atvYearSM.setNilItemEnable(false);

HtmlTable t=new HtmlTable(new int[]{110,430,200,120,100});
t.addTitleCell(0,0,msbean.getCur_menu_node().getName());
t.addRCell(2,0,Lang.set("Type&nbsp;")+atvTypeSM.toHtml());
t.addRCell(3,0,Lang.set("Year&nbsp;")+atvYearSM.toHtml());
t.addRCell(4,0,new Button("Refresh","javascript:opSubmit('member.MemberModuleAction.attendance.read')"));
t.toHtml(out);

int row=0;
t=new HtmlTable(new int[]{110,80,200,450,110});
t.addHeaderCell(0,row,"Date");
t.addHeaderCell(1,row,"Week");
t.addHeaderCell(2,row,"Type");
t.addHeaderCell(3,row,"Name");
t.addHeaderCell(4,row,"In Time");

RecordList r=Member.getAttendance(msbean.getMember_seq(),msbean.getSData("atv_year"),msbean.getSData("atv_type"));
for(int i=0;i<r.size();i++){
    r.setCurrentRow(i);
    row++;
    t.addLCell(0,row,TimeUtil.getStringByDate(r.getT("date")));
	t.addLCell(1,row,TimeUtil.getWeekByDate(r.getT("date")));
    t.addLCell(2,row,r.getS("activity_type"));
    t.addLCell(3,row,r.getS("name"));
    t.addLCell(4,row,TimeUtil.getStringByTime(r.getT("in_time")));
}

t.toHtml(out);
%>

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