File: D:/web/secure/itpplates/admin/js/javascript.js
// Version 1.00, 24/07/2020
// Version 1.01, 28/05/2021 added itp_edit_licence_modal and itp_edit_licence
function itp_ShowErrorMessage()
{
if (ITP_ErrorMessage != "") {
alert(ITP_ErrorMessage)
}
}
function itp_ConfirmMessage()
{
if (ITP_ConfirmMessage != "") {
var r=confirm(ITP_ConfirmMessage);
if (r==true)
{
this[ITP_ConfirmFunction]();
}
}
}
// itp_ShowErrorMessage of onload in body tag replaced with this itp_onload
function itp_onload()
{
itp_ShowErrorMessage(); // call the usual error alert routine first
itp_ConfirmMessage(); // new confirmation message
}
function itp_signout()
{
//alert('1');
document.frmOperation.cmd.value = "signout";
document.frmOperation.submit();
//alert(frmOperation.cmd.value);
//alert('2');
}
function itp_create_licence()
{
var LCompanyName = document.frmModalCreate.CompanyName.value;
LCompanyName = LCompanyName.trim()
if (LCompanyName == '') {
alert('Company name must be entered');
return false;
}
//alert(str.trim());
document.frmModalCreate.cmd.value = "createlicence";
document.frmModalCreate.submit();
}
function itp_renew_licence_modal(ALicenceID, ACompanyName)
{
document.frmModalRenew.LicenceID.value = ALicenceID;
document.frmModalRenew.CompanyName.value = ACompanyName;
$("#RenewLicenceModal").modal();
}
function itp_renew_licence()
{
// frmModalRenew.LicenceID will already have a value
document.frmModalRenew.cmd.value = "renewlicence";
document.frmModalRenew.submit();
}
// 28/05/2021
function itp_edit_licence_modal(ALicenceID, ACompanyName, ALicenceKey, AExpiryDate, AEnabled, AComputerName)
{
document.frmModalEdit.LicenceID.value = ALicenceID;
document.frmModalEdit.CompanyName.value = ACompanyName;
document.frmModalEdit.LicenceKey.value = ALicenceKey;
document.frmModalEdit.ComputerName.value = AComputerName;
document.frmModalEdit.LicenceEnabled.checked = (AEnabled == '1') ;
document.frmModalEdit.ClearComputerName.checked = false;
if (document.frmModalEdit.ExpiryDate !== undefined) {
document.frmModalEdit.ExpiryDate.value = AExpiryDate;
};
itpRefreshValidDays('frmModalEdit');
$("#EditLicenceModal").modal();
}
// 28/05/2021
function itp_edit_licence()
{
// frmModalRenew.LicenceID will already have a value
document.frmModalEdit.cmd.value = "editlicence";
document.frmModalEdit.submit();
}
ITP_ErrorMessage = "";
ITP_ConfirmMessage = "";
ITP_ConfirmFunction = "";