Your IP : 18.217.237.68
<?php
session_start();
include("lib/connect.inc.php");
$uid = $covis->Uid();
if($uidx != 1){
header("Location:../login.php");
}
function totalPayperhead(){
global $db,$covis;
$total=0;
$sql = $db->query("SELECT * FROM user WHERE level BETWEEN 5 AND 10 ");
while($row=mysqli_fetch_assoc($sql)){
$total += ($covis->stageTeam($row['id'],3)-1)*12.5;
}
$sql = $db->query("SELECT * FROM user WHERE level BETWEEN 8 AND 10 ");
while($row=mysqli_fetch_assoc($sql)){
$total += ($covis->stageTeam($row['id'],4)-1)*150;
}
return $total;
}
//$pph = totalPayperhead();
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!-- Neptune CSS -->
<title>Manage Stages</title>
<link rel="shortcut icon" href="img/fav.png" />
<!-- Neptune CSS -->
<!-- Tell the browser to be responsive to screen width -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Vendor CSS -->
<!-- Font Awesome -->
<?php include('head.php'); ?>
</head>
<body class="hold-transition sidebar-mini layout-fixed">
<div class="wrapper">
<?php include('nav.php'); ?>
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<section class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1>Manage stage</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">Manage Stage</li>
</ol>
</div>
</div>
</div><!-- /.container-fluid -->
</section>
<!-- 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>View User Levels</h5>
</div>
<div class="content-area py-1">
<div class="container-fluid">
<div class="row">
<div class="col-md-12 col-lg-12">
<!-- <div class="box bg-white "> -->
<br/>
<div class="table-responsive">
<table class="table table-striped table-bordered dataTable" id="example1x">
<thead>
<tr>
<th colspan="5">TOTAL ENTRIES</th>
<?php $sql1 = $db->query("SELECT * FROM user");
$num = $sql1->num_rows; ?>
<th><?php echo $num ?></th>
</tr>
<tr>
<th>S/N</th>
<th>Stage</th>
<th>Level</th>
<th>Level Strength</th>
<th>Level Payout</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
$st=0; $totalpay=0;
$allpay=0; $sql = $db->query("SELECT * FROM levels"); $i = 1;
while($row = $sql->fetch_assoc()){ $e = $i++;
$bg = (isset($_POST['UserLevel']) AND $_POST['UserLevel']==$row['lev']) ?' bgcolor="#CF0"' : '';
$pay = $covis->getLevelePayoutx($e-1);
$totalpay += $pay;
?>
<tr <?php echo $bg; ?> >
<td><?php echo $e; ?></td>
<td><?php echo $row['title'] ?></td>
<td><?php echo ' Level '. $row['level'] ?></td>
<td> <?php echo number_format($covis->countLevelUsers($row['lev'])); ?></td>
<td>$<?php echo number_format($pay,2) ?></td>
<td>
<form method="post">
<button type="submit" name="UserLevel" class="btn-sm btn-primary" value="<?php echo $row['lev'] ?>">View</button>
<button class="btn btn-sm btn-primary" name="RecalculateLevelx" value="<?php echo ($e-1) ?>">Recalculate Level </button>
</form>
</td>
</tr>
<?php } ?>
</tbody>
</table>
STATISTICS
<?php $totalpay = colSum('user','payout');//$totalpay*1.06;
$sbq=$db->query("SELECT SUM(amount) AS total FROM walletdist WHERE amount>0 ");
$rq = mysqli_fetch_assoc($sbq);
$sb = $rq['total'];
//colSum('walletdist','amount');
$allpay = $num+$totalpay+$sb; $allincome=$num*5; ?>
<table class="table">
<tr><td>Referral Bonus</td><td>$<?php echo number_format($num,2) ?></td><td><?php echo number_format(100*$num/$allincome,2) ?>%</td></tr>
<tr><td>Level Payouts</td><td>$<?php echo number_format($totalpay,2) ?></td><td><?php echo number_format(100*$totalpay/$allincome,2) ?>%</td></tr>
<tr><td>Structure Bonus</td><td>$<?php echo number_format($sb,2) ?></td><td><?php echo number_format(100*$sb/$allincome,2) ?>%</td></tr>
<tr><td>Total Payout</td><td>$<?php echo number_format($allpay,2) ?></td><td><?php echo number_format(100*$allpay/$allincome,2) ?>%</td></tr>
</table>
<!--<form method="post">-->
<!-- <div style="float: right"> <button type="submit" name="AssignSn" class="btn btn-primary" >ASSIGN SERIAL NUMBERS</button></div>-->
<!--</form>-->
</div>
</div>
</div>
</div>
</div>
</div>
<?php if(isset($_POST['UserLevel'])){ $sn = $_POST['UserLevel'];
?>
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-header text-white bg-dark">
<h5>View Level Users </h5>
</div>
<div class="content-area py-1">
<div class="container-fluid">
<div class="box bg-white ">
<div class="box-block">
<div class="table-responsive">
<table class="table table-bordered" id="example1">
<thead>
<tr>
<th>S/N</th>
<th>Name</th>
<th>Username</th>
<th>Email</th>
<th>Stage Team</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php $level = $db->query("SELECT * FROM user WHERE level = '$sn' "); $i = 0;
while($rowl = $level->fetch_assoc()){ $i = $i + 1;
?>
<tr>
<td><?php echo $i ?></td>
<td><?php echo userName($rowl['id']) ?></td>
<td><?php echo $rowl['user'] ?></td>
<td><?php echo $rowl['email'] ?></td>
<td><?php echo $covis->levelDownlines($rowl['sn']); ?>, <?php $stage=$covis->stageCalc($rowl['sn']); echo $covis->stageTeam($rowl['id'],$stage); ?></td>
<td>
<form method="post">
<button type="submit" value="<?php echo $row['id']; ?>" name="FindUser">Profile</button>
</form>
</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php } ?>
</div>
<!-- /.card-body -->
<!-- /.card -->
</div>
</div>
<!-- right col -->
</div>
<!-- /.row (main row) -->
</div><!-- /.container-fluid -->
<!-- /.content -->
</div>
<!-- /.content-wrapper -->
<?php include('foot.php'); ?>
<!-- Control Sidebar -->
<aside class="control-sidebar control-sidebar-dark">
<!-- Control sidebar content goes here -->
</aside>
<!-- /.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>
<!-- ChartJS -->
<script src="../plugins/chart.js/Chart.min.js"></script>
<!-- Sparkline -->
<script src="../plugins/sparklines/sparkline.js"></script>
<!-- JQVMap -->
<script src="../plugins/jqvmap/jquery.vmap.min.js"></script>
<script src="../plugins/jqvmap/maps/jquery.vmap.usa.js"></script>
<!-- jQuery Knob Chart -->
<script src="../plugins/jquery-knob/jquery.knob.min.js"></script>
<!-- daterangepicker -->
<script src="../plugins/moment/moment.min.js"></script>
<script src="../plugins/daterangepicker/daterangepicker.js"></script>
<!-- Tempusdominus Bootstrap 4 -->
<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 -->
<script type="text/javascript" src="../vendor/chartist/chartist.min.js"></script>
<!-- Vendor JS -->
<script type="text/javascript" src="../vendor/jquery/jquery-1.12.3.min.js"></script>
<script type="text/javascript" src="../vendor/tether/js/tether.min.js"></script>
<script type="text/javascript" src="../vendor/bootstrap4/js/bootstrap.min.js"></script>
<script type="text/javascript" src="../vendor/detectmobilebrowser/detectmobilebrowser.js"></script>
<script type="text/javascript" src="../vendor/jscrollpane/jquery.mousewheel.js"></script>
<script type="text/javascript" src="../vendor/jscrollpane/mwheelIntent.js"></script>
<script type="text/javascript" src="../vendor/jscrollpane/jquery.jscrollpane.min.js"></script>
<script type="text/javascript" src="../vendor/jquery-fullscreen-plugin/jquery.fullscreen-min.js"></script>
<script type="text/javascript" src="../vendor/waves/waves.min.js"></script>
<script type="text/javascript" src="../vendor/switchery/dist/switchery.min.js"></script>
<script type="text/javascript" src="../vendor/flot/jquery.flot.min.js"></script>
<script type="text/javascript" src="../vendor/flot/jquery.flot.resize.min.js"></script>
<script type="text/javascript" src="../vendor/flot.tooltip/js/jquery.flot.tooltip.min.js"></script>
<script type="text/javascript" src="../vendor/CurvedLines/curvedLines.js"></script>
<script type="text/javascript" src="../vendor/TinyColor/tinycolor.js"></script>
<script type="text/javascript" src="../vendor/sparkline/jquery.sparkline.min.js"></script>
<script type="text/javascript" src="../vendor/raphael/raphael.min.js"></script>
<script type="text/javascript" src="../vendor/morris/morris.min.js"></script>
<script type="text/javascript" src="../vendor/jvectormap/jquery-jvectormap-2.0.3.min.js"></script>
<script type="text/javascript" src="../vendor/jvectormap/jquery-jvectormap-world-mill.js"></script>
<script type="text/javascript" src="../vendor/peity/jquery.peity.js"></script>
<script type="text/javascript" src="../vendor/chartist/chartist.min.js"></script>
<!-- page 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>