<%@ language = "JavaScript" %>
<%
 /*
    $Revision$
    $Id$

    File:               res_select_room.asp
    Description:        Selecteer een (geschikte) ruimte via een planbord
    Parameters:         rsv_ruimte_key (mag -1 zijn voor nieuwe)
                        bezoekers
                        date_from
                        locatie_key

    Context:            Met knop uit res_edit_rsv_ruimte.asp
    Note:
*/ %>

<!-- #include file="../Shared/common.inc" -->
<!-- #include file="../res/res.inc" -->
<!-- #include file="../Shared/iface.inc" -->
<!-- #include file="../Shared/discxalg3d.inc"-->
<!-- #include file="res_plan_room.inc" -->
<!-- #include file="../Shared/json2.js" -->

<%
FCLTHeader.Requires({plugins: ["jQuery"]})

// Required parameters
var urole = getQParamSafe("urole");
var rsv_ruimte_key = getQParamInt("rsv_ruimte_key");
var locatie_key = getQParamInt("locatie_key", -1);
var activiteit_key = getQParamInt("activiteit_key");

var sql = "SELECT res_srtactiviteit_key, "
        + lcl.xsqla('a.res_activiteit_omschrijving', 'a.res_activiteit_key')
        + "     , a.res_activiteit_duur"
        + "  FROM res_activiteit a"
        + " WHERE res_activiteit_key = " + activiteit_key;
var oRs = Oracle.Execute(sql);


var res_ruimte_key = getQParamInt("res_ruimte_key", -1); // Filter default vergaderzaal

var date_from = getQParamDate("date_from");
var date_to = getQParamDate("date_to");
var ruimtecat = getQParamIntArray("s_ruimtecat", []);
var vis = getQParamInt("vis", null);

var autfunction = urole == "fe"? "WEB_RESUSE" : "WEB_RESFOF";

var width_px = getQParamInt("width_px", 1024);
%>
<html>
    <head>
    <%  FCLTHeader.Generate() %>
    </head>
<body class="modal" id="mod_res_selectroom">
<%

var params = {id: "tab_room_sched",
              res_van: date_from,
              res_tot: date_to,
              loc: locatie_key, bld:-1,
              ruimtecat: ruimtecat,
              res_ruimte_key: res_ruimte_key,
              rsv_ruimte_key: rsv_ruimte_key,
              vis: vis,
              activiteit_key: activiteit_key,
              srtact: oRs("res_srtactiviteit_key").Value,
              forSelectRoom: true,
              authparams: user.checkAutorisation(autfunction, null, null, true), // pessimistisch
              urole: urole,
              width_px: width_px };

var plan_rooms_info = res.plan_rooms_info(params);
var plan_bezet_info = res.plan_bezet_info(params);
make_plan_room(plan_rooms_info, plan_bezet_info, params);

/* Extern is hier (nog) niet logisch?
var url = "http://sgf12/branch534/?API=RESINFO&APIKEY=E0E1EA02E3264324&fac_id=UWVA&pretty=1";

params.request = "plan_rooms_info";
var plan_rooms_info = HTTP.getJSON(url, { data: params });
params.request = "plan_bezet_info";
var plan_bezet_info = HTTP.getJSON(url, { data: params });
var vraag = JSON.stringify(params, null);

if (plan_rooms_info && plan_bezet_info)
    make_plan_room(plan_rooms_info, plan_bezet_info, params);
*/
%>
</body>
</html>