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

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

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

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

var mfe = mld.func_enabled_melding (mld_key);
user.auth_required_or_abort(mfe.canWriteFlags);

var result = {};

flagkey += 1;
flagkey = flagkey % S('mld_melding_flags'); // cycle door de waarden 0, 1, 2, 3.

var updatesql = "UPDATE mld_melding"
              + "   SET mld_melding_flag = " + flagkey
              + " WHERE mld_melding_key = " + mld_key;
Oracle.Execute(updatesql);

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

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