<%@ language = "JavaScript" %>
<% /*
    $Revision$
    $Id$
    File:               infobordvk.asp
    Description:        A deeplink call to display information on the infobord
    Parameters:
        vk              verkoopkamer: the number of the verkoopkamer
    Context:
    Note:
*/ %>

<%
  Response.Expires=0;
  Session("customerId") = 'BOFO';
  Session("user_key")  = 3;
%>

<!-- #include file="../../../appl/Shared/common.inc" -->
<html>

<head>
<%
  // specific params needed to find the reservation which has to be deleted
  var vk = getQParam("vk", "onbekend");
  var refreshrate = getQParamInt("refreshrate", -1);

  // find res_ruimte_key of the verkoopkamer
  var res_ruimte_key = -1;
  sql = "SELECT res_ruimte_key"
      + " FROM res_ruimte rr"
      + " WHERE UPPER(res_ruimte_nr) like " + safe.quoted_sql_upper("%["+vk+"]%")
      + " AND rr.res_ruimte_verwijder IS NULL";
  oRs = Oracle.Execute(sql);
  if (!oRs.eof) {
    res_ruimte_key = oRs(0).value;
  }

  // find the key of the usr_report
  var fac_usrrap_key = -1;
  sql = "SELECT fac_usrrap_key"
      + " FROM fac_usrrap ur"
      + " WHERE UPPER(fac_usrrap_view_name) = UPPER('bofo_v_info_verkoopkamer')";
  oRs = Oracle.Execute(sql);
  if (!oRs.eof) {
    fac_usrrap_key = oRs(0).value;
  }

  var params = "";
  params += "&fclt_f_colname1=res_ruimte_key&fclt_f_colvalue1=" + res_ruimte_key;

%>

</head>
<body leftmargin=0 topmargin=0 onLoad="Loaded();">
<script language="javascript">
  function Loaded()
  {
<%  if (fac_usrrap_key == -1 || res_ruimte_key == -1 ) { %>
      alert ("rapport of ruimte kan niet gevonden worden");
<%  } else { %>
      var s = "../../../appl/FAC/fac_usrrap_infobord.asp?rap_key=<%=fac_usrrap_key%><%=params%>&refreshrate=<%=refreshrate%>";
      window.location.href = s;
<%  } %>
  }
  </script>
</body>
</html>
