<%@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"),"From&nbsp;",extjs);
ExtDateTextBox end_dateDTB=new ExtDateTextBox("rl_end_date",msbean.getSData("rl_end_date"),"To&nbsp;",extjs);

HtmlTable t=new HtmlTable(new int[]{180,315,195,150,120,100});
t.addTitleCell(0,0,msbean.getCur_menu_node().getName());
t.addRCell(1,0,2,1,Lang.set("Venue&nbsp;")+venueSM.toHtml());
t.addLCell(3,0,start_dateDTB);
t.addLCell(4,0,end_dateDTB);
t.addRCell(5,0,new Button("Refresh","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,"Date");
t.addHeaderCell(1,row,"Week");
t.addHeaderCell(2,row,"Start");
t.addHeaderCell(3,row,"End");
t.addHeaderCell(4,row,"Venue");
t.addHeaderCell(5,row,"Group");
t.addHeaderCell(6,row,"User#");
t.addHeaderCell(7,row,"Usage");
t.addHeaderCell(8,row,"Applicant");
t.addHeaderCell(9,row,"Status");

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