<%@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.venue.*" %>
<%@include file="../include/check_login.jsp" %>

<%@include file="../include/header.jsp" %>
<%msbean.setCur_menu_node(MenuItem.VENUE__REQUEST_LIST);%>
<link rel="stylesheet" type="text/css" href="../script/ext/resources/css/ext-all.css">
<script type="text/javascript" src="../script/ext/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="../script/ext/ext-all.js"></script>
<%@include file="../include/body.jsp" %>
<%
RecordList venues=Venue.getVenueNames();
SelectMenu venueSM=new SelectMenu("rl_venue_seq",venues,"name","venue_seq",String.valueOf(msbean.getIData("rl_venue_seq")));
venueSM.setNilItem(Lang.set("--全部--"),"");
ExtJs extjs=new ExtJs();

ExtDateTextBox start_dateDTB=new ExtDateTextBox("rl_start_date",msbean.getSData("rl_start_date"),"使用日期",extjs);
ExtDateTextBox end_dateDTB=new ExtDateTextBox("rl_end_date",msbean.getSData("rl_end_date"),"至",extjs);

HtmlTable t=new HtmlTable(new int[]{130,405,120,185,120,100});
t.addTitleCell(0,0,msbean.getCur_menu_node().getName());
t.addRCell(1,0,2,1,Lang.set("場地")+venueSM.toHtml());
t.addLCell(3,0,start_dateDTB);
t.addLCell(4,0,end_dateDTB);
t.addRCell(5,0,new Button("重新整理","javascript:opSubmit('venue.VenueModuleAction.request_list.read')"));
t.toHtml(out);

int row=0;
t=new HtmlTable(new int[]{100,55,55,55,150,155,45,130,110,85});

t.addHeaderCell(0,row,"使用日期");
t.addHeaderCell(1,row,"週數");
t.addHeaderCell(2,row,"開始");
t.addHeaderCell(3,row,"結束");
t.addHeaderCell(4,row,"場地");
t.addHeaderCell(5,row,"使用群組");
t.addHeaderCell(6,row,"人數");
t.addHeaderCell(7,row,"用途");
t.addHeaderCell(8,row,"申請人");
t.addHeaderCell(9,row,"現況");

RecordList r=VenueRequest.search(
	msbean.getIData("rl_venue_seq")
	,msbean.getTData("rl_start_date")
	,msbean.getTData("rl_end_date")
	,-1
	,false
	);
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("start_time"));
    t.addLCell(3,row,r.getS("end_time"));
    t.addLCell(4,row,r.getS("venue_name"));
    t.addLCell(5,row,r.getS("member_group_name"));
	t.addLCell(6,row,r.getI("user_num"));
    t.addLCell(7,row,r.getS("purpose"));
	t.addLCell(8,row,r.getS("display_name"));
	t.addLCell(9,row,r.getS("status"));
}

t.toHtml(out);
extjs.toHtml(out);
%>
<%@include file="../include/footer.jsp" %>