Your IP : 18.226.187.224


Current Path : /home/lentoinv/covisclubinternational.com/profile/
Upload File :
Current File : /home/lentoinv/covisclubinternational.com/profile/releasefunds.php

<?php
session_start(); ob_start();
include("lib/connect.inc.php");
if($uidx != 1){
    header("Location:../login.php");
}


if(isset($_POST['ReleaseFund'])){
    $id=$_POST['ReleaseFund'];
$db->query("UPDATE user SET wallet=0 WHERE id='$id' ");
$report = 'Locked funds have been released for '.userName($id);
}


if(isset($_POST['S2Deduct'])){

    $sql = $db->query("SELECT * FROM user WHERE level=2 AND wallet<0 LIMIT 1");
 $row = mysqli_fetch_assoc($sql); $wa = $row['wallet'];

    $amt='-'.$_POST['amt'];
$db->query("UPDATE user SET wallet='$amt' WHERE wallet = '$wa' AND level BETWEEN 2 AND 4 ");
$report = 'Locked funds have been released ';
}


if(isset($_POST['S3Deduct'])){
      $sql = $db->query("SELECT * FROM user WHERE level=5 AND wallet<0 LIMIT 1");
 $row = mysqli_fetch_assoc($sql); $wa = $row['wallet'];

    $amt='-'.$_POST['amt'];
$db->query("UPDATE user SET wallet='$amt' WHERE  wallet = '$wa' AND level = 5 ");
$report = 'Locked funds have been released ';
}

//$covis->updateAllTeamlines4();

?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Release Funds</title>
     <link rel="shortcut icon" href="img/fav.png" />
    <!-- Tell the browser to be responsive to screen width -->
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="treant/Treant.css">
    <link rel="stylesheet" href="treant/examples/tree/basic-example.css">
    <?php include('head.php'); ?>
</head>
<body class="hold-transition sidebar-mini layout-fixed">
<div class="wrapper">

    <?php include('nav.php'); ?>
     <div class="content-wrapper">
    <section class="content-header">
      <div class="container-fluid">
        <div class="row mb-2">
          <div class="col-sm-6">
            <h1>Release Funds</h1>
          </div>
          <div class="col-sm-6">
            <ol class="breadcrumb float-sm-right">
              <li class="breadcrumb-item"><a href="index.php">Home</a></li>
              <li class="breadcrumb-item active">Release Funds</li>
            </ol>
          </div>
        </div>
      </div><!-- /.container-fluid -->
    </section> 

    <!-- Content Wrapper. Contains page content -->

    <!-- Content Header (Page header) -->
    <div class="content">
        <div class="container-fluid">
  <div class="row">
   <div class="col-md-12">
                <div class="card">
                    <div class="card-header text-white bg-dark">
                                    <h5 style="float: left">Release Funds</h5>

                                </div> 


                            
                            <div class="card-body">
                      
                                    
                                    <div class="overflow-x-auto">

                                     <table class="table table-bordered table-sm"  id="example1">
                                            <thead>
                                            <tr>
                                                <th>No</th>
                                                <th>Name(s)</th>
                                                <th>Email</th>
                                                <th>Username</th>
                                                <th>Stage</th>
                                                <th>Locked</th>
                                                <th>Action</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            <?php
                                            $i=1;
                                            $m=0;
                                                $sql = $db->query("SELECT * FROM user WHERE level>5 AND wallet>0 ");
                                            

                                            while($row = $sql->fetch_assoc()) { $e = $i++; $m += $row['wallet'];

                                                ?>

                                                <tr>
                                                    <td><?php echo $e; ?></td>
                                                    <td><?php  echo $row['firstname'].' '.$row['lastname']    ?></td>
                                                    <td><?php echo $row['email'] ?></td>
                                                    <td><?php echo $row['user']; ?></td>
                                                    <td><?php echo $covis->levelToStage($row['level']); ?></td>
                                                    <td>$<?php echo number_format($row['wallet'],2); ?></td>
                                                    <td><form method="post">
                                                        <button type="submit" value="<?php echo $row['id']; ?>" name="ReleaseFund">Release Funds</button>
                                                    </form></td>
                                                </tr>

                                            <?php } ?>
                                            </tbody>
                                            <tfoot>

                                            </tfoot>
                                        </table>

                                        <h5>TOTAL LOCKED FUNDS: $<?= number_format($m,2) ?></h5>
                                      
                                    </div>
                                </div>
                            </div>


                             <div class="card">
                    <div class="card-header text-white bg-dark">
                                    <h5 style="float: left">Release Funds for Stage 2</h5>

                                </div> 


                            
                            <div class="card-body">
                      
                                    
                                    <div class="overflow-x-auto">

<?php $sql = $db->query("SELECT * FROM user WHERE level=2 AND wallet<0 LIMIT 1");
 $row = mysqli_fetch_assoc($sql); $wa = $row['wallet']; 

  $sql = $db->query("SELECT * FROM user WHERE wallet='$wa' AND level BETWEEN 2 AND 4 ");
  $wa2 = $wa*mysqli_num_rows($sql);

   ?>
 <h5>Current Locked:  $<?= abs($wa) ?></h5>
 <h5>Total Locked:  $<?= number_format(abs($wa2),2) ?></h5>
<form method="post">
 Reduce Amount to:
 <input type="text" name="amt" class="form-control" placeholder="Reduce Amount to" value="<?= abs($wa) ?>"><br>
 <button name="S2Deduct" class="btn btn-primary btn-block">Deduct Users</button>
</form>
                                    </div>
                                </div>
                            </div>




                             <div class="card">
                    <div class="card-header text-white bg-dark">
                                    <h5 style="float: left">Release Funds for Stage 3 Level 1</h5>

                                </div> 

                            
                            <div class="card-body">
                      
                                    
                                    <div class="overflow-x-auto">
<?php $sql = $db->query("SELECT * FROM user WHERE level=5 AND wallet<0 LIMIT 1");
 $row = mysqli_fetch_assoc($sql); $wa = $row['wallet']; 

  $sql = $db->query("SELECT * FROM user WHERE wallet='$wa' AND level=5 ");
  $wa2 = $wa*mysqli_num_rows($sql);

   ?>
 <h5>Current Locked:  $<?= abs($wa) ?></h5>
 <h5>Total Locked:  $<?= number_format(abs($wa2),2) ?></h5>
<form method="post">
    Reduce Amount to:
 <input type="text" name="amt" class="form-control" placeholder="Reduce Amount to" value="<?= abs($wa) ?>"><br>
 <button name="S3Deduct" class="btn btn-primary btn-block">Deduct Users</button>
</form>


                                    </div>
                                </div>
                            </div>
                            </div>
                            </div><!-- /.card-header -->
                            <!-- /.card-body -->

                        <!-- /.card -->
                     
                <!-- /.row (main row) -->
            
                    </div><!-- /.card-body -->
            </div>
            <!-- /.nav-tabs-custom -->
    </div>
    <!-- /.col -->


<!-- /.content-wrapper -->
<?php include('foot.php'); ?>

<!-- Control Sidebar -->
</div>
<!-- ./wrapper -->





<!-- jQuery -->
<script src="../plugins/jquery/jquery.min.js"></script>
<!-- jQuery UI 1.11.4 -->
<script src="../plugins/jquery-ui/jquery-ui.min.js"></script>
<!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
<script>
    $.widget.bridge('uibutton', $.ui.button)
</script>
<!-- Bootstrap 4 -->
<script src="../plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
<script src="../plugins/tempusdominus-bootstrap-4/js/tempusdominus-bootstrap-4.min.js"></script>
<!-- Summernote -->
<script src="../plugins/summernote/summernote-bs4.min.js"></script>
<!-- overlayScrollbars -->
<script src="../plugins/overlayScrollbars/js/jquery.overlayScrollbars.min.js"></script>
<!-- AdminLTE App -->
<script src="../dist/js/adminlte.js"></script>
<!-- AdminLTE dashboard demo (This is only for demo purposes) -->
<script src="../dist/js/pages/dashboard.js"></script>
<!-- AdminLTE for demo purposes -->
<script src="../dist/js/demo.js"></script>
<!-- DataTables -->

<!-- page script -->
<script type="text/javascript">
    <?php  
    if($stage ==1){ echo $covis->covisTree($uid);  } else {echo $covis->covisTree4($uid);} ?>
</script>

<script src="treant/vendor/raphael.js"></script>
<script src="treant/Treant.js"></script>


<script>
    new Treant( chart_config );
</script>
<!-- DataTables -->
<script src="../plugins/datatables/jquery.dataTables.min.js"></script>
<script src="../plugins/datatables-bs4/js/dataTables.bootstrap4.min.js"></script>
<script src="../plugins/datatables-responsive/js/dataTables.responsive.min.js"></script>
<script src="../plugins/datatables-responsive/js/responsive.bootstrap4.min.js"></script>


<!-- page script -->
<script>
    $(function () {
        $("#example1").DataTable({
            "responsive": true,
            "autoWidth": false,
        });
        $("#example3").DataTable({
            "responsive": true,
            "autoWidth": true,
            "responsive": true,
        });
        $('#example2').DataTable({
            "paging": true,
            "lengthChange": false,
            "searching": false,
            "ordering": true,
            "info": true,
            "autoWidth": false,
            "responsive": true,
        });
    });
</script>
</body>
</html>

?>