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

    Description:    Mobile inspectiegegevens
    Parameters:     vereist ins_key en optioneel deelsrtcont_key
    Note:

*/
%>

<!-- #include file="../Shared/common.inc" -->
<!-- #include file="../Shared/selector.inc" -->
<!-- #include file="../mld/mld.inc" -->
<!-- #include file="../ins/ins.inc" -->
<!-- #include file="../ins/ins_flexkenmerksrtcontrole.inc" -->
<!-- #include file="./mobile.inc" -->
<!-- #include file="./iface.inc" -->
<!-- #include file="./resultset_table.inc" -->

<%
var qrc = getQParamInt("qrc", 0) != 0;

var ins_key = getQParamInt("ins_key");
var deelsrtcontrole = { deelsrtcontrole_key: getQParamInt("deelsrtcontrole_key")
                      };


%>
<html>
  <head>
<% FCLTMHeader.Generate({}); %>
  </head>
  <body>
<%
  PAGE_START();
    HEADER({title: L("ins_srtcontrole"), back:!qrc, home: !qrc});
    CONTENT_START();
        var sql = "SELECT idsc.ins_deelsrtcontrole_datum"
                + "     , idsc.ins_deelsrtcontrole_opmerking"
                + "     , idsc.ins_srtcontrole_key"
                + "     , isc.ins_srtcontrole_omschrijving"
                + "     , " + S("prs_pers_string") + " behandelaar"
                + "  FROM ins_deelsrtcontrole idsc"
                + "     , prs_perslid p"
                + "     , ins_srtcontrole isc"
                + " WHERE idsc.prs_perslid_key = p.prs_perslid_key(+)"
                + "   AND idsc.ins_srtcontrole_key = isc.ins_srtcontrole_key"
                + "   AND idsc.ins_deelsrtcontrole_key = " + deelsrtcontrole.deelsrtcontrole_key;
        var oRs = Oracle.Execute(sql);
        if (!oRs.eof)
        {
            deelsrtcontrole.datum = oRs("ins_deelsrtcontrole_datum").Value;
            deelsrtcontrole.behandelaar = oRs("behandelaar").Value;
            deelsrtcontrole.methode = oRs("ins_srtcontrole_omschrijving").Value;
            deelsrtcontrole.opmerking = oRs("ins_deelsrtcontrole_opmerking").Value;
            deelsrtcontrole.methode_key = oRs("ins_srtcontrole_key").Value;
        }
        oRs.Close();

        ROFIELD("fld", L("lcl_ins_controle_datum"), toDateTimeString(deelsrtcontrole.datum) );
        ROFIELD("fld", L("lcl_ins_inspecteur"),     deelsrtcontrole.behandelaar, {suppressEmpty: true});
        ROFIELD("fld", L("lcl_ins_controle"),       deelsrtcontrole.methode);
        ROFIELD("fld", L("lcl_remark"),             deelsrtcontrole.opmerking, {multi: true, suppressEmpty: true});

        // Plus flexkenmerken van de inspectie.
        generateFlexKenmerkBlock({deelsrtcontrole_key: deelsrtcontrole.deelsrtcontrole_key,
                                  srtcontrole_key: deelsrtcontrole.methode_key,
                                  mobile: true,
                                  ins_status: 6
                                });

    CONTENT_END();
    FOOTER();
  PAGE_END();
PDA_PAGE_END(); %>
	</body>
</html>
<% ASPPAGE_END(); %>
