<!doctype html>
<html  xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
	layout:decorate="~{template}">
	<meta charset="utf-8">

<head>

  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
<!--  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">-->
  <meta name="description" content="">
  <meta name="author" content="">

  <title>Speedrent Admin Panel</title>

  <!-- Custom fonts for this template-->
  <link href="/vendor/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css">
  <link href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i" rel="stylesheet">

  <!-- Custom styles for this template-->
  <link href="/css/sb-admin-2.min.css" rel="stylesheet">

  <link href="/css/main.css" rel="stylesheet">
  <link href="/css/ramci-user-edit.css" rel="stylesheet">
  <link href="/css/dark-mode.css" rel="stylesheet">
  <link href="/css/snow-effect.css" rel="stylesheet">
  <link rel="stylesheet" href="/css/font-awesome.min.css">
  <link href="/css/chat-2.min.css" rel="stylesheet">

  <!-- Dark Mode Flash Prevention -->
  <script>
  (function() {
    'use strict';
    // Check localStorage and apply dark mode before page renders
    if (localStorage.getItem('speedhome-dark-mode') === 'enabled') {
      document.documentElement.classList.add('dark-mode');
    }
  })();
  </script>

    <style>
        table td{
        vertical-align:top;
        border:solid 1px #888;
        padding:10px;
        }
    </style>

</head>

<body id="page-top">

        <div class="container-fluid">

            <h1>Oops ...</h1>
            <table>
                <tr>
                    <td>Date</td>
                    <td>Tue Apr 14 12:53:08 SGT 2026</td>
                </tr>
                <tr>
                    <td>Path</td>
                    <td>/sitemap.xml</td>
                </tr>
                <tr>
                    <td>Status</td>
                    <td>500 INTERNAL_SERVER_ERROR</td>
                </tr>
                <tr>
                    <td>Message</td>
                    <td>NoResourceFoundException: No static resource sitemap.xml.</td>
                </tr>
                <tr>
                    <td>Context</td>
                    <td>
                        <pre>N/A</pre>
                    </td>
                </tr>
                <tr>
                    <td>Trace</td>
                    <td>
                        <pre>org.springframework.web.servlet.resource.NoResourceFoundException: No static resource sitemap.xml.
	at org.springframework.web.servlet.resource.ResourceHttpRequestHandler.handleRequest(ResourceHttpRequestHandler.java:585)
	at org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter.handle(HttpRequestHandlerAdapter.java:52)
	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1089)
	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:979)
	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1014)
	at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:903)
	at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:527)
	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:885)
	at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:614)
	at org.eclipse.jetty.ee10.servlet.ServletHolder.handle(ServletHolder.java:751)
	at org.eclipse.jetty.ee10.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1622)
	at org.eclipse.jetty.ee10.websocket.servlet.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:195)
	at org.eclipse.jetty.ee10.servlet.FilterHolder.doFilter(FilterHolder.java:205)
	at org.eclipse.jetty.ee10.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1594)
	at org.springframework.security.web.authentication.preauth.AbstractPreAuthenticatedProcessingFilter.doFilter(AbstractPreAuthenticatedProcessingFilter.java:154)
	at org.eclipse.jetty.ee10.servlet.FilterHolder.doFilter(FilterHolder.java:205)
	at org.eclipse.jetty.ee10.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1594)
	at org.springframework.security.web.authentication.preauth.AbstractPreAuthenticatedProcessingFilter.doFilter(AbstractPreAuthenticatedProcessingFilter.java:154)
	at org.eclipse.jetty.ee10.servlet.FilterHolder.doFilter(FilterHolder.java:205)
	at org.eclipse.jetty.ee10.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1594)
	at com.speedrent.adminpanel.config.APIRequestLoggingFilter.doFilterInternal(APIRequestLoggingFilter.java:87)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
	at org.eclipse.jetty.ee10.servlet.FilterHolder.doFilter(FilterHolder.java:205)
	at org.eclipse.jetty.ee10.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1594)
	at org.springframework.web.filter.CompositeFilter$VirtualFilterChain.doFilter(CompositeFilter.java:108)
	at org.springframework.web.filter.CompositeFilter$VirtualFilterChain.doFilter(CompositeFilter.java:108)
	at org.springframework.security.web.FilterChainProxy.lambda$doFilterInternal$3(FilterChainProxy.java:231)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:365)
	at org.springframework.security.web.access.intercept.AuthorizationFilter.doFilter(AuthorizationFilter.java:101)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374)
	at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:125)
	at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:119)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374)
	at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:131)
	at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:85)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374)
	at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:100)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374)
	at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:179)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374)
	at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374)
	at org.springframework.security.web.authentication.preauth.AbstractPreAuthenticatedProcessingFilter.doFilter(AbstractPreAuthenticatedProcessingFilter.java:154)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374)
	at org.springframework.security.web.authentication.preauth.AbstractPreAuthenticatedProcessingFilter.doFilter(AbstractPreAuthenticatedProcessingFilter.java:154)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374)
	at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:107)
	at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:93)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374)
	at org.springframework.security.web.header.HeaderWriterFilter.doHeadersAfter(HeaderWriterFilter.java:90)
	at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:75)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374)
	at org.springframework.security.web.context.SecurityContextHolderFilter.doFilter(SecurityContextHolderFilter.java:82)
	at org.springframework.security.web.context.SecurityContextHolderFilter.doFilter(SecurityContextHolderFilter.java:69)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374)
	at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:62)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374)
	at org.springframework.security.web.session.ForceEagerSessionCreationFilter.doFilterInternal(ForceEagerSessionCreationFilter.java:45)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374)
	at org.springframework.security.web.session.DisableEncodeUrlFilter.doFilterInternal(DisableEncodeUrlFilter.java:42)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374)
	at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:233)
	at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:191)
	at org.springframework.web.filter.CompositeFilter$VirtualFilterChain.doFilter(CompositeFilter.java:113)
	at org.springframework.web.filter.ServletRequestPathFilter.doFilter(ServletRequestPathFilter.java:52)
	at org.springframework.web.filter.CompositeFilter$VirtualFilterChain.doFilter(CompositeFilter.java:113)
	at org.springframework.web.filter.CompositeFilter.doFilter(CompositeFilter.java:74)
	at org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration$CompositeFilterChainProxy.doFilter(WebSecurityConfiguration.java:319)
	at org.springframework.web.filter.CompositeFilter$VirtualFilterChain.doFilter(CompositeFilter.java:113)
	at org.springframework.web.servlet.handler.HandlerMappingIntrospector.lambda$createCacheFilter$4(HandlerMappingIntrospector.java:267)
	at org.springframework.web.filter.CompositeFilter$VirtualFilterChain.doFilter(CompositeFilter.java:113)
	at org.springframework.web.filter.CompositeFilter.doFilter(CompositeFilter.java:74)
	at org.springframework.security.config.annotation.web.configuration.WebMvcSecurityConfiguration$CompositeFilterChainProxy.doFilter(WebMvcSecurityConfiguration.java:240)
	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:362)
	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:278)
	at org.eclipse.jetty.ee10.servlet.FilterHolder.doFilter(FilterHolder.java:205)
	at org.eclipse.jetty.ee10.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1594)
	at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
	at org.eclipse.jetty.ee10.servlet.FilterHolder.doFilter(FilterHolder.java:205)
	at org.eclipse.jetty.ee10.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1594)
	at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
	at org.eclipse.jetty.ee10.servlet.FilterHolder.doFilter(FilterHolder.java:205)
	at org.eclipse.jetty.ee10.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1594)
	at org.springframework.session.web.http.SessionRepositoryFilter.doFilterInternal(SessionRepositoryFilter.java:142)
	at org.springframework.session.web.http.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:82)
	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:362)
	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:278)
	at org.eclipse.jetty.ee10.servlet.FilterHolder.doFilter(FilterHolder.java:205)
	at org.eclipse.jetty.ee10.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1594)
	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
	at org.eclipse.jetty.ee10.servlet.FilterHolder.doFilter(FilterHolder.java:205)
	at org.eclipse.jetty.ee10.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1594)
	at org.eclipse.jetty.ee10.servlet.ServletHandler$MappedServlet.handle(ServletHandler.java:1555)
	at org.eclipse.jetty.ee10.servlet.ServletChannel.dispatch(ServletChannel.java:823)
	at org.eclipse.jetty.ee10.servlet.ServletChannel.handle(ServletChannel.java:440)
	at org.eclipse.jetty.ee10.servlet.ServletHandler.handle(ServletHandler.java:470)
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:575)
	at org.eclipse.jetty.ee10.servlet.SessionHandler.handle(SessionHandler.java:717)
	at org.eclipse.jetty.server.handler.ContextHandler.handle(ContextHandler.java:1071)
	at org.eclipse.jetty.server.Handler$Wrapper.handle(Handler.java:740)
	at org.eclipse.jetty.server.handler.EventsHandler.handle(EventsHandler.java:81)
	at org.eclipse.jetty.server.Server.handle(Server.java:182)
	at org.eclipse.jetty.server.internal.HttpChannelState$HandlerInvoker.run(HttpChannelState.java:677)
	at org.eclipse.jetty.server.internal.HttpConnection.onFillable(HttpConnection.java:416)
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:322)
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:99)
	at org.eclipse.jetty.io.SelectableChannelEndPoint$1.run(SelectableChannelEndPoint.java:53)
	at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.runTask(AdaptiveExecutionStrategy.java:480)
	at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.consumeTask(AdaptiveExecutionStrategy.java:443)
	at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.tryProduce(AdaptiveExecutionStrategy.java:293)
	at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.run(AdaptiveExecutionStrategy.java:201)
	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:311)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:981)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.doRunJob(QueuedThreadPool.java:1211)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1166)
	at java.base/java.lang.Thread.run(Thread.java:1583)
</pre>
                    </td>
                </tr>
            </table>

        </div>
        <!-- /.container-fluid -->

      
    <!-- Footer -->
    <footer class="sticky-footer bg-white">
      <div class="container my-auto">
        <div class="copyright text-center my-auto">
          <span>Copyright &copy; Speedrent Technology Sdn Bhd 2026</span>
        </div>
      </div>
    </footer>
    <!-- End of Footer -->

<!-- Logout Modal-->
<div aria-hidden="true" aria-labelledby="exampleModalLabel" class="modal fade" id="logoutModal" role="dialog"
     tabindex="-1">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="exampleModalLabel">Ready to Leave?</h5>
                <button aria-label="Close" class="close" data-dismiss="modal" type="button">
                    <span aria-hidden="true">�</span>
                </button>
            </div>
            <div class="modal-body">Select "Logout" below if you are ready to end your current session.</div>
            <div class="modal-footer">
                <button class="btn btn-secondary" data-dismiss="modal" type="button">Cancel</button>
                <a class="btn btn-primary" href="/logout">Logout</a>
            </div>
        </div>
    </div>
</div>


<!-- Bootstrap core JavaScript-->
<script src="/vendor/jquery/jquery.min.js"></script>
<script src="//code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script src="/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>

<!-- Core plugin JavaScript-->
<script src="/vendor/jquery-easing/jquery.easing.min.js"></script>

<!-- Custom scripts for all pages-->
<script src="/js/sb-admin-2.min.js"></script>

<!-- JQuery Cookie JavaScript-->
<script src="/vendor/jquery/jquery.cookie.js"></script>

<!-- api js -->
<script src="/js/api.js"></script>

<!-- Dark mode toggle -->
<script src="/js/dark-mode.js"></script>

<!-- Snow effect for December -->
<script src="/js/snow-effect.js"></script>

<!-- Sortable.js for drag-and-drop -->
<script src="https://cdn.jsdelivr.net/npm/sortablejs@1.15.0/Sortable.min.js"></script>

<!-- Homerunner worker assignment utilities -->
<script src="/js/homerunner-worker-assignment.js"></script>

<script>

    // ugly :P
    var lnaProperty;

    function deleteConfirmation() {
        return 'confirm you want to delete this item?';
    }

    function blockConfirmation() {
        return 'confirm you want to block this user?';
    }

    function passwordResetConfirmation() {
        return 'confirm you want to reset password for this user?';
    }

    function deactivateProperty(id) {
        var reason = prompt("What is your reason?");
        if (reason == "null" || reason == null || reason == "") {
            console.log("DEACTIVATION CANCELED");
        } else {
            location.href = '/admin/property/edit/' + id + '/DEACTIVATE/' + reason;
        }
    }

    function capturePropertyId(id) {
        lnaProperty = id;
    }

    function checkAndOpenLNA(button) {
        var propertyId = $(button).data('property-id');
        var propertyRef = $(button).data('property-ref');

        // Show loading indicator
        $(button).prop('disabled', true);
        var originalText = $(button).text();
        $(button).html('<i class="fa fa-spinner fa-spin"></i>');

        $.ajax({
            url: '/admin/property/' + propertyId + '/hasActiveCollectedKey',
            type: 'GET',
            success: function(response) {
                $(button).prop('disabled', false);
                $(button).text(originalText);
                lnaProperty = propertyId; // Store for later use

                if (response.hasActiveCollectedKey) {
                    // Show WARNING modal with options
                    var ref = response.propertyRef || propertyRef;
                    var masterKeyUrl = '/admin/homerunner/masterKeyList?propertyRef=' + encodeURIComponent(ref);
                    $('#activeKeyWarningMasterKeyLink').attr('href', masterKeyUrl);
                    $('#activeKeyWarningModal').modal('show');
                } else {
                    // No active key, proceed directly to LNA
                    $('#lnaPopup').modal('show');
                }
            },
            error: function() {
                $(button).prop('disabled', false);
                $(button).text(originalText);
                // Fail-open: proceed with LNA
                lnaProperty = propertyId;
                $('#lnaPopup').modal('show');
            }
        });
    }

    // Called when user clicks "Proceed Anyway" in warning modal
    function proceedWithLNADespiteWarning() {
        $('#activeKeyWarningModal').modal('hide');
        $('#lnaPopup').modal('show');
    }

    function captureActivationPropertyId(id) {
        var propertyIdInput = document.getElementById("propertyId");
        if (propertyIdInput) {
            propertyIdInput.value = id;
        }
    }

    function calculateViewingDate() {
        var reason = document.getElementById('reactivationReason').value;
        if (!reason) return;

        var now = new Date();
        var targetDate;

        if (reason === 'landlord') {
            // If before 9 AM, use today 9 AM. Otherwise round to next hour
            if (now.getHours() < 9) {
                targetDate = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 9, 0);
            } else {
                targetDate = new Date(now);
                targetDate.setHours(targetDate.getHours() + 1);
                targetDate.setMinutes(0);
                targetDate.setSeconds(0);
            }
        } else if (reason === 'speedfix') {
            // 5 days from now at 9 AM
            targetDate = new Date(now);
            targetDate.setDate(targetDate.getDate() + 5);
            targetDate.setHours(9, 0, 0);
        } else if (reason === 'ops') {
            // 14 days from now at 9 AM
            targetDate = new Date(now);
            targetDate.setDate(targetDate.getDate() + 14);
            targetDate.setHours(9, 0, 0);
        }

        if (targetDate) {
            // Format to datetime-local: YYYY-MM-DDTHH:mm
            var year = targetDate.getFullYear();
            var month = String(targetDate.getMonth() + 1).padStart(2, '0');
            var day = String(targetDate.getDate()).padStart(2, '0');
            var hours = String(targetDate.getHours()).padStart(2, '0');
            var minutes = String(targetDate.getMinutes()).padStart(2, '0');
            var formatted = year + '-' + month + '-' + day + 'T' + hours + ':' + minutes;

            document.getElementById('viewingAvailableDate').value = formatted;
        }
    }

    function propertyLNA() {
        var lnaReason = document.getElementById("lnaReason").value;
        if (lnaReason != null && lnaReason !== '') {
            var frm = document.getElementById('LNAform') || null;
            if (frm) {
                frm.action = '/admin/property/edit/' + lnaProperty + '/LNA';
                frm.submit();
            } else {
                alert("Something when wrong. Form not working :P");
            }
        } else {
            alert("Fail to LNA as reason are empty/invalid!");
        }
    }

    function rejectProperty(id) {
        var reason = prompt("What is your reason?");
        if (reason == "null" || reason == null || reason == "") {
            console.log("REJECTION CANCELED");
        } else {
            location.href = '/admin/property/edit/' + id + '/REJECT/' + reason;
        }
    }

    function deactivateUser(id) {
        var reason = prompt("What is your reason?");
        if (reason == "null" || reason == null || reason == "") {
            console.log("DEACTIVATION CANCELED");
        } else {
            location.href = '/admin/mobileUser/edit/' + id + '/DEACTIVATE/' + reason;
        }
    }

    // Event listeners for property activation buttons with data attributes
    document.addEventListener('click', function(e) {
        if (e.target.classList.contains('capture-property-id-btn')) {
            const propertyId = e.target.getAttribute('data-property-id');
            capturePropertyId(propertyId);
        } else if (e.target.classList.contains('capture-activation-property-id-btn')) {
            const propertyId = e.target.getAttribute('data-property-id');
            captureActivationPropertyId(propertyId);
        } else if (e.target.classList.contains('deactivate-user-btn')) {
            const userId = e.target.getAttribute('data-user-id');
            deactivateUser(userId);
        }
    });

</script>

<!--unhide number-->
<script>
    function unhidePhoneNumber(element) {
        var enc = $(element).data('enc');
        var source = $(element).data('source');
        if (source == null) {
            source = ''
        }

        $.ajax({
            url: '/admin/unhide/phone/' + enc + '?source=' + source,
            method: "GET",
            contentType: "application/json;charset=utf-8",
            xhrFields: { withCredentials: true },
            success: function (data) {
                console.log(data);
                $(element).html(data);
            },
            error: function (data) {
                alert("Fail to get number");
            }
        });
    }

</script>
<script>

    function filterCardBylabel() {
        if ($('#label').val() === '') {
            alert("Please Select Filter label for search card!!");
            return false;
        }
        window.location.href = window.location.pathname + "?filter=" + $('#label').val();
    }

    $(document).ready(function () {
        var url = new URL(window.location.href);
        var filter = url.searchParams.get('filter')
        console.log(url);
        console.log(url.searchParams.get('filter'));
        $('#label').children("option[value='" + filter + "']").prop('selected', true)
    });
</script>

</body>

</html>
    