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

    File:               fac_print_qrcode.asp
    Description:        Maakt een QR code op basis van bookmark_id of meegegeven text-parameter
    Parameters:         text: waarde van de qr code
    Context:
    Note:
*/ %>

<!--#include file="../Shared/common.inc"-->
<!--#include file="../../appl/shared/iface.inc"-->
<!--#include file="../../appl/fac/fac.inc" -->

<%
var bkm_id = getQParam("bkm_id", "");
var title  = getQParam("title", L("lcl_fac_qrcode"));
var qrc    = getQParam("text", "");
if (bkm_id) {
  var sql = "SELECT fac_bookmark_naam"
          + "  FROM fac_bookmark"
          + " WHERE fac_bookmark_id = " + safe.quoted_sql(bkm_id);
  var oRs = Oracle.Execute(sql);
  title = oRs("fac_bookmark_naam").value;
  oRs.Close();
  qrc = "/?u=" + bkm_id;
}
%>

<html>
  <head>
<%  FCLTHeader.Generate(); %>
  </head>
  <body class="fclt-modal" id="mod_qrcode" scroll="no">
<%  MODAL_START();
      var buttons = [{ title: L("lcl_slnk_print"), icon: "fa-print", action: "print()", id: "print_qr", importance: 2 }];
      MODAL_BLOCK_START("qrcode", title, { "icon": "fa-qrcode", isModal: true, "buttons": buttons }); %>
      </table>
      <div class="show-on-print">
        <p>
          <%=safe.html(title)%>
        </p>
        <%=L("lcl_fac_qrcode_pre")%>
      </div>
      <div class="qrcode">
        <img class="qrc" alt="<%=L("lcl_fac_qrcode")%>" src="../shared/qrcode.asp?size=16&text=<%=safe.htmlattr(safe.url(qrc))%>">
      </div>
      <div class="show-on-print">
        <%=L("lcl_fac_qrcode_post")%>
      </div>
<%    MODAL_BLOCK_END();
    MODAL_END(); %>
  </body>
</html>
<% ASPPAGE_END(); %>
