Your IP : 18.217.14.208
<?php
session_start(); ob_start();
include("lib/connect.inc.php");
?>
<?php $covis->levelCreate($uidx); ?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Dashboard</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 -->
<?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">
<!-- Content Header (Page header) -->
<div class="content-header">
<div class="container-fluid">
<?php
function add72Hours($created){
$added = strtotime($created)+259200;
return date('Y-m-d H:i:s',$added);
}
function promoCount($uid,$sn){
global $db;
$created = userName($uid,'created');
$end = add72Hours($created);
$sql = $db->query("SELECT * FROM user WHERE sponsor='$sn' AND created BETWEEN '$created' AND '$end' ");
return mysqli_num_rows($sql);
}
function promoAward($ref){
if($ref>=1092){$bonus = 'A BRANDED T-SHIRT + $35 SHOPPING VOUCHERS + SMART PHONE + LAPTOP';}
elseif($ref>=363){$bonus = 'A BRANDED T-SHIRT + $35 SHOPPING VOUCHERS + SMART PHONE';}
elseif($ref>=120){$bonus = 'A BRANDED T-SHIRT + $35 SHOPPING VOUCHERS';}
elseif($ref>=39){$bonus = 'A BRANDED T-SHIRT + $10 SHOPPING VOUCHER';}
elseif($ref>=12){$bonus = 'A BRANDED T-SHIRT';}
return $bonus;
}
function promoItem($ref){
if($ref>=1092){$bonus = 5;}
elseif($ref>=363){$bonus = 4;}
elseif($ref>=120){$bonus = 3;}
elseif($ref>=39){$bonus = 2;}
elseif($ref>=12){$bonus = 1;}
return $bonus;
}
?>
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-header text-white bg-dark">
<h5> Fast Start Promo Qualifiers</h5>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table table-striped table-bordered dataTable" id="example1">
<thead>
<tr>
<th>No</th>
<th>Name(s)</th>
<th>Username</th>
<!--<th>Referral</th> -->
<th>Award</th>
<th>Period</th>
<th>Status</th>
</tr>
</thead>
<tbody>
<?php
$i=1; $mm='202105';//date('Ym');
$sql = $db->query("SELECT * FROM user WHERE sp>11 AND mm BETWEEN '202106' AND '202107' ORDER BY sp DESC "); $e = 0;
while($row = $sql->fetch_assoc()) { $e = $i++; $newcount = promoCount($row['id'],$row['sn']);
if($newcount>11){
$lap1 = time() - strtotime($row['created']);
$ct = sqL2('incentive','id',$row['id'],'promo',1);
$val=$row['id'].'-'.promoItem($newcount);
$tl = 72-ceil($lap1/3600); $ttl = $tl>0 ? $tl.' hours left' : '<button value="'.$val.'" name="PromoIncent" type="submit" class="btn btn-primary">Request Incentive</button>';
$ttl = $uid==$row['id'] ? $ttl : '';
$ttl = $ct>0 ? '<span class="text-success">Incentive Claimed</span>' : $ttl;
?>
<tr>
<td><?php echo $e; ?></td>
<td><?php echo $row['firstname'].' '.$row['lastname'] ?></td>
<td><?php echo $row['user']; ?></td>
<!--<td><?php echo $newcount; ?></td>-->
<td><?php echo promoAward($newcount); ?></td>
<td><?php echo date('d/m/y',strtotime($row['created'])).'-'.date('d/m/y',strtotime(add72Hours($row['created']))); ?></td>
<td><form method="post"><?php echo $ttl ; ?> </form></td>
</tr>
<?php } } ?>
</tbody>
<tfoot>
</tfoot>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- 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 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,
});
$('#example2').DataTable({
"paging": true,
"lengthChange": false,
"searching": false,
"ordering": true,
"info": true,
"autoWidth": false,
"responsive": true,
});
});
</script>
</body>
</html>