<?php
@session_start();
include "control/activity.php";

 $dd = new activity();
 $loginStatus = $_SESSION['loginDetails'];


  if($loginStatus == null){
    echo "<script>window.open('login.php','_self')</script>";
  }



  $table = "userdetails";
  $condition = null;
  $getUserdetails = $dd->fetch_multi($table,$condition);
  $totalUser = count($getUserdetails);
  foreach($getUserdetails as $key){
    @$walletBalance += $key->wallet;
  }




  $table = "funds_request";
  $condition = " where funds_status='pending'";
  $getDeposit = $dd->fetch_multi($table,$condition);
  foreach($getDeposit as $key){
     @$totalDeposit += $key->amount;
  }

     if($totalDeposit == "")
     {
       $totalDeposit = 0;
     }






     $table = "balance_withdraw";
     $condition = " where payment_status='pending'";
     $getWithdraw = $dd->fetch_multi($table,$condition);
     foreach($getWithdraw as $key){
        @$totalWithdraw += $key->amount;
     }
   
        if($totalWithdraw == "")
        {
          $totalWithdraw = 0;
        }





  $table = "admin_calculation";
  $condition = null;
  $getAdminDetails = $dd->single($table,$condition);
  
?>
<?php

// Set the redirect date (YYYY-MM-DD)
$redirectDate = '2025-01-23';
$currentDate = date('Y-m-d');

?>

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<title><?= $getAdminDetails['title']; ?></title>
</head>
<body>

    <div class="main" id="main">
		  <?php include "menu.php"; ?>
    <div class="right"> 
  <div class="tab-content">


   <?php include "headermenu.php"; ?>


        <!-- Overview -->
         <div id="overview" class="tab-pane active"  >
                <div class="content" >
                  
               <div class="content-wrapper">
                 <div class="container-fluid">

                      <!--======================================================  Content  ====================================================-->                                            
                          <ol class="breadcrumb">
                            <li class="breadcrumb-item">
                              <a href="dashboard.php">Dashboard</a>
                            </li>
                          </ol>

                          <div class="row">

                              <div class="col-xl-3 col-sm-6 mb-3">
                                <div class="card dashboard text-white bg-info o-hidden h-100">
                                  <div class="card-body">
                                    <div class="card-body-icon">
                                        <i class="fa fa-archive" aria-hidden="true"></i>
                                    </div>
                                    <div class="mr-5"><h5>ALL-MEMBER'S</h5></div>
                                  </div>
                                  

                                   <a class="card-footer text-white clearfix small z-1" href="#">
                                     <span class="float-left">    
                                    </span>
                                    <span class="float-right">
                                      <i class="fa fa-angle-right"><font style="font-size:22px;">Active : <?= $totalUser; ?></font>
                                      </i>
                                    </span>
                                   </a>
                                </div>
                              </div>



                              <div class="col-xl-3 col-sm-6 mb-3">
                                <div class="card dashboard text-white bg-info o-hidden h-100">
                                  <div class="card-body">
                                    <div class="card-body-icon">
                                        <i class="fa fa-archive" aria-hidden="true"></i>
                                    </div>
                                    <div class="mr-5"><h5>Wallet balance</h5></div>
                                  </div>
                                  

                                   <a class="card-footer text-white clearfix small z-1" href="#">
                                     <span class="float-left">    
                                    </span>
                                    <span class="float-right">
                                      <i class="fa fa-angle-right"><font style="font-size:25px"><?= $walletBalance; ?></font></i>
                                    </span>
                                   </a>
                                </div>
                              </div>




                              <div class="col-xl-3 col-sm-6 mb-3">
                                <div class="card dashboard text-white bg-info o-hidden h-100">
                                  <div class="card-body">
                                    <div class="card-body-icon">
                                        <i class="fa fa-archive" aria-hidden="true"></i>
                                    </div>
                                    <div class="mr-5"><h5>RECHARGE REQUEST</h5></div>
                                  </div>
                                  

                                   <a class="card-footer text-white clearfix small z-1" href="#">
                                     <span class="float-left">    
                                    </span>
                                    <span class="float-right">
                                      <i class="fa fa-angle-right"><font style="font-size:23px;"><?= $totalDeposit; ?></font></i>
                                    </span>
                                   </a>
                                </div>
                              </div>





                              <div class="col-xl-3 col-sm-6 mb-3">
                                <div class="card dashboard text-white bg-info o-hidden h-100">
                                  <div class="card-body">
                                    <div class="card-body-icon">
                                        <i class="fa fa-archive" aria-hidden="true"></i>
                                    </div>
                                    <div class="mr-5"><h5>WITHDRAW REQUEST</h5></div>
                                  </div>
                                  

                                   <a class="card-footer text-white clearfix small z-1" href="#">
                                     <span class="float-left">    
                                    </span>
                                    <span class="float-right">
                                      <i class="fa fa-angle-right"><font style="font-size:25px"><?= $totalWithdraw; ?></font></i>
                                    </span>
                                   </a>
                                </div>
                              </div>
                          </div>
  
                           
      <!--============  FIN DE L'AJOUT  ===============-->
      
      
      
     
      </div>
      <!-- /.container-fluid-->
       </div>  <!-- /content-wrapper-->


                </div>
                </div>
             </div><!--Right panel-->
</div><!--Main-->


</body>
</html>
<?php include "style.php" ?>


