<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- begin::Head -->
<head>
<base href="../../../">
<meta charset="utf-8" />
<title>
<?= $title ?>
</title>
<meta name="description" content="Login page example">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="canonical" href="http://cm.bidmasters.in/costmasters" />
<!--begin::Fonts -->
<link rel="stylesheet"
href="https://fonts.googleapis.com/css?family=Poppins:300,400,500,600,700|Roboto:300,400,500,600,700">
<link href="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.6.347/pdf_viewer.min.css" rel="stylesheet"
type="text/css" />
<!--end::Fonts -->
<link rel="icon" href="<?= base_url(); ?>/assets/favicon.ico" type="image/x-icon">
<!--begin::Page Custom Styles(used by this page) -->
<link href="<?= base_url(); ?>assets/css/pages/login/login-2.css" rel="stylesheet" type="text/css" />
<!--end::Page Custom Styles -->
<!--begin::Global Theme Styles(used by all pages) -->
<!--begin:: Vendor Plugins -->
<link href="<?= base_url(); ?>assets/plugins/general/perfect-scrollbar/css/perfect-scrollbar.css" rel="stylesheet"
type="text/css" />
<link href="<?= base_url(); ?>assets/plugins/general/tether/dist/css/tether.css" rel="stylesheet" type="text/css" />
<link href="<?= base_url(); ?>assets/plugins/general/bootstrap-datepicker/dist/css/bootstrap-datepicker3.css"
rel="stylesheet" type="text/css" />
<link href="<?= base_url(); ?>assets/plugins/general/bootstrap-datetime-picker/css/bootstrap-datetimepicker.css"
rel="stylesheet" type="text/css" />
<link href="<?= base_url(); ?>assets/plugins/general/bootstrap-timepicker/css/bootstrap-timepicker.css"
rel="stylesheet" type="text/css" />
<link href="<?= base_url(); ?>assets/plugins/general/bootstrap-daterangepicker/daterangepicker.css" rel="stylesheet"
type="text/css" />
<link href="<?= base_url(); ?>assets/plugins/general/bootstrap-touchspin/dist/jquery.bootstrap-touchspin.css"
rel="stylesheet" type="text/css" />
<link href="<?= base_url(); ?>assets/plugins/general/bootstrap-select/dist/css/bootstrap-select.css"
rel="stylesheet" type="text/css" />
<link href="<?= base_url(); ?>assets/plugins/general/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.css"
rel="stylesheet" type="text/css" />
<link href="<?= base_url(); ?>assets/plugins/general/select2/dist/css/select2.css" rel="stylesheet"
type="text/css" />
<link href="<?= base_url(); ?>assets/plugins/general/ion-rangeslider/css/ion.rangeSlider.css" rel="stylesheet"
type="text/css" />
<link href="<?= base_url(); ?>assets/plugins/general/nouislider/distribute/nouislider.css" rel="stylesheet"
type="text/css" />
<link href="<?= base_url(); ?>assets/plugins/general/owl.carousel/dist/assets/owl.carousel.css" rel="stylesheet"
type="text/css" />
<link href="<?= base_url(); ?>assets/plugins/general/owl.carousel/dist/assets/owl.theme.default.css"
rel="stylesheet" type="text/css" />
<!-- <link href="<?= base_url(); ?>assets/plugins/general/dropzone/dist/dropzone.css" rel="stylesheet" type="text/css" /> -->
<link href="<?= base_url(); ?>assets/plugins/general/quill/dist/quill.snow.css" rel="stylesheet" type="text/css" />
<link href="<?= base_url(); ?>assets/plugins/general/@yaireo/tagify/dist/tagify.css" rel="stylesheet"
type="text/css" />
<link href="<?= base_url(); ?>assets/plugins/general/summernote/dist/summernote.css" rel="stylesheet"
type="text/css" />
<link href="<?= base_url(); ?>assets/plugins/general/bootstrap-markdown/css/bootstrap-markdown.min.css"
rel="stylesheet" type="text/css" />
<link href="<?= base_url(); ?>assets/plugins/general/animate.css/animate.css" rel="stylesheet" type="text/css" />
<link href="<?= base_url(); ?>assets/plugins/general/toastr/build/toastr.css" rel="stylesheet" type="text/css" />
<link href="<?= base_url(); ?>assets/plugins/general/dual-listbox/dist/dual-listbox.css" rel="stylesheet"
type="text/css" />
<link href="<?= base_url(); ?>assets/plugins/general/morris.js/morris.css" rel="stylesheet" type="text/css" />
<link href="<?= base_url(); ?>assets/plugins/general/sweetalert2/dist/sweetalert2.css" rel="stylesheet"
type="text/css" />
<link href="<?= base_url(); ?>assets/plugins/general/socicon/css/socicon.css" rel="stylesheet" type="text/css" />
<link href="<?= base_url(); ?>assets/plugins/general/plugins/line-awesome/css/line-awesome.css" rel="stylesheet"
type="text/css" />
<link href="<?= base_url(); ?>assets/plugins/general/plugins/flaticon/flaticon.css" rel="stylesheet"
type="text/css" />
<link href="<?= base_url(); ?>assets/plugins/general/plugins/flaticon2/flaticon.css" rel="stylesheet"
type="text/css" />
<link href="<?= base_url(); ?>assets/plugins/general/@fortawesome/fontawesome-free/css/all.min.css" rel="stylesheet"
type="text/css" />
<!--end:: Vendor Plugins -->
<link href="<?= base_url(); ?>assets/css/style.bundle.css?v=1" rel="stylesheet" type="text/css" />
<link rel="preload" href="<?= base_url(); ?>assets/css/style.bundle.css?v=1" as="style"
onload="this.onload=null;this.rel='stylesheet'">
<noscript>
<link rel="stylesheet" href="<?= base_url(); ?>assets/css/style.bundle.css?v=1">
</noscript>
<!-- style tag certificate -->
<!-- <link href="< ?= base_url(); ?>assets/css/style.css" rel="stylesheet" type="text/css" /> -->
<!--begin:: Vendor Plugins for custom pages -->
<link href="<?= base_url(); ?>assets/plugins/custom/plugins/jquery-ui/jquery-ui.min.css" rel="stylesheet"
type="text/css" />
<link href="<?= base_url(); ?>assets/plugins/custom/@fullcalendar/core/main.css" rel="stylesheet" type="text/css" />
<link href="<?= base_url(); ?>assets/plugins/custom/@fullcalendar/daygrid/main.css" rel="stylesheet"
type="text/css" />
<link href="<?= base_url(); ?>assets/plugins/custom/@fullcalendar/list/main.css" rel="stylesheet" type="text/css" />
<link href="<?= base_url(); ?>assets/plugins/custom/@fullcalendar/timegrid/main.css" rel="stylesheet"
type="text/css" />
<link href="<?= base_url(); ?>assets/plugins/custom/datatables.net-bs4/css/dataTables.bootstrap4.css"
rel="stylesheet" type="text/css" />
<link href="<?= base_url(); ?>assets/plugins/custom/datatables.net-buttons-bs4/css/buttons.bootstrap4.min.css"
rel="stylesheet" type="text/css" />
<link href="<?= base_url(); ?>assets/plugins/custom/datatables.net-autofill-bs4/css/autoFill.bootstrap4.min.css"
rel="stylesheet" type="text/css" />
<link href="<?= base_url(); ?>assets/plugins/custom/datatables.net-colreorder-bs4/css/colReorder.bootstrap4.min.css"
rel="stylesheet" type="text/css" />
<link
href="<?= base_url(); ?>assets/plugins/custom/datatables.net-fixedcolumns-bs4/css/fixedColumns.bootstrap4.min.css"
rel="stylesheet" type="text/css" />
<link
href="<?= base_url(); ?>assets/plugins/custom/datatables.net-fixedheader-bs4/css/fixedHeader.bootstrap4.min.css"
rel="stylesheet" type="text/css" />
<link href="<?= base_url(); ?>assets/plugins/custom/datatables.net-keytable-bs4/css/keyTable.bootstrap4.min.css"
rel="stylesheet" type="text/css" />
<link href="<?= base_url(); ?>assets/plugins/custom/datatables.net-responsive-bs4/css/responsive.bootstrap4.min.css"
rel="stylesheet" type="text/css" />
<link href="<?= base_url(); ?>assets/plugins/custom/datatables.net-rowgroup-bs4/css/rowGroup.bootstrap4.min.css"
rel="stylesheet" type="text/css" />
<link href="<?= base_url(); ?>assets/plugins/custom/datatables.net-rowreorder-bs4/css/rowReorder.bootstrap4.min.css"
rel="stylesheet" type="text/css" />
<link href="<?= base_url(); ?>assets/plugins/custom/datatables.net-scroller-bs4/css/scroller.bootstrap4.min.css"
rel="stylesheet" type="text/css" />
<link href="<?= base_url(); ?>assets/plugins/custom/datatables.net-select-bs4/css/select.bootstrap4.min.css"
rel="stylesheet" type="text/css" />
<link href="<?= base_url(); ?>assets/plugins/custom/jstree/dist/themes/default/style.css" rel="stylesheet"
type="text/css" />
<link href="<?= base_url(); ?>assets/plugins/custom/jqvmap/dist/jqvmap.css" rel="stylesheet" type="text/css" />
<link href="<?= base_url(); ?>assets/plugins/custom/uppy/dist/uppy.min.css" rel="stylesheet" type="text/css" />
<link href="<?= base_url(); ?>assets/css/pages/wizard/wizard-4.css" rel="stylesheet" type="text/css" />
<link href="<?= base_url(); ?>assets/css/custom_spa.css" rel="stylesheet" type="text/css" />
<!--end:: Vendor Plugins for custom pages -->
<!--end::Global Theme Styles -->
<!--begin::Layout Skins(used by all pages) -->
<!--end::Layout Skins -->
<link rel="shortcut icon" href="<?= base_url(); ?>assets/media/logos/favicon-32x32.png" />
<style>
div#kt_content {
margin-top: 25px;
}
#pdf_container {
background: #ccc;
text-align: center;
display: none;
padding: 5px;
height: 420px;
overflow: auto;
}
</style>
</head>
<!-- end::Head -->
<!-- begin::Body -->
<body class="kt-quick-panel--right kt-demo-panel--right kt-offcanvas-panel--right kt-header--fixed kt-header-mobile--fixed kt-subheader--enabled kt-subheader--solid kt-aside--enabled kt-aside--fixed kt-aside--minimize kt-page--loading">
<!-- begin:: Page -->
<!-- begin:: Header Mobile -->
<div id="kt_header_mobile" class="kt-header-mobile kt-header-mobile--fixed ">
<div class="kt-header-mobile__logo">
<?php if ($subs_type[0]['end_reg'] < date('Y-m-d')) { ?>
<?php
$valid_subscription_types = ['1', '3', '5', '23', '27', '28', '30'];
if (in_array($subs_type[0]['subscription_type'], $valid_subscription_types)) {
?>
<?php //if ($subs_type[0]['subscription_type'] == '1' || $subs_type[0]['subscription_type'] == '3' || $subs_type[0]['subscription_type'] == '5'|| $subs_type[0]['subscription_type'] == '23') { ?>
<a href="<?= base_url(); ?>graph/view-pdf">
<img src="<?= base_url('uploads/site_logo/') . $sitelogo; ?>" alt="Loading image...please wait..">
</a>
<?php } else { ?>
<a href="<?= base_url(); ?>graph/show">
<img src="<?= base_url('uploads/site_logo/') . $sitelogo; ?>" alt="Loading image...please wait..">
</a>
<?php }
} else { ?>
<a href="<?= base_url(); ?>graph/view-pdf">
<img src="<?= base_url('uploads/site_logo/') . $sitelogo; ?>" alt="Loading image...please wait..">
</a>
<?php } ?>
</div>
<div class="kt-header-mobile__toolbar">
<div class="kt-header-mobile__toolbar-toggler kt-header-mobile__toolbar-toggler--left"
id="kt_aside_mobile_toggler"><span></span></div>
<!--<div class="kt-header-mobile__toolbar-toggler" id="kt_header_mobile_toggler"><span></span></div>-->
<div class="kt-header-mobile__toolbar-topbar-toggler" id="kt_header_mobile_topbar_toggler"><i
class="flaticon-more"></i></div>
</div>
</div>
<!-- end:: Header Mobile -->
<div class="kt-grid kt-grid--hor kt-grid--root">
<div class="kt-grid__item kt-grid__item--fluid kt-grid kt-grid--ver kt-page">
<!-- begin:: Aside -->
<button class="kt-aside-close " id="kt_aside_close_btn"><i class="la la-close"></i></button>
<div class="kt-aside kt-aside--fixed kt-grid__item kt-grid kt-grid--desktop kt-grid--hor-desktop"
id="kt_aside">
<!-- begin:: Aside Menu -->
<div class="kt-aside-menu-wrapper kt-grid__item kt-grid__item--fluid" id="kt_aside_menu_wrapper">
<div id="kt_aside_menu" class="kt-aside-menu " data-ktmenu-vertical="1" data-ktmenu-scroll="1"
data-ktmenu-dropdown-timeout="500">
<ul class="kt-menu__nav ">
<!-- <li class="kt-menu__item kt-menu__item--active" aria-haspopup="true"><a href="<?= base_url(); ?>dashboard" class="kt-menu__link "><i class="kt-menu__link-icon fa fa-home"></i><span class="kt-menu__link-text">View Account</span></a></li> -->
<li class="kt-menu__item kt-menu__item--active" aria-haspopup="true"><a
href="<?= base_url('graph/show'); ?>" class="kt-menu__link "><i
class="kt-menu__link-icon fa fa-globe"></i><span
class="kt-menu__link-text">Graphical Results</span></a></li>
<!-- <li class="kt-menu__item kt-menu__item--active" aria-haspopup="true"><a
href="<?= base_url('change-password'); ?>" class="kt-menu__link "><i
class="kt-menu__link-icon fa fa-key"></i><span
class="kt-menu__link-text">Change Password</span></a></li> -->
<li class="kt-menu__item kt-menu__item--active" aria-haspopup="true"><a
href="<?= base_url(); ?>logout" class="kt-menu__link "><i
class="kt-menu__link-icon fa fa-sign-out-alt"></i><span
class="kt-menu__link-text">Logout</span></a></li>
</ul>
</div>
</div>
<!-- end:: Aside Menu -->
</div>
<!-- end:: Aside -->
<div class="kt-grid__item kt-grid__item--fluid kt-grid kt-grid--hor kt-wrapper" id="kt_wrapper">
<!-- begin:: Header laptop-->
<div id="kt_header" class="kt-header kt-grid kt-grid--ver kt-header--fixed ">
<!-- begin:: Aside -->
<div class="kt-header__brand kt-grid__item " id="kt_header_brand">
<div class="kt-header__brand-logo">
<?php if (!empty($subs_type) && isset($subs_type[0]['end_reg']) && $subs_type[0]['end_reg'] < date('Y-m-d')) { ?>
<a href="<?= base_url(); ?>graph/view-pdf">
<img src="<?= base_url('uploads/site_logo/') . $sitelogo; ?>"
alt="Loading image...please wait..">
</a>
<?php } else { ?>
<?php
$valid_subscription_types = ['1', '3', '5', '23', '27', '28', '30'];
if (in_array($subs_type[0]['subscription_type'], $valid_subscription_types)) {
?>
<?php //if ($subs_type[0]['subscription_type'] == '1' || $subs_type[0]['subscription_type'] == '3' || $subs_type[0]['subscription_type'] == '5'|| $subs_type[0]['subscription_type'] == '23') { ?>
<a href="<?= base_url(); ?>graph/view-pdf">
<img src="<?= base_url('uploads/site_logo/') . $sitelogo; ?>"
alt="Loading image...please wait..">
</a>
<?php } else { ?>
<a href="<?= base_url(); ?>graph/show">
<img src="<?= base_url('uploads/site_logo/') . $sitelogo; ?>"
alt="Loading image...please wait..">
</a>
<?php }
} ?>
</div>
</div>
<!-- end:: Aside -->
<!-- begin:: Title -->
<div class="nav_cs_right">
<h3 class="kt-header__title kt-grid__item">
<span> Welcome!
<?= $this->session->userdata('email'); ?>
<!-- <?= $this->session->userdata('email') . ' ' . $subs_type[0]['subscription_type'] . ' ' . $subs_type[0]['end_reg']; ?>-->
</span>
</h3>
<div class="logout-btn">
<?php if ($this->uri->segment(1) == 'dashboard'): ?>
<?php
// Check if the end registration date is less than the current date
if ($subs_type[0]['end_reg'] < date('Y-m-d')) {
?>
<!-- If the subscription has expired, show the Back button linking to view-pdf -->
<a href="<?= base_url('graph/view-pdf'); ?>"
class="btn costmaster-button change-button">CIR - FC Reports</a>
<?php
} else {
// If the subscription is active, check the subscription type
if (in_array($subs_type[0]['subscription_type'], ['1', '3', '5', '23', '27', '28', '30'])):
?>
<!-- If the subscription type is in the array, show the Back button linking to view-pdf -->
<a href="<?= base_url('graph/view-pdf'); ?>"
class="btn costmaster-button change-button">CIR - FC Reports</a>
<?php
else:
?>
<!-- If the subscription type is not in the array, show the Back button linking to show -->
<a href="<?= base_url('graph/show'); ?>" class="btn costmaster-button change-button">Web Access</a>
<?php
endif;
}
?>
<?php endif; ?>
<?php if (
$this->uri->uri_string() == 'graph/view-pdf' &&
!empty($subs_type) &&
($subs_type[0]['subscription_type'] !== '1' &&
$subs_type[0]['subscription_type'] !== '3' &&
$subs_type[0]['subscription_type'] !== '5' &&
$subs_type[0]['subscription_type'] !== '23' &&
$subs_type[0]['subscription_type'] !== '27' &&
$subs_type[0]['subscription_type'] !== '28' && $subs_type[0]['subscription_type'] !== '30') && $subs_type[0]['end_reg'] > date('Y-m-d')
): ?>
<a href="<?= base_url('graph/show'); ?>" class="btn costmaster-button change-button">Web Access</a>
<?php endif; ?>
<?php
// Define valid subscription types for the first condition
$valid_subscription_types_first = ['6', '7', '8', '24', '25', '26', '27', '29', '31', '32'];
$valid_subscription_types_second = ['1', '3', '5', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32'];
$webaccess = ['2','4'];
$validatewithall = ['1', '3', '5', '6', '7', '8','23', '24', '25', '26', '27', '28', '29', '30', '31', '32'];
// Check if the subscription type is valid and the registration end date is in the future
if (
!empty($subs_type) && is_array($subs_type) &&
isset($subs_type[0]['subscription_type'])
) {
if (
in_array($subs_type[0]['subscription_type'], $valid_subscription_types_first) &&
!in_array($last_subs_type, $valid_subscription_types_first) &&
isset($subs_type[0]['end_reg']) &&
$subs_type[0]['end_reg'] > date('Y-m-d') & $this->uri->uri_string() !== 'graph/view-pdf'
) {
?>
<!-- Display the CIR - FC Reports button for the first condition -->
<a href="<?= base_url('graph/view-pdf') ?>" style="margin:0px !important;"
class="btn costmaster-button change-button">
<i class="fa fa-file-pdf"></i> CIR - FC Reports
</a>
<?php } elseif (!in_array($subs_type[0]['subscription_type'], $valid_subscription_types_second) &&
!empty($last_subs_type) && is_array($last_subs_type) &&
!empty(array_intersect($last_subs_type, $valid_subscription_types_second)) &&
isset($subs_type[0]['end_reg']) &&
$subs_type[0]['end_reg'] > date('Y-m-d') && $this->uri->uri_string() !== 'graph/view-pdf'
) {
?>
<!-- Display the CIR - FC Reports button for the second condition -->
<a href="<?= base_url('graph/view-pdf') ?>" style="margin:0px !important;"
class="btn costmaster-button change-button">
<i class="fa fa-file-pdf"></i> CIR - FC Reports
</a>
<?php } elseif (in_array($subs_type[0]['subscription_type'], $webaccess) &&
!empty($last_subs_type) && is_array($last_subs_type) &&
!empty(array_intersect($last_subs_type, $validatewithall)) &&
isset($subs_type[0]['end_reg']) &&
$subs_type[0]['end_reg'] > date('Y-m-d') && $this->uri->uri_string() !== 'graph/view-pdf'
) {
?>
<!-- Display the CIR - FC Reports button for the second condition -->
<a href="<?= base_url('graph/view-pdf') ?>" style="margin:0px !important;"
class="btn costmaster-button change-button">
<i class="fa fa-file-pdf"></i> CIR - FC Reports
</a>
<?php } else {
// echo "4";
?>
<!-- Display the CIR - FC Reports button for the first condition -->
<!-- <a href="<?= base_url('graph/view-pdf') ?>" style="margin:0px !important;"
class="btn costmaster-button change-button">
<i class="fa fa-file-pdf"></i> CIR - FC Reports
</a> -->
<?php } ?>
<?Php } else {
// echo "not1";
// Define valid subscription types for the second condition
$valid_subscription_types_second = ['1', '2', '3', '5', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32'];
// Check if last_subs_type exists, is an array, and has at least one matching subscription type
if (
!empty($last_subs_type) && is_array($last_subs_type) &&
!empty(array_intersect($last_subs_type, $valid_subscription_types_second)) &&
$this->uri->uri_string() == 'graph/show'
) {
?>
<!-- Display the CIR - FC Reports button for the second condition -->
<a href="<?= base_url('graph/view-pdf') ?>" style="margin:0px !important;"
class="btn costmaster-button change-button">
<i class="fa fa-file-pdf"></i> CIR - FC Reports
</a>
<?php
}
}
?>
<?php if ($subs_type[0]['t_and_c'] == 'true') { ?>
<a href="<?php echo base_url('dashboard'); ?>" class="btn costmaster-button change-button">View
Account</a>
<?php } ?>
<!-- <a href="<?php echo base_url('change-password'); ?>" class="btn costmaster-button change-button">Change Password</a> -->
<a href="<?php echo base_url('logout'); ?>"
class="btn costmaster-button change-button">Logout</a>
</div>
<!-- end:: Title -->
<!-- begin: Header Menu -->
<button class="kt-header-menu-wrapper-close" id="kt_header_menu_mobile_close_btn"><i
class="la la-close"></i></button>
<div class="kt-header-menu-wrapper kt-grid__item kt-grid__item--fluid" id="kt_header_menu_wrapper">
<div id="kt_header_menu"
class="kt-header-menu kt-header-menu-mobile kt-header-menu--layout-default ">
</div>
</div>
<!-- end: Header Menu -->
<!-- begin:: Header Topbar -->
<div class="kt-header__topbar">
<!--begin: Quick panel toggler -->
<div class="kt-header__topbar-item kt-header__topbar-item--quickpanel" data-toggle="kt-tooltip"
title="Quick panel" data-placement="top">
<div class="kt-header__topbar-wrapper">
<span class="kt-header__topbar-icon" id="kt_quick_panel_toggler_btn"><i
class="flaticon2-cube-1"></i></span>
</div>
</div>
<!--end: Quick panel toggler -->
</div>
</div>
<!-- end:: Header Topbar -->
</div>
<!-- end:: Header -->
<!--<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.3.4/jspdf.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/zipcelx/1.3.0/zipcelx.min.js"></script>
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/highcharts-more.js"></script>
<script src="https://code.highcharts.com/maps/modules/map.js"></script>
<script src="https://code.highcharts.com/modules/solid-gauge.js"></script>
<script src="https://code.highcharts.com/modules/series-label.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>
<script src="https://code.highcharts.com/modules/export-data.js"></script>
<script src="https://code.highcharts.com/modules/accessibility.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script type="text/javascript">
$(window).on('unload', function () {
// Perform an AJAX call to update logout time or session status
$.ajax({
type: 'POST',
url: '<?php echo base_url('dashboard/update_logout_time'); ?>',
data: JSON.stringify({ userId: <?php echo $this->session->userdata('id'); ?> }),
success: function (response) {
// Handle success if needed
console.log('Logout time updated successfully');
console.log(response); // Log the response for debugging
},
error: function (xhr, status, error) {
// Handle error if needed
console.error('Error updating logout time:', error);
}
});
});
</script> |