You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

154 lines
6.7 KiB

<script src="/assets/node_modules/datatable/jQuery-3.7.0/jquery-3.7.0.min.js"></script>
<script src="/assets/node_modules/popper.js/dist/umd/popper.min.js"></script>
<script src="/assets/node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
<script src="/assets/node_modules/perfect-scrollbar/dist/perfect-scrollbar.min.js"></script>
<script src="/assets/node_modules/screenfull/dist/screenfull.js"></script>
<script src="/assets/node_modules/moment/moment.js"></script>
<script src="/assets/node_modules/sweetalert2/sweetalert2.min.js"></script>
<script src="/assets/node_modules/datatable/JSZip-3.10.1/jszip.min.js"></script>
<script src="/assets/node_modules/datatable/pdfmake-0.2.7/pdfmake.min.js"></script>
<script src="/assets/node_modules/datatable/pdfmake-0.2.7/vfs_fonts.js"></script>
<script src="/assets/node_modules/datatable/DataTables-1.13.6/js/jquery.dataTables.min.js"></script>
<script src="/assets/node_modules/datatable/AutoFill-2.6.0/js/dataTables.autoFill.min.js"></script>
<script src="/assets/node_modules/datatable/Buttons-2.4.1/js/dataTables.buttons.min.js"></script>
<script src="/assets/node_modules/datatable/Buttons-2.4.1/js/buttons.bootstrap4.min.js"></script>
<script src="/assets/node_modules/datatable/Buttons-2.4.1/js/buttons.colVis.min.js"></script>
<script src="/assets/node_modules/datatable/Buttons-2.4.1/js/buttons.html5.min.js"></script>
<script src="/assets/node_modules/datatable/Buttons-2.4.1/js/buttons.print.min.js"></script>
<script src="/assets/node_modules/datatable/ColReorder-1.7.0/js/dataTables.colReorder.min.js"></script>
<script src="/assets/node_modules/datatable/DateTime-1.5.1/js/dataTables.dateTime.min.js"></script>
<script src="/assets/node_modules/datatable/FixedColumns-4.3.0/js/dataTables.fixedColumns.min.js"></script>
<script src="/assets/node_modules/datatable/FixedHeader-3.4.0/js/dataTables.fixedHeader.min.js"></script>
<script src="/assets/node_modules/datatable/KeyTable-2.10.0/js/dataTables.keyTable.min.js"></script>
<script src="/assets/node_modules/datatable/Responsive-2.5.0/js/dataTables.responsive.min.js"></script>
<script src="/assets/node_modules/datatable/RowGroup-1.4.0/js/dataTables.rowGroup.min.js"></script>
<script src="/assets/node_modules/datatable/RowReorder-1.4.1/js/dataTables.rowReorder.min.js"></script>
<script src="/assets/node_modules/datatable/Scroller-2.2.0/js/dataTables.scroller.min.js"></script>
<script src="/assets/node_modules/datatable/SearchBuilder-1.5.0/js/dataTables.searchBuilder.min.js"></script>
<script src="/assets/node_modules/datatable/SearchPanes-2.2.0/js/dataTables.searchPanes.min.js"></script>
<script src="/assets/node_modules/datatable/Select-1.7.0/js/dataTables.select.min.js"></script>
<script src="/assets/node_modules/datatable/StateRestore-1.3.0/js/dataTables.stateRestore.min.js"></script>
<script src="/assets/dist/js/theme.js"></script>
<script>
// Get the current page URL path
var currentPagePath = window.location.pathname;
// Remove the leading slash from the current page URL path
currentPagePath = currentPagePath.substr(1);
//alert(currentPagePath);
// Get the parent menu item and the sub-menu item based on the current page URL path
var parentMenuItem = document.querySelector('.nav-item.has-sub');
var subMenuItem = document.querySelector('.submenu-content .menu-item[href="' + currentPagePath + '"]');
// Add the "active" class to the parent menu item and its associated sub-menu item
if (parentMenuItem && subMenuItem) {
parentMenuItem.classList.add('active', 'open');
subMenuItem.classList.add('active');
}
</script>
-->
<script>
$(document).ready(function() {
var currentPagePath = window.location.pathname;
currentPagePath = "/"+currentPagePath.substr(1);
// Set active class for parent menu items
$('.nav-item').each(function() {
var link = $(this).find('a').attr('href');
//console.log(link +" == "+ currentPagePath);
if (link === currentPagePath || link === currentPagePath) {
$(this).addClass('active');
$(this).parents('.has-sub').addClass('active open');
}
});
// Set active class for submenu items
$('.submenu-content .menu-item').each(function() {
var link = $(this).attr('href');
if (link === currentPagePath || link === currentPagePath) {
$(this).addClass('active');
$(this).parents('.has-sub').addClass('active open');
}
});
$(document).ready(function(){
$('[data-toggle="popover"]').popover();
});
});
function call_loading(div,action){
var divID="#"+div;
var loadingimage= `<center><img src="/assets/images/loading.svg" style="opacity: 1; visibility: visible; height:40px;"></center>`;
if(action=='start'){
$(divID).html(loadingimage)
}
}
// Date format
function convertdate(date_txt){
var datetxt = date_txt;
var date = new Date(datetxt);
// Extract the date components
var day = date.getDate();
var month = date.getMonth() + 1; // Month starts from 0, so add 1
var year = date.getFullYear();
// Extract the time components
var hours = date.getHours();
var minutes = date.getMinutes();
// Determine if it's AM or PM
var period = hours >= 12 ? 'PM' : 'AM';
// Adjust the hours to 12-hour format
hours = hours % 12;
hours = hours ? hours : 12; // Handle the case when hours is 0
// Format the date and time string
//var formattedDate = `${day}/${month}/${year}`;
//var formattedTime = `${hours}:${minutes.toString().padStart(2, '0')} ${period}`;
// Format the date and time strings
var formattedDate = `${day.toString().padStart(2, '0')}-${month.toString().padStart(2, '0')}-${year}`;
var formattedTime = `${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')} ${period}`;
// Concatenate the formatted date and time
var formattedDateTime = `${formattedDate} ${formattedTime}`;
return formattedDateTime;
}
function date_difference(fromdate,todate,type='time'){
// Parse the date strings into moment objects with the specified format
var startDate = moment(fromdate, 'DD-MM-YYYY hh:mm A');
var endDate = moment(todate, 'DD-MM-YYYY hh:mm A');
// Calculate the difference in days
var daysDifference = endDate.diff(startDate, 'days');
// Calculate the remaining time components (hours, minutes)
var duration = moment.duration(endDate - startDate);
var hoursDifference = duration.hours();
var minutesDifference = duration.minutes();
// Display the result
if(type=='days'){
return daysDifference + ' days';
}else{
return (hoursDifference) + ' hours and ' + (minutesDifference) + ' minutes';
}
}
</script>
<!--
<script th:inline="javascript">
function logout() {
fetch(/*[[ @{/logout} ]]*/"", { method: 'POST' })
.then(() => window.location.href = /*[[ @{/login} ]]*/"")
.catch(error => console.error('Error logging out:', error));
}
</script>
-->