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

     verhoog de status van de flag met 1.
  */ %>
<%
var JSON_Result = true;
%>

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

<%
protectRequest.validateToken();
var besopdr_key = getFParamInt("besopdr_key");
var flagkey     = getFParamInt("flagkey");

var this_besopdr = bes.func_enabled_bestelopdracht(besopdr_key);
user.auth_required_or_abort(this_besopdr.canWriteFlags);

var result = {};

flagkey += 1;
flagkey = flagkey % S("bes_bestelopdr_flags"); // cycle door de waarden {0, 1, ... , (S('bes_bestelopdr_flags')-1)}.

var updatesql = "UPDATE bes_bestelopdr"
              + "   SET bes_bestelopdr_flag = " + flagkey
              + " WHERE bes_bestelopdr_key = "  + besopdr_key;
Oracle.Execute(updatesql);

result.success = true;
result.besopdr_key = besopdr_key;
result.newflag = flagkey; // Het nieuwe volgnummer van de bezoeker vlaggetjes.

Response.Write(JSON.stringify(result));
%>
<% ASPPAGE_END(); %> 
