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

     File:          fac_hotnews_save.asp
     Description:   Sla het hete nieuws op
     Parameters:

     Context:       Vanuit fac_hotnews.asp

*/
var JSON_Result = true;

%>
<!-- #include file="../Shared/common.inc" -->
<!-- #include file="../shared/save2db.inc" -->
<%
protectRequest.validateToken();

var hotnews = getFParam("hotnews", "");

if (hotnews)
    Application("portalalert") = hotnews;
else
    Application.Contents.Remove("portalalert");

var fields =  [ { dbs: "fac_setting_pvalue", typ: "varchar", val: hotnews },
                { dbs: "fac_setting_datum",  typ: "sql",     val: "SYSDATE" },
                { dbs: "prs_perslid_key",    typ: "key",     val: user_key  }];

sql = buildUpdate("fac_setting", fields)
    + "     fac_setting_name = 'fac_portalert_xd'";

var err = Oracle.Execute(sql, true);
if (err.friendlyMsg)
    abort_with_warning(err.friendlyMsg);

result = { success: true, message: hotnews?"Hot news is opgeslagen":"Hot news is gewist" };

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

ASPPAGE_END();
%> 
