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

    File:           prs_perslid_qr_mail.asp
    Description:    E-mail de gegenereerde qr-code naar de gebruiker
    Parameters:     bmid: de gegenereerde qr-code
    Context:
    Note:           Altijd e-mailen naar het email adres van de huidige gebruiker
*/
var JSON_Result = true;
%>

<!--#include file="../Shared/common.inc"-->
<!--#include file="../Shared/send_mail.inc"-->
<!--#include file="../Shared/json2.js" -->
<%
if (S("qrc_enable") != 1)
    shared.simpel_page(L("lcl_no_auth"));

var bmid = getQParam("bmid");
var sql = " SELECT prs_perslid_key"
        + "   FROM fac_bookmark"
        + "  WHERE fac_bookmark_id = " + safe.quoted_sql(bmid);
var oRs = Oracle.Execute(sql);
if (user_key != oRs("prs_perslid_key").Value) // Alleen je eigen qr-codes kun je mailen
    shared.simpel_page(L("lcl_no_auth"));
oRs.Close();

fac_send_bookmark(bmid, user.prs_perslid_email(), L("lcl_qrc_auth_mail_subject"), L("lcl_qrc_auth_mail_body"))

var result = { success: true, message: L("lcl_hasbeenmailed_to") + ": " + user.prs_perslid_email() };
Response.Write(JSON.stringify(result));
Response.End;

%>