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

    File:               get_res_info_ajax.asp
    Description:        Ophalen van allerlei info om client-side data te hebben
    Parameters:         req_info:   "res_ruimte"    --> requires "res_ruimte_key"
    Context:
    Note:

*/ %>
<%
var JSON_Result = true;
%>

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

<%
var req_info = getQParam("req_info");
switch (req_info)
{
    case "res_ruimte":
    {
        var res_ruimte_key = getQParamInt("res_ruimte_key");
        result = res.res_ruimte_info(res_ruimte_key);
        break;
    }
    case "res_nr_periods":
    {
        var params = { urole: getQParam("urole"),
                       np: getQParamInt("np"),
                       nextDate: getQParamInt("nextDate"),
                       lastDate: getQParamInt("lastDate"),
                       bits: getQParamInt("bits")
                     }
        result = res.res_getnrperiods(params);
        break;
    }
    case "res_new_dates":
    {
        var params = { urole: getQParam("urole"),
                       chk_lastmin: getQParamInt("chk_lastmin") == 1,
                       np: getQParamInt("np"),
                       nextDate: getQParamInt("nextDate"),
                       bits: getQParamInt("bits"),
                       rsv_ruimte_van: getQParamInt("rsv_ruimte_van"),
                       ruimte_vervaldatum: getQParamInt("ruimte_vervaldatum"),
                       earliest_expire_change: getQParamInt("earliest_expire_change")
                     }
        result = res.res_getnewdates(params);
        break;
    }
}

Response.Write(JSON.stringify(result));
 %>
