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

     File:        pda/logoff_confirm.asp
                  Mobile afmelden
     Context:     vanuit menu
     Parameters:
*/
%>
<!-- #include file="../Shared/common.inc" -->
<!-- #include file="./mobile.inc" -->
<!-- #include file="./iface.inc" -->
<%
FCLTHeader.Requires({ plugins: ["jQuery"] });
var qrc = getQParamInt("qrc", 0) != 0;
var user_info = new Perslid(user_key);
%>
<html>
  <head>
<% FCLTMHeader.Generate(); %>
    <script>

      function logoff_submit()
      {
        var data = {};
        <% protectRequest.dataToken("data"); %>
        $.post( "<%=rooturl%>/appl/aut/LogOff.asp"
              , data
              , McltCallbackAndThen(logOffCallback)
              , "json"
              );
        return true; // disable button
      }

      function logOffCallback(json, textStatus)
      {
        if (json && json.message)
        {
          logOffCancel();
        }
        else
        {
          parent.location.href = json.return_url;
        }
      }

      function logoff_cancel()
      {
        window.history.back();
      }

    </script>
  </head>
  <body>
<%
    PAGE_START();
        HEADER ({title: user_info.naam(), back:!qrc, home:!qrc});
        CONTENT_START();
%>          <div class="vrij"><%=L("lcl_logoff_confirm")%></div><%
            CONTROLGROUP_START();
                BUTTON(L("lcl_logoff"), {click: "logoff_submit()", icon: "fa-sign-out"});
                BUTTON(L("lcl_cancel"), {click: "logoff_cancel()", icon: "fa-fclt-cancel"} );
            CONTROLGROUP_END();
        CONTENT_END();
        FOOTER();
    PAGE_END();
PDA_PAGE_END(); %>
	</body>
</html>
<% ASPPAGE_END(); %>
