<%@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("--全部--"),"");

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("聚會類別 ")+atvTypeSM.toHtml());
t.addRCell(3,0,Lang.set("年份 ")+atvYearSM.toHtml());
t.addRCell(4,0,new Button("重新整理","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,"日期");
t.addHeaderCell(1,row,"週數");
t.addHeaderCell(2,row,"聚會類別");
t.addHeaderCell(3,row,"聚會名稱");
t.addHeaderCell(4,row,"出席時間");

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" %>