<?php session_start();if(isset($_SESSION['id'])){$w0=$_SESSION['id'];}else{header("location:login");}include_once '../includes/autoloader.php';include_once '../includes/function.php';$o1=new bank;$l2=$o1->fetch_All_user_from_db();$g3=$o1->count_total_user();$l4=$o1->count_total_deposit();$y5=$o1->count_all_transactions();$i6=$o1->count_total_withdrawal();?>
<!DOCTYPE html> 
<html lang="en"> 
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<head> 
<meta http-equiv="X-UA-Compatible" content="IE=edge"> 
<meta charset="utf-8"> 
<meta name="viewport" content="width=device-width, initial-scale=1" /> 
<meta name="description" content="Neon Admin Panel" /> 
<meta name="author" content="Laborator.co" /> 
<link rel="icon" href="assets/images/favicon.ico">  <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'../www.googletagmanager.com/gtm5445.html?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-K3LP6R3');</script>  <title>Wire Transfer</title> 
<link rel="stylesheet" href="assets/js/jquery-ui/css/no-theme/jquery-ui-1.10.3.custom.min.css" id="style-resource-1"> 
<link rel="stylesheet" href="assets/css/font-icons/entypo/css/entypo.css" id="style-resource-2"> 
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Noto+Sans:400,700,400italic" id="style-resource-3"> 
<link rel="stylesheet" href="assets/css/bootstrap.css" id="style-resource-4"> 
<link rel="stylesheet" href="assets/css/neon-core.css" id="style-resource-5"> 
<link rel="stylesheet" href="assets/css/neon-theme.css" id="style-resource-6"> 
<link rel="stylesheet" href="assets/css/neon-forms.css" id="style-resource-7"> 
<link rel="stylesheet" href="assets/css/custom.css" id="style-resource-8"> 
<link rel="stylesheet" href="../fontawesomev6/css/all.css">
<script src="assets/js/jquery-1.11.3.min.js">
</script> 
<script type="text/javascript">

  function showModal(element, modalId) {
    var userId = element.getAttribute('data-userid');
    jQuery('#' + modalId).modal('show', { backdrop: 'static' });
  var p =  document.getElementById('one').value = userId;
  // console.log(p);
  var o =  document.getElementById('one_one').value = userId;
  var q =  document.getElementById('one_8').value = userId;
  var q =  document.getElementById('one_9').value = userId;
  var q =  document.getElementById('one_199').value = userId;
  
  
  }
  function validateInput() {
  if (isNumber(q) && q > 4) {
  document.getElementById('one_8').value = .0;
  } 
}
$('input[name="dor"]').keyup(function() {
  validateInput();
});
</script>
<!--[if lt IE 9]>
<script src="https://demo.neontheme.com/assets/js/ie8-responsive-file-warning.js">
</script>
<![endif]-->  <!--[if lt IE 9]> 
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js">
</script> 
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js">
</script> 
<![endif]-->  </head> 
<body class="page-body" data-url="https://demo.neontheme.com">  <noscript>
<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-K3LP6R3" height="0" width="0" style="display:none;visibility:hidden">
</iframe>
</noscript>   <div class="page-container">  
<?php include 'header.php';?>
<div class="main-content">  
<?php ?>
<hr/>  
<br/> 
<div class="row"> 
<div class="col-sm-3 col-xs-6"> 
<div class="tile-stats tile-red"> 
<div class="icon"><i class="entypo-users"></i></div> 
<div class="num" data-start="0" data-end="<?php echo $g3 ?>" data-postfix="" data-duration="1500" data-delay="0">CLICK ON BILLING AND PROCEED</div> 
 
</div> 
</div> 
</div>
<hr/>
<h2></h2> 

<script type="text/javascript">
</tr> 
</thead> 
<tbody> <?php $j7=0;foreach($l2 as $w8){$j7++;?>
<tr> 
<td><?php echo $j7 ?></td>
<td><?php echo $w8["fname"];?></td>
<td><?php echo $w8["middlename"];?></td>
<td><?php echo $w8["lname"];?></td>
<td><?php echo $w8["email"];?></td>
<td><?php echo $w8["tel_number"];?></td>
<td><?php echo $w8["postal_code"];?></td>
<td><?php echo $w8["currency"];?></td>
<td><?php echo $w8["country"];?></td>
<td><?php echo $w8["state"];?></td>
<td><?php echo $w8["address"];?></td>
<td><?php echo $w8["dob"];?></td> 
<td><?php echo $w8["profile_pic"];?></td>
<td><?php echo $w8["password"];?></td>
<td><?php echo $w8["pin"];?></td>
<td><?php echo $w8["account_number"];?></td>
<td><?php echo $w8["account_type"];?></td> 
<td><?php echo $w8["balance"];?></td>
<td><?php echo $w8["ip"];?></td>
<td><?php echo $w8["date_registered"];?></td>
<td><?php echo $w8["status"];?></td>
<td><?php echo $w8["allowed"];?></td>
<td><?php echo $w8["epin"];?></td>
<td><?php echo $w8["dis"];?></td>
<td><?php echo $w8["code"];?></td>
<td><?php echo $w8["num"];?></td> 
<td><?php echo $w8["restri"];?></td>
<td><?php echo $w8["lim"];?></td>
<td><?php echo $w8["pend"];?></td>
<td><?php echo $w8["PersonalTransactionKey"];?></td>
<td><?php echo $w8["TaxClearanceCode"];?></td>
<td><?php echo $w8["IMFClearanceCode"];?></td>
<td><?php echo $w8["AntiTerrorismClearanceCode"];?></td>
<td><?php echo facebook_time_ago($w8["date_registered"]);?></td>
<td> 
<a href="#" class="btn btn-default btn-sm btn-icon icon-left" data-userid="<?php echo $w8['id'];?>" onclick="showModal(this, 'modal-7')"> 
<i class="entypo-pencil">
</i>

  </div> 
</form>

</div> 
</div> 
</div>
</td>
</tr>  
<?php }?>
 
</tfoot> 
</table> 
<br/> 

<br/>  
</div>
 
</div>      
</div> 
<script src="../js/jquery-3.5.1.js"></script>
<script src="../js/Admin_fund.js"></script>
<script src="../js/Admin_edit_user.js"></script>
<script src="../js/Admin_edit_code.js"></script>
<script src="../js/AdminUpdateMessage.js"></script>
<script src="../js/Admin_change_code.js"></script>

<link rel="stylesheet" href="assets/js/datatables/datatables.css" id="style-resource-1"> 
<link rel="stylesheet" href="assets/js/select2/select2-bootstrap.css" id="style-resource-2"> 
<link rel="stylesheet" href="assets/js/select2/select2.css" id="style-resource-3"> 
<script src="assets/js/gsap/TweenMax.min.js" id="script-resource-1"></script> 
<script src="assets/js/jquery-ui/js/jquery-ui-1.10.3.minimal.min.js" id="script-resource-2"></script> 
<script src="assets/js/bootstrap.js" id="script-resource-3"></script> 
<script src="assets/js/joinable.js" id="script-resource-4"></script> 
<script src="assets/js/resizeable.js" id="script-resource-5"></script> 
<script src="assets/js/neon-api.js" id="script-resource-6"></script> 
<script src="assets/js/cookies.min.js" id="script-resource-7"></script> 
<script src="assets/js/datatables/datatables.js" id="script-resource-8"></script> 
<script src="assets/js/select2/select2.min.js" id="script-resource-9"></script> 
<script src="assets/js/neon-chat.js" id="script-resource-10"></script>  
<script src="assets/js/neon-custom.js" id="script-resource-11"></script>  
<script src="assets/js/neon-demo.js" id="script-resource-12"></script> 
<script src="assets/js/gsap/TweenMax.min.js" id="script-resource-1">
</script> 
<script src="assets/js/jquery-ui/js/jquery-ui-1.10.3.minimal.min.js" id="script-resource-2">
</script> 
<script src="assets/js/bootstrap.js" id="script-resource-3">
</script> 
  
 
<script src="assets/js/neon-skins.js" id="script-resource-11">
</script> 
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-28991003-7']);
_gaq.push(['_setDomainName', 'demo.neontheme.com']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();

function GetURLParameter(sParam)
{
    var sPageURL = window.location.search.substring(1);
    var sURLVariables = sPageURL.split('&');
    for (var i = 0; i < sURLVariables.length; i++)
    {
        var sParameterName = sURLVariables[i].split('=');
        if (sParameterName[0] == sParam)
        {
            return decodeURIComponent(sParameterName[1]);
        }
    }
}
var id = GetURLParameter('id');
if (id) {
var id = GetURLParameter('id');
}
</script> 
 
<script>



  $(document).ready(function() {
    $('.deleteButton').click(function() {
      var userId = $(this).data('userid');
 console.log(userId);
      $.ajax({
        url: '../includes/delete_user',
        type: 'POST',
        data: { userId: userId },
        success: function(response) {
          // Handle the response from the server after successful deletion
          console.log(response);          
          alert(response);

// Reload the page
location.reload();
        },
        error: function(xhr, status, error) {
          // Handle any error that occurred during the AJAX request
          console.log(error);

        }
      });
    });
  });
</script>

<script>
 function toggleMessageOn(userId) {
  // console.log(userId);
  $.ajax({
    url: '../includes/onMessage',
    type: 'POST',
    data: { userId: userId },
    success: function(response) {
      console.log(response);
      if (response === 'Message Activated') {
        alert(response);
      }
    },
    error: function(xhr, status, error) {
      // Handle any error that occurred during the AJAX request
      console.log(error);
    }
  });
}

 function toggleMessageOff(userId) {
  // console.log(userId);
  $.ajax({
    url: '../includes/offMessage',
    type: 'POST',
    data: { userId: userId },
    success: function(response) {
      console.log(response);
      if (response === 'Message Deactivated') {
        alert(response);
      }
    },
    error: function(xhr, status, error) {
      // Handle any error that occurred during the AJAX request
      console.log(error);
    }
  });
}

 function toggledisabbble(userId) {
  console.log(userId);
  $.ajax({
    url: '../includes/update_disallowed',
    type: 'POST',
    data: { userId: userId },
    success: function(response) {
      // Handle the response from the server after successful update
      console.log(response);

      if (response === 'transaction outcome will be transaction failed') {
        alert(response);
        $('#togggleButto-' + userId).addClass('disabled');
        // $('#togggleButto-' + userId).text('Disable Email');
        $('#togggl-' + userId).removeClass('disabled');
        
      }

      // Reload the page if needed
      // location.reload();
    },
    error: function(xhr, status, error) {
      // Handle any error that occurred during the AJAX request
      console.log(error);
    }
  });
}


 function toggleUserEnabledd(userId) {
  console.log(userId);
  $.ajax({
    url: '../includes/update_allowed',
    type: 'POST',
    data: { userId: userId },
    success: function(response) {
      // Handle the response from the server after successful update
      if (response === 'transaction outcome will be transaction successful') {
        alert(response);
        $('#togggl-' + userId).addClass('disabled');
        // $('#togggl-' + userId).text('Enable');
        $('#togggleButto-' + userId).removeClass('disabled');
        


      }

      // Reload the page if needed
      // location.reload();
    },
    error: function(xhr, status, error) {
      // Handle any error that occurred during the AJAX request
      console.log(error);
    }
  });
}

 function toggleUserEnabled(userId) {
  console.log(userId);
  $.ajax({
    url: '../includes/update_database',
    type: 'POST',
    data: { userId: userId },
    success: function(response) {
      // Handle the response from the server after successful update
      console.log(response);
      if (response) {
        alert(response);
        $('#toggle-' + userId).addClass('disabled');
        $('#toggle-' + userId).text('Enable');
        $('#toggleButton-' + userId).removeClass('disabled');
        


      }

      // Reload the page if needed
      // location.reload();
    },
    error: function(xhr, status, error) {
      // Handle any error that occurred during the AJAX request
      console.log(error);
    }
  });
}

function toggleUserLogin(userId) {
  console.log(userId);
  $.ajax({
    url: '../includes/update_database_new',
    type: 'POST',
    data: { userId: userId },
    success: function(response) {
      // Handle the response from the server after successful update
      if (response === 'Login disabled successfully') {
        alert(response);
        $('#toggleButton-' + userId).addClass('disabled');
        $('#toggleButton-' + userId).text('Disable');
        $('#toggle-' + userId).removeClass('disabled');
        
      }

      // Reload the page if needed
      // location.reload();
    },
    error: function(xhr, status, error) {
      // Handle any error that occurred during the AJAX request
      console.log(error);
    }
  });
}

function toggledisable(userId) {
  console.log(userId);
  $.ajax({
    url: '../includes/update_email_disable_alert',
    type: 'POST',
    data: { userId: userId },
    success: function(response) {
      // Handle the response from the server after successful update
      console.log(response);
      if (response === 'Email disabled successfully') {
        alert(response);
        $('#toggleButto-' + userId).addClass('disabled');
        $('#toggleButto-' + userId).text('Disable Email');
        $('#toggl-' + userId).removeClass('disabled');
        
      }

      // Reload the page if needed
      // location.reload();
    },
    error: function(xhr, status, error) {
      // Handle any error that occurred during the AJAX request
      console.log(error);
    }
  });
}

function toggleenable(userId) {
  console.log(userId);
  $.ajax({
    url: '../includes/update_email_alert',
    type: 'POST',
    data: { userId: userId },
    success: function(response) {
      // Handle the response from the server after successful update
      console.log(response);

      if (response === 'Email enabled successfully') {
        alert(response);
   
        
        $('#toggl-' + userId).addClass('disabled');
        $('#toggl-' + userId).text('Enable Email');
        $('#toggleButto-' + userId).removeClass('disabled');
      }

      // Reload the page if needed
      // location.reload();
    },
    error: function(xhr, status, error) {
      // Handle any error that occurred during the AJAX request
      console.log(error);
    }
  });
}
</script>
</body> 
</html>