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

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

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

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

var this_opdr = mld.func_enabled_opdracht(opdr_key);
user.auth_required_or_abort(this_opdr.canWriteFlags);

var result = {};

flagkey = (flagkey+1) % S("mld_opdracht_flags"); // cycle door de waarden [0 .. S("mld_opdracht_flags")]

var updateSql = "UPDATE mld_opdr"
              + "   SET mld_opdr_flag = " + flagkey
              + " WHERE mld_opdr_key = " + opdr_key;
Oracle.Execute(updateSql);

result.success = true;
result.opdr_key = opdr_key;
result.newflag = flagkey;               // Het nieuwe volgnummer van de melding vlaggetjes.

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