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

    File:           alg_verdieping.asp
    Description:    Verdieping wrapper

    Parameters:

    Context:
    Note:

*/ %>
<!--#include file="../Shared/common.inc" -->
<!--#include file="../Shared/iface.inc" -->

<%
FCLTHeader.Requires({plugins:["jQuery", "suggest"],
                         js: ["jquery-ui.js"],
                         css: [] // css voor plaatselector in alg_edit_verdieping
                    })

var flr_key = getQParamInt("key", -1);

if (flr_key > 0)
{
    sql = "SELECT g.alg_gebouw_code, "
        + "       v.alg_verdieping_omschrijving "
        + "  FROM alg_gebouw g, "
        + "       alg_verdieping v "
        + " WHERE v.alg_verdieping_key = " + flr_key
        + "   AND v.alg_gebouw_key = g.alg_gebouw_key ";

   oRs = Oracle.Execute(sql);

   var bld_code = oRs("alg_gebouw_code").value;
   var flr_oms = oRs("alg_verdieping_omschrijving").value;

   var floor_name   = " " + bld_code + "-" + flr_oms;
}
else
{
  var floor_name = "";
}
%>

<html>
  <head>
<%  FCLTHeader.Generate();
%>
    <script  type="text/javascript" >
      FcltMgr.setTitle("<%=L("lcl_floor")%> <%=safe.jsstring(floor_name)%>", {hot: false});
<%    if (flr_key == -1) { %>FcltMgr.startEdit(window);<% } %>
      function algClose(params)
      {
          <% if (flr_key == -1)
             { %>
              if (params.cancel)
              {
                  FcltMgr.closeDetail(window, params );
                  return true;
              }
              if (!params.keepForm)
                window.location.href = "alg_verdieping.asp?key=" + params.flr_key;
          <% } else { /* Bestaande verdieping bewerkt, switch naar show-mode */ %>
              if (params.close)
              {
                FcltMgr.closeDetail(window, { close: true})
              }
              if (!params.keepForm)
                $("#algFrame")[0].src = "alg_show_verdieping.asp?flr_key=<%=flr_key%>";
          <% } %>
      }
    </script>
  </head>

  <body>
<%  if (flr_key == -1)
        var page="alg_edit_verdieping.asp"; // Maak een nieuw
    else
        var page="alg_show_verdieping.asp";
    page += "?flr_key="+flr_key;

    IFRAMER("algFrame", page, { title: L("lcl_alg_verdieping_frame"),
                                initHeight: "450px",
                                FcltClose: "algClose" } );
%>
  </body>
</html>
