<?php
require_once("../config/session.php");
require_once("../config/function.php");
$main_site_data = main_site_data();
$site_data = site_data();

if(isset($_SESSION["is_login"]) && isset($_SESSION["login_token"])){
if($_SESSION["is_login"]==true && !empty($_SESSION["login_token"])){
$user_data = user_data($_SESSION["login_token"]);
if(empty($user_data['user_id']) || $user_data['login_token']!=$_SESSION["login_token"]){
session_destroy();  
redirect("logout",0);
die; 
}
}else{
session_destroy();  
redirect("logout",0);
die;  
}
}else{
session_destroy();  
redirect("logout",0);
die;  
}

$csrf = aes_encrypt($user_data['login_token'],$site_data['user_id']);

if($user_data['usertype']=="White Label" && $user_data['site_id']==$site_data['site_id']){
session_destroy();  
redirect("logout",0);
die;
}

if($user_data['usertype']=="White Label" && $user_data['user_id']!=$site_data['user_id']){
session_destroy();  
redirect("logout",0);
die;
}


?>
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title> Dashboard | <?=$site_data['brand']?></title>
    <script>if(window.history.replaceState){window.history.replaceState(null,null,window.location.href);}</script>
    <meta name="author" content="MTG WEB OFFICIAL">
    <meta property="og:locale" content="en_US">
    <meta name="description" content="">
    <meta content="<?=$csrf?>" name="csrf" />
    <link rel="icon" href="<?=$site_data['logo']?>" type="image/*" sizes="16x16">
    <meta name="theme-color" content="#3063A0">
    <link href="https://fonts.googleapis.com/css?family=Fira+Sans:400,500,600" rel="stylesheet"><!-- End Google font -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/open-iconic/1.1.1/font/css/open-iconic-bootstrap.min.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <link rel="stylesheet" href="../layouts/members/assets/stylesheets/theme.min.css" data-skin="default">
    <link rel="stylesheet" href="../layouts/members/assets/stylesheets/theme-dark.min.css" data-skin="dark">
    <link rel="stylesheet" href="../layouts/members/assets/stylesheets/custom.css">
    <script src="../layouts/members/assets/vendor/jquery/jquery.min.js"></script>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatpickr/dist/flatpickr.min.css">
    <script src="https://cdn.jsdelivr.net/npm/flatpickr"></script>
    
<script>
   var skin = localStorage.getItem('skin') || 'default';
   var disabledSkinStylesheet = document.querySelector('link[data-skin]:not([data-skin="' + skin + '"])');
   disabledSkinStylesheet.setAttribute('rel', '');
   disabledSkinStylesheet.setAttribute('disabled', true);
   document.querySelector('html').classList.add('loading');
</script>
 <script>
  document.addEventListener('DOMContentLoaded', function () {
    document.querySelectorAll('img').forEach(function(img) {
      img.setAttribute('draggable', 'false');
      img.addEventListener('dragstart', function(e) {
        e.preventDefault();
      });
    });
  });
</script>
<script>
  document.addEventListener('DOMContentLoaded', function () {
    document.querySelectorAll('*').forEach(function(el) {
      el.setAttribute('draggable', 'false');
      el.addEventListener('dragstart', function(e) {
        e.preventDefault();
      });
    });
  });
</script>


<style>
.logo {
	max-width: 100%;
	height: auto;
}
.hand {
  cursor: pointer;
}
.hr {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}
.card-icon img {
    height: 60px;
}
.form-select {
    display: block;
    width: 100%;
    height: calc(1.5em + 0.75rem + 2px);
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #363642;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #c6c9d5;
    border-radius: 0.25rem;
    transition: border-color .15s ease-in-out,box-shadow .15s ease-in-out;
}
.form-select-sm {
    height: calc(1.5em + 0.5rem + 2px);
    padding: 0.25rem 0.5rem;
    font-size: .875rem;
    line-height: 1.5;
    border-radius: 0.2rem;
}
::-webkit-scrollbar {
  width: 10px;
}
/* Track */
::-webkit-scrollbar-track {
  box-shadow: inset 0 0 5px grey; 
  border-radius: 10px;
}
 
/* Handle */
::-webkit-scrollbar-thumb {
  background: #346cb0; 
  border-radius: 10px;
}

/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
  background: #2f63a3; 
}
.modal-header {
    padding: 0.75rem;
    border-bottom: 1px solid rgba(34,34,48,.1);
}

.modal-footer {
    padding: 0.35rem;
    border-top: 1px solid rgba(34,34,48,.1);
}
.text-white {
    color: #ffffff!important;
}

html, body {
  margin: 0;
  padding: 0;
}

#page-loader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  padding: clamp(14px, 3vw, 30px);
  overflow: auto;
  background:
    radial-gradient(circle at 10% 10%, rgba(170, 136, 71, .10), transparent 54%),
    radial-gradient(circle at 90% 90%, rgba(16, 35, 63, .10), transparent 58%),
    linear-gradient(135deg, rgba(248, 241, 223, .10), rgba(248, 241, 223, .10));
  -webkit-backdrop-filter: blur(40px);
  backdrop-filter: blur(40px);
  font-family: Georgia, 'Times New Roman', serif;
  pointer-events: auto;
}

.pciv-loader-shell {
  display: flex;
  width: min(100%, 390px);
  margin: auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #10233f;
  text-align: center;
}

.pciv-loader-stage {
  position: relative;
  width: clamp(270px, 72vw, 340px);
  height: clamp(214px, 55vw, 260px);
  perspective: 1100px;
}

.pciv-loader-rings {
  position: absolute;
  top: 50%;
  left: 50%;
  width: clamp(230px, 62vw, 300px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  transform-origin: center;
  will-change: transform, opacity;
  animation: pciv-rings-pulse 4.8s ease-in-out infinite;
}

.pciv-loader-ring {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(16, 35, 63, .27);
  border-radius: 50%;
  will-change: transform;
  animation: pciv-ring-turn 7.5s linear infinite;
}

.pciv-loader-ring::after {
  content: '';
  position: absolute;
  top: -2px;
  left: 50%;
  width: 28%;
  height: 3px;
  border-radius: 999px;
  background: #aa8847;
  transform: translateX(-50%);
}

.pciv-loader-ring:nth-child(2) {
  inset: 14px;
  border-style: dashed;
  border-color: rgba(170, 136, 71, .47);
  animation-direction: reverse;
  animation-duration: 10.5s;
}

.pciv-loader-ring:nth-child(2)::after {
  width: 18%;
  height: 2px;
  background: #10233f;
}

.pciv-loader-ring:nth-child(3) {
  inset: 29px;
  border-color: rgba(16, 35, 63, .18);
  animation-duration: 15s;
}

.pciv-loader-card-float {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  width: clamp(226px, 60vw, 282px);
  aspect-ratio: 1.586;
  transform-style: preserve-3d;
  animation: pciv-card-float 5.6s ease-in-out infinite;
}

.pciv-loader-card {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 1px solid #aa8847;
  border-radius: clamp(12px, 3vw, 17px);
  background: #f8f1df;
  box-shadow: 0 20px 38px rgba(16, 35, 63, .24), inset 0 0 0 3px rgba(255, 255, 255, .58);
  color: #10233f;
  transform: rotateX(4deg) rotateY(-7deg);
}

.pciv-loader-card::before {
  content: '';
  position: absolute;
  z-index: 5;
  top: -55%;
  bottom: -55%;
  left: -38%;
  width: 17%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .72), transparent);
  transform: rotate(17deg);
  animation: pciv-card-reflection 5.2s ease-in-out infinite;
  pointer-events: none;
}

.pciv-loader-card-header {
  display: flex;
  height: 39px;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  border-bottom: 2px solid #aa8847;
  background: #10233f;
  color: #f8f1df;
}

.pciv-loader-card-title {
  font-size: clamp(8px, 2.2vw, 10px);
  font-weight: 700;
  letter-spacing: .17em;
  text-transform: uppercase;
}

.pciv-loader-chip {
  position: relative;
  width: 28px;
  height: 19px;
  border: 1px solid #80652e;
  border-radius: 4px;
  background: #c4a767;
}

.pciv-loader-chip::before,
.pciv-loader-chip::after {
  content: '';
  position: absolute;
  background: rgba(72, 54, 22, .42);
}

.pciv-loader-chip::before {
  top: 50%;
  right: 3px;
  left: 3px;
  height: 1px;
}

.pciv-loader-chip::after {
  top: 3px;
  bottom: 3px;
  left: 50%;
  width: 1px;
}

.pciv-loader-card-body {
  display: grid;
  grid-template-columns: 66px 1fr;
  gap: 12px;
  padding: 13px 14px 12px;
}

.pciv-loader-photo {
  position: relative;
  height: 83px;
  overflow: hidden;
  border: 1px solid #aa8847;
  border-radius: 7px;
  background: #e8deca;
}

.pciv-loader-photo::before {
  content: '';
  position: absolute;
  top: 13px;
  left: 50%;
  width: 26px;
  height: 31px;
  border-radius: 48% 48% 45% 45%;
  background: #8a8175;
  transform: translateX(-50%);
  box-shadow: inset -5px -3px 0 rgba(16, 35, 63, .13);
}

.pciv-loader-photo::after {
  content: '';
  position: absolute;
  bottom: -19px;
  left: 50%;
  width: 62px;
  height: 56px;
  border-radius: 48% 48% 12px 12px;
  background: #10233f;
  transform: translateX(-50%);
}

.pciv-loader-details {
  min-width: 0;
  padding-top: 1px;
  text-align: left;
}

.pciv-loader-detail-kicker {
  display: block;
  margin-bottom: 5px;
  color: #80652e;
  font: 700 7px/1.2 'Fira Sans', Arial, sans-serif;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.pciv-loader-detail-name {
  display: block;
  margin-bottom: 9px;
  color: #10233f;
  font-size: clamp(11px, 3vw, 14px);
  font-weight: 700;
  letter-spacing: .03em;
}

.pciv-loader-detail-row {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 5px;
  margin-top: 5px;
  font: 600 7px/1.2 'Fira Sans', Arial, sans-serif;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.pciv-loader-detail-label {
  color: #8e7a52;
}

.pciv-loader-detail-value {
  overflow: hidden;
  color: #34445c;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pciv-loader-seal {
  position: absolute;
  z-index: 4;
  right: 10px;
  bottom: 9px;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid #80652e;
  border-radius: 50%;
  background: #c4a767;
  box-shadow: inset 0 0 0 3px #f8f1df, inset 0 0 0 4px #aa8847;
  color: #10233f;
  font: 700 10px/1 Georgia, serif;
  letter-spacing: .04em;
}

.pciv-loader-seal::before {
  content: '•  VERIFIED  •  VERIFIED  ';
  position: absolute;
  inset: -7px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(128, 101, 46, .82);
  border-radius: 50%;
  color: #80652e;
  font: 700 4px/1 Arial, sans-serif;
  letter-spacing: .08em;
  animation: pciv-seal-turn 16s linear infinite;
}

.pciv-loader-scan {
  position: absolute;
  z-index: 6;
  top: 4%;
  right: 0;
  left: 0;
  height: 2px;
  background: #b89650;
  box-shadow: 0 2px 5px rgba(170, 136, 71, .28);
  opacity: 0;
  animation: pciv-scan-pass 3.8s ease-in-out infinite;
}

.pciv-loader-verified {
  position: absolute;
  z-index: 7;
  top: 31px;
  right: -12px;
  display: grid;
  width: 39px;
  height: 39px;
  place-items: center;
  border: 2px solid #f8f1df;
  border-radius: 50%;
  background: #10233f;
  box-shadow: 0 0 0 1px #aa8847, 0 8px 18px rgba(16, 35, 63, .2);
  animation: pciv-check-pulse 2.4s ease-in-out infinite;
}

.pciv-loader-verified svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: #c4a767;
  stroke-width: 2.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 27;
  stroke-dashoffset: 27;
  animation: pciv-check-draw 3.8s ease-in-out infinite;
}

.pciv-loader-heading {
  margin: 1px 0 5px;
  color: #10233f;
  font-size: clamp(19px, 5vw, 23px);
  font-weight: 700;
  letter-spacing: .025em;
  text-shadow: 0 1px 2px rgba(255, 255, 255, .94);
}

#loading-text {
  min-height: 21px;
  margin: 0 0 5px;
  color: #80652e;
  font: 600 clamp(13px, 3.5vw, 15px)/1.35 'Fira Sans', Arial, sans-serif;
  letter-spacing: .035em;
  text-shadow: 0 1px 2px rgba(255, 255, 255, .94);
}

.pciv-loader-caption {
  max-width: 330px;
  margin: 0;
  color: #45546a;
  font: 400 clamp(11px, 3vw, 13px)/1.5 'Fira Sans', Arial, sans-serif;
  text-shadow: 0 1px 3px rgba(255, 255, 255, .98);
}

.pciv-loader-progress {
  position: relative;
  width: min(72%, 238px);
  height: 3px;
  margin: 15px auto 0;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(16, 35, 63, .2);
}

.pciv-loader-progress::after {
  content: '';
  position: absolute;
  top: 0;
  left: -34%;
  width: 34%;
  height: 100%;
  border-radius: inherit;
  background: #aa8847;
  box-shadow: 15px 0 0 #10233f;
  animation: pciv-progress-pass 2.6s ease-in-out infinite;
}

.pciv-loader-actions {
  display: flex;
  width: 100%;
  min-height: 54px;
  align-items: flex-start;
  justify-content: center;
}

#cancel-loader-btn {
  display: none;
  min-width: 136px;
  margin: 16px auto 0;
  padding: 9px 19px;
  border: 1px solid #80652e;
  border-radius: 3px;
  outline: none;
  background: rgba(248, 241, 223, .94);
  box-shadow: 0 5px 13px rgba(16, 35, 63, .1);
  color: #10233f;
  font: 600 12px/1.2 'Fira Sans', Arial, sans-serif;
  letter-spacing: .045em;
  cursor: pointer;
  transition: color .25s ease, background-color .25s ease, box-shadow .25s ease, transform .25s ease;
}

#cancel-loader-btn:hover {
  background: #10233f;
  box-shadow: 0 8px 18px rgba(16, 35, 63, .19);
  color: #f8f1df;
  transform: translateY(-2px);
}

#cancel-loader-btn:active {
  transform: translateY(0);
}

#cancel-loader-btn:focus-visible {
  outline: 2px solid #aa8847;
  outline-offset: 3px;
}

@keyframes pciv-ring-turn {
  to { transform: rotate(360deg); }
}

@keyframes pciv-rings-pulse {
  0%, 100% {
    opacity: .9;
    transform: translate(-50%, -50%) scale(.985);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes pciv-seal-turn {
  to { transform: rotate(-360deg); }
}

@keyframes pciv-card-float {
  0%, 100% { transform: translate(-50%, -50%) translateY(0) rotateX(1deg) rotateY(-3deg); }
  50% { transform: translate(-50%, -50%) translateY(-9px) rotateX(-3deg) rotateY(4deg); }
}

@keyframes pciv-card-reflection {
  0%, 28% { left: -38%; opacity: 0; }
  38% { opacity: .72; }
  65%, 100% { left: 126%; opacity: 0; }
}

@keyframes pciv-scan-pass {
  0%, 10% { top: 4%; opacity: 0; }
  18%, 82% { opacity: .9; }
  92%, 100% { top: 94%; opacity: 0; }
}

@keyframes pciv-check-pulse {
  0%, 100% { transform: scale(.96); }
  50% { transform: scale(1.04); }
}

@keyframes pciv-check-draw {
  0%, 20% { stroke-dashoffset: 27; }
  45%, 100% { stroke-dashoffset: 0; }
}

@keyframes pciv-progress-pass {
  0% { left: -34%; }
  62%, 100% { left: 110%; }
}

@media (max-width: 480px) {
  #page-loader { padding: 12px; }
  .pciv-loader-stage { height: 218px; }
  .pciv-loader-card-body { grid-template-columns: 59px 1fr; gap: 10px; padding: 11px 12px 10px; }
  .pciv-loader-photo { height: 73px; }
  .pciv-loader-seal { right: 8px; bottom: 7px; width: 37px; height: 37px; }
}

@media (max-height: 600px) {
  .pciv-loader-stage { height: 192px; }
  .pciv-loader-rings { width: 222px; }
  .pciv-loader-card-float { width: 222px; }
  .pciv-loader-heading { font-size: 18px; }
  .pciv-loader-progress { margin-top: 10px; }
  .pciv-loader-actions { min-height: 45px; }
  #cancel-loader-btn { margin-top: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .pciv-loader-rings,
  .pciv-loader-ring,
  .pciv-loader-seal::before,
  .pciv-loader-card-float,
  .pciv-loader-card::before,
  .pciv-loader-scan,
  .pciv-loader-verified,
  .pciv-loader-verified svg,
  .pciv-loader-progress::after {
    animation-duration: 10s;
  }
}
.pciv-status-active {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #16a34a;
  font-weight: 700;
}

.pciv-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.15);
}
</style>
</head>
  <body>
<div id="page-loader" role="status" aria-live="polite" aria-label="Identity verification is in progress">
  <div class="pciv-loader-shell">
    <div class="pciv-loader-stage" aria-hidden="true">
      <div class="pciv-loader-rings">
        <span class="pciv-loader-ring"></span>
        <span class="pciv-loader-ring"></span>
        <span class="pciv-loader-ring"></span>
      </div>

      <div class="pciv-loader-card-float">
        <div class="pciv-loader-card">
          <div class="pciv-loader-card-header">
            <span class="pciv-loader-card-title"><?=$site_data['brand']?></span>
            <span class="pciv-loader-chip"></span>
          </div>

        <div class="pciv-loader-card-body">
  <span class="pciv-loader-photo"></span>

  <span class="pciv-loader-details">
    <span class="pciv-loader-detail-kicker">Identity Holder</span>
    <span class="pciv-loader-detail-name">
      <?= htmlspecialchars($user_data['name'] ?? '', ENT_QUOTES, 'UTF-8') ?>
    </span>

    <span class="pciv-loader-detail-row">
      <span class="pciv-loader-detail-label">ID No.</span>
      <span class="pciv-loader-detail-value">
        <?= htmlspecialchars($user_data['mobile'] ?? '', ENT_QUOTES, 'UTF-8') ?>
      </span>
    </span>

    <span class="pciv-loader-detail-row">
     <span class="pciv-loader-detail-label">Status</span>
<span class="pciv-loader-detail-value">Active</span>
    </span>
  </span>
</div>

          <span class="pciv-loader-seal">ID</span>
          <span class="pciv-loader-scan"></span>
        </div>

        <span class="pciv-loader-verified">
          <svg viewBox="0 0 24 24" aria-hidden="true"><path d="M5 12.5l4.2 4.2L19 7"></path></svg>
        </span>
      </div>
    </div>

    <div class="pciv-loader-heading">Identity Verification</div>
    <div id="loading-text">Processing Your ID Card...</div>
    <p class="pciv-loader-caption">Please wait while we securely verify your information.</p>
    <div class="pciv-loader-progress" aria-hidden="true"></div>
    <div class="pciv-loader-actions">
      <button id="cancel-loader-btn" type="button">Cancel Request</button>
    </div>
  </div>
</div>
    <div class="app">
      <header class="app-header app-header-dark">
        <div class="top-bar">
          <div class="top-bar-brand">
            <button class="hamburger hamburger-squeeze mr-2" type="button" data-toggle="aside-menu" aria-label="toggle aside menu"><span class="hamburger-box"><span class="hamburger-inner"></span></span></button>
            <a href="dashboard"><img src="<?=$site_data['logo']?>" class="logo" style="height:50px;"></a>
          </div>
          <div class="top-bar-list">
            <div class="top-bar-item px-2 d-md-none d-lg-none d-xl-none">
              <button class="hamburger hamburger-squeeze" type="button" data-toggle="aside" aria-label="toggle menu"><span class="hamburger-box"><span class="hamburger-inner"></span></span></button> 
            </div>
            <div class="top-bar-item top-bar-item-right px-0">
              <ul class="header-nav nav">
                <li class="nav-item header-nav-dropdown">
                  <a class="btn btn-dark btn-sm mt-1" href="addmoney"><span class="fas fa-wallet"> <?=round($user_data['balance'],2)?></span></a>
                </li>
              </ul>
              <div class="dropdown">
                <button class="btn-account" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                  <span class="tile tile-circle tile-md mr-2"> <span class="oi oi-person"></span> </span>
                  <span class="account-summary pr-lg-4 d-none d-lg-block"><span class="account-name"><?=$user_data['name']?></span> <span class="account-description"><?=$user_data['usertype']?></span></span></button> <!-- .dropdown-menu -->
                <div class="dropdown-menu">
                  <div class="dropdown-arrow d-lg-none" x-arrow=""></div>
                  <div class="dropdown-arrow ml-3 d-none d-lg-block"></div>
                  <h6 class="dropdown-header d-none d-md-block d-lg-none"> <?=$user_data['name']?> </h6>
                  <a class="dropdown-item" href="profile"><span class="dropdown-icon oi oi-person"></span> Profile</a> 
                  <a class="dropdown-item" href="logout"><span class="dropdown-icon oi oi-account-logout"></span> Logout</a>
                  <div class="dropdown-divider"></div><a class="dropdown-item" href="helpcenter">Help Center</a>
                </div>
              </div>
            </div>
          </div>
        </div>
      </header>
      <aside class="app-aside app-aside-expand-md app-aside-light">
        <div class="aside-content">
          <div class="aside-menu overflow-hidden">
            <nav id="stacked-menu" class="stacked-menu">
              <ul class="menu">
                <li class="menu-item has-active mb-2">
                  <a href="dashboard" class="menu-link"><span class="menu-icon fas fa-home"></span> <span class="menu-text">Dashboard</span></a>
                </li>

             <?php if(in_array($user_data['usertype'], ['White Label','Master Distributor','Distributor','Retailer'])){ ?>
                <!--<li class="menu-item has-child mb-2">-->
                <!--  <a href="#" class="menu-link"><span class="menu-icon fas fa-id-card"></span> <span class="menu-text">PAN Find Services</span></a> -->
                <!--  <ul class="menu">-->
                <!--    <li class="menu-item">-->
                <!--      <a href="panfind" class="menu-link">PAN Find </a>-->
                <!--        <a href="PanDetails" class="menu-link">Pan Details</a>-->
                <!--    </li>-->
                <!--    <li class="menu-item">-->
                <!--      <a href="listofpanfind" class="menu-link">PAN Find List</a>-->
                <!--    </li>-->
                <!--  </ul>-->
                <!--</li>-->
                
                <li class="menu-item has-child mb-2">
                  <a href="#" class="menu-link"><span class="menu-icon fas fa-leaf"></span> <span class="menu-text">Print Manage</span></a> 
                  <ul class="menu">
                    <li class="menu-item">
                      <a href="printRecord" class="menu-link">Records</a>
                    </li>
                  </ul>
                </li>
                
                 <li class="menu-item mb-2">
                  <a href="listofpanfind" class="menu-link"><span class="menu-icon fas fa-id-card" ></span> <span class="menu-text">Pan Find List</span></a>
                </li>

                <li class="menu-item has-child mb-2">
                  <a href="#" class="menu-link"><span class="menu-icon fas fa-wallet"></span> <span class="menu-text">Wallet Manage</span> 
                    <span class="badge badge-subtle badge-success d-compact-menu-none">₹<?=round($user_data['balance'],2)?></span></a> 
                  <ul class="menu">
                    <li class="menu-item">
                      <a href="addmoney" class="menu-link">Add Money</a>
                    </li>
                    <li class="menu-item">
                      <a href="walletledger" class="menu-link">Transaction</a>
                    </li>
                  </ul>
                </li>
            <?php } ?>
            <?php if(in_array($user_data['usertype'], ['Admin','Master Distributor','Distributor'])){ ?>               
                <li class="menu-item has-child mb-2">
                  <a href="#" class="menu-link"><span class="menu-icon fas fa-users"></span> <span class="menu-text">Members Manage</span></a> 
                  <ul class="menu">
                    <li class="menu-item">
                      <a href="addmember" class="menu-link">Add Member</a>
                    </li>
                    <li class="menu-item">
                      <a href="listofmember" class="menu-link">Member List</a>
                    </li>
                  </ul>
                </li>
            <?php } ?>
            <?php if (in_array($user_data['user_id'], ['1']) && in_array($user_data['usertype'], ['Admin'])) { ?>     
                <li class="menu-item has-child mb-2">
                  <a href="#" class="menu-link"><span class="menu-icon fab fa-squarespace"></span> <span class="menu-text">Reports Manage</span></a> 
                  <ul class="menu">
                    <li class="menu-item">
                      <a href="printRecord" class="menu-link">All Print Records</a>
                    </li>
                    <li class="menu-item">
                      <a href="listofpanfind" class="menu-link">PAN Find Reports</a>
                    </li>
                  </ul>
                </li>
                <li class="menu-item has-child mb-2">
                  <a href="#" class="menu-link"><span class="menu-icon fas fa-wallet"></span> <span class="menu-text">Wallet Manage</span></a> 
                  <ul class="menu">
                    <li class="menu-item">
                      <a href="wallettransfer" class="menu-link">Wallet Transfer</a>
                    </li>
                    <li class="menu-item">
                      <a href="walletledger" class="menu-link">Wallet Ledger</a>
                    </li>
                  </ul>
                </li>
                <li class="menu-item has-child mb-2">
                  <a href="#" class="menu-link"><span class="menu-icon fas fa-commenting"></span> <span class="menu-text">Complaint Manage</span></a> 
                  <ul class="menu">
                    <li class="menu-item">
                      <a href="opencomplaint" class="menu-link">Open Complaint</a>
                    </li>
                    <li class="menu-item">
                      <a href="listofcomplaint" class="menu-link">List of Complaint</a>
                    </li>
                  </ul>
                </li>
                
                <li class="menu-header">SYSTEM MANAGEMENT </li>
                
                <li class="menu-item has-child mb-2">
                  <a href="#" class="menu-link"><span class="menu-icon fas fa-cog"></span> <span class="menu-text">Panel Settings</span></a>
                  <ul class="menu">
                    <li class="menu-item">
                      <a href="Services_Manage" class="menu-link">Service Manage <sup style="color:red; font-weight:bold;"> All Users</sup></a>
                    </li>
                    <li class="menu-item">
                      <a href="importantlinks" class="menu-link">Important Links</a>
                    </li>
                    <li class="menu-item">
                      <a href="webdetails" class="menu-link">Web Details</a>
                    </li>
                    <li class="menu-item">
                      <a href="popupalert" class="menu-link">Popup Alert</a>
                    </li> 
                    <li class="menu-item">
                      <a href="noticealert" class="menu-link">Notice Alert</a>
                    </li>
                  </ul>
                </li>
                
                <li class="menu-item has-child mb-2">
                  <a href="#" class="menu-link"><span class="menu-icon fas fa-code-fork"></span> <span class="menu-text">Apis Settings</span></a>
                  <ul class="menu">
                    <?php if(in_array($user_data['usertype'], ['Admin'])){ ?>
                    <li class="menu-item">
                      <a href="paymentapi" class="menu-link">Portal API</a>
                    </li> 
                    <?php } ?>
                    <li class="menu-item">
                      <a href="messageapi" class="menu-link">Message API</a>
                    </li>
                  </ul>
                </li>
<?php } ?>               

                <li class="menu-item has-child mb-2">
                  <a href="#" class="menu-link"><span class="menu-icon fas fa-user"></span> <span class="menu-text">My Account</span></a>
                  <ul class="menu">
                    <li class="menu-item">
                      <a href="profile" class="menu-link">Profile</a>
                    </li>
                  </ul>
                </li>
                 <li class="menu-item mb-2">
                  <a href="pdf-service" class="menu-link"><span class="menu-icon fas fa-file-pdf" style="color:red;"></span> <span class="menu-text">Documents</span></a>
                </li>
                <li class="menu-item mb-2">
                  <a href="opencomplaint" class="menu-link"><span class="menu-icon fas fa-headset" style="color:red;"></span> <span class="menu-text"> Complaint</span></a>
                </li>
                <li class="menu-item mb-2">
                  <a href="logout" class="menu-link"><span class="menu-icon fas fa-sign-out"></span> <span class="menu-text">Logout</span></a>
                </li>
              </ul>
            </nav>
          </div>
          <footer class="aside-footer border-top p-2">
            <button class="btn btn-light btn-block text-primary" data-toggle="skin"><span class="d-compact-menu-none">Night mode</span> <i class="fas fa-moon ml-1"></i></button>
          </footer>
        </div>
      </aside>

<main class="app-main">
<div class="wrapper">
<div class="page-inner">
<header class="page-title-bar">
    <script>
  (function () {
    const CANCEL_DELAY = 5000;
    let cancelTimer = null;

    function getLoaderElements() {
      return {
        loader: document.getElementById("page-loader"),
        cancelBtn: document.getElementById("cancel-loader-btn")
      };
    }

    function scheduleCancelButton() {
      const elements = getLoaderElements();
      window.clearTimeout(cancelTimer);
      if (elements.cancelBtn) elements.cancelBtn.style.display = "none";

      cancelTimer = window.setTimeout(function () {
        const current = getLoaderElements();
        if (current.loader && current.cancelBtn && current.loader.style.display !== "none") {
          current.cancelBtn.style.display = "block";
        }
      }, CANCEL_DELAY);
    }

    window.addEventListener("load", function () {
      const elements = getLoaderElements();
      window.clearTimeout(cancelTimer);
      if (elements.loader) elements.loader.style.display = "none";
      if (elements.cancelBtn) elements.cancelBtn.style.display = "none";
    });

    document.addEventListener("DOMContentLoaded", function () {
      const elements = getLoaderElements();
      scheduleCancelButton();

      if (elements.cancelBtn) {
        elements.cancelBtn.addEventListener("click", function () {
          window.clearTimeout(cancelTimer);
          if (elements.loader) elements.loader.style.display = "none";
          elements.cancelBtn.style.display = "none";
        });
      }

      document.querySelectorAll("form").forEach(function (form) {
        form.addEventListener("submit", function () {
          if (elements.loader) {
            elements.loader.style.display = "flex";
            scheduleCancelButton();
          }
        });
      });

      const loadingText = document.getElementById("loading-text");
      if (loadingText) {
        let dotCount = 3;
        window.setInterval(function () {
          dotCount = (dotCount % 3) + 1;
          loadingText.textContent = "Processing Your ID Card" + ".".repeat(dotCount);
        }, 500);
      }
    });
  }());
</script>
</body>
</html>
