<%@ language="javascript"%>
<% /*
     $Revision$
     $Id$
*/%>
<!-- #include file="../Shared/common.inc" -->
<!-- #include file="../Shared/resultset_table_v2.inc" -->

<%
var highlight_arr  = getQParamIntArray("highlight", []); // Comma-separated room_key_list (terrains). Optional
var floorKey = getQParamInt("vKey", -1);

var outputmode = getQParamInt("outputmode", 0);
var showall = getQParamInt("showall", 0) == 1;

var sql = "";
if (floorKey > 0)
{ // SAMPLE:
  sql = " SELECT r.alg_ruimte_nr, 'tobedefined' contract, 'tobedefined' third"
      + "   FROM alg_ruimte r"
      + "  WHERE r.alg_verdieping_key = " + floorKey;
  if (highlight_arr.length > 0 && highlight_arr.join(",").indexOf("-1") == -1)
    sql += " AND r.alg_ruimte_key IN (" + highlight_arr.join(",") + ")";
  sql += " ORDER BY 1, 3";
}
else
{
  sql = "SELECT * FROM DUAL WHERE 1 = 0";
}
%>

<html>
  <head>
<%  FCLTHeader.Generate(); %>
  </head>

  <body class="tabpage">
<%  var rst = new ResultsetTable({ keyColumn: "alg_ruimte_nr",
                               sql: sql,
                               ID: "workTable",
                               outputmode: outputmode,
                               showAll: showall
                             });

    rst.addColumn(new Column({caption: L("lcl_obj_inf_room"), content: "alg_ruimte_nr"}));
    rst.addColumn(new Column({caption: L("lcl_contract"), content: "contract"}));
    rst.addColumn(new Column({caption: "tobedefined", content: "third"}));

    var cnt = rst.processResultset();
%>
  </body>
</html>
