/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ $(document).ready(function() { setInterval(recordLogAndCheckCompanyOverdueAlert,20000); }); function recordLogAndCheckCompanyOverdueAlert() { recordLog(); checkCompanyOverdueAlert(); } function recordLog() { const theUrl = '/lotus//loginLog.jsp'; $.ajax({ type: "GET", url: theUrl, processData: false, async: true, global: false, success: function(result) { if($.trim(result)=="0") { window.location.replace("/lotus//logout.jsp"); } } }); } function checkCompanyOverdueAlert() { $.ajax({ type: "GET", url: "/lotus//company-overdue-alert", processData: false, async: false, success: function (result) { const overdueAlertInfo = JSON.parse(result); const $divOverdueAlertMessage = $("#div-overdue-alert-message"); if(overdueAlertInfo != null && overdueAlertInfo?.isDisplayOverdueMessage) { $divOverdueAlertMessage.html(overdueAlertInfo.overdueAlertMessage); $divOverdueAlertMessage.css("display","block"); } else { $divOverdueAlertMessage.html(); $divOverdueAlertMessage.css("display","none"); } } }); }