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

     File:          ins_state_history.asp
     Beschrijving:  Toont de state-history van een object met gegeven key

     Kan later nog wel worden verfraaid met statistieken enzo.
     Een datumfilter (tot) is ook te verwachten

*/%>
<!--#include file="../Shared/common.inc"-->
<!--#include file="../Shared/resultset_table_v2.inc" -->
<!--#include file="ins.inc" -->
<%
var ins_key    = getQParamInt('ins_key');
var this_ins   = ins.func_enabled_deel(ins_key);
var authparams = user.checkAutorisation("WEB_INSUSE");

var outputmode = getQParamInt("outputmode", 0);
%>
<html>
  <head>
<%  FCLTHeader.Generate({ outputmode: outputmode }); %>
  </head>
  <body class="showbody">
<%
    var sql = "SELECT ins_deel_state"
            + ",      ins_deel_statedate"
            + ",      ins_deel_state_history_opmerk"
            + ",      ins_deel_state_history_key"
            + "  FROM ins_deel_state_history"
            + " WHERE ins_deel_key = " + ins_key
            + " ORDER BY ins_deel_statedate DESC";


      var rst = new ResultsetTable({ sql:sql,
                                     keyColumn: "ins_deel_state_history_key",
                                     ID: "insstatetable",
                                     outputmode: outputmode,
                                     showAll: getQParamInt("showall", 0)
                                   });
      // Ik veronderstel datetime in 1 kolom veel handiger voor Excel
      rst.addColumn(new Column({caption: L("lcl_date_time"), content: "ins_deel_statedate", datatype: "datetime"}));
      rst.addColumn(new Column({caption: L("lcl_deel_state"), content: "ins_deel_state"}));
      rst.addColumn(new Column({caption: L("lcl_remark"), content: "ins_deel_state_history_opmerk"}));

      var cnt = rst.processResultset();
%>
  </body>
</html>
