Your IP : 13.59.83.202
<?php
session_start();
include("lib/connect.inc.php");
$uid = $covis->Uid();
if($uidx != 1){
header("Location:../login.php");
}
updatePoint();
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>CCI CIRCLER</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">
<section class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1>CCI CIRCLER</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">CCI Circler</li>
</ol>
</div>
</div>
</div><!-- /.container-fluid -->
</section>
<!-- Content Header (Page header) -->
<?php if(isset($report)){$covis->Alert(); } ?>
<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">Cycler Operations</h5>
</div>
<div class="card-body">
<div class="table-responsive">
<?php $Ym = date('Ym'); $sql = $db->query("SELECT SUM(amount) AS sum FROM cpay WHERE amount>0 ");
$row = mysqli_fetch_assoc($sql); $s = $row['sum'];
$sq = $db->query("SELECT * FROM cuser WHERE no>0 ");
$out = mysqli_num_rows($sq);
$s = $db->query("SELECT * FROM cuser WHERE no>2 ");
$sc = mysqli_num_rows($s);
?>
<table class="table table-bordered mb-2" width="100%">
<tr>
<td>Total Users:<br> <b><?= sqL('logc') ?></b></td>
<td>In Circles:<br> <b><?= sqL('cuser') ?></b></td>
<td>Circled Out:<br> <b><?= $out ?></b></td>
<td>Service Charge:<br> <b>$<?= number_format(abs(colSum1('cpay','amount','type',6)),2) ?></b></td>
<td>Income:<br> <b>$<?php $in = abs(colSum1('cpay','amount','type',5)); echo number_format($in,2) ?></b></td>
<td>Total Paid:<br> <b>$<?php $t=colSum1('cpay','amount','type',2)+colSum1('cpay','amount','type',3); echo number_format($t,2); ?></b></td>
<td>Payout:<br> <b><?php $p=$t/$in; echo number_format($p*100,2); ?>%</b></td>
</tr>
</table>
</div>
<div class="table-responsive">
<table class="table table-bordered mb-2" width="100%">
<tr>
<?php function boardTeam($b){
global $db;
$sql = $db->query("SELECT DISTINCT id FROM cuser WHERE type='$b' ");
return mysqli_num_rows($sql);
}
$i=1; while($i<10){$e=$i++;
$x=$e+1; $bu = sqL1('cuser','type',$e); ?>
<td><a href="?board=<?= $e ?>">Board <?= $e ?><br> <b><?= boardTeam($e) ?> | <?= $bu ?> | <?= $bu-boardTeam($e) ?></b></a></td>
<?php } ?>
</tr>
</table>
</div>
<h3>Reward Setup</h3><hr>
<form class="mt-3 float-right" method="post">
<table>
<tr><td>First Winner<input type="text" value="<?= sqLx('setup','sn',1,'a1') ?>" class="form-control" name="a1" ></td><td>Second Winner<input type="text" class="form-control" name="a2" value="<?= sqLx('setup','sn',1,'a2') ?>"></td><td>Third Winner<input type="text" class="form-control" name="a3" value="<?= sqLx('setup','sn',1,'a3') ?>"></td><td>Runner-Up<input type="text" class="form-control" name="a4" value="<?= sqLx('setup','sn',1,'a4') ?>"></td><td>Target Points<input type="text" value="<?= sqLx('setup','sn',1,'a5') ?>" class="form-control" name="a5" ></td><td><br><button type="submit" name="UpdateTarget2" class="btn btn-primary">Update</button></td></tr>
</table>
</form>
</div>
</div>
<div class="card">
<div class="card-header text-white bg-dark">
<h5 style="float: left">Monthly Top Referrers for <?= date('F Y') ?> </h5>
</div>
<div class="card-body">
<div class="overflow-x-auto">
<table class="table table-striped table-bordered dataTable" id="example">
<thead>
<tr>
<th>SN</th>
<th>Name</th>
<th>Username</th>
<th>Point</th>
<th>Next Mile Stone</th>
<th>Eligible</th>
</tr>
</thead>
<tbody>
<?php
$i=1; $mm = date('ym');
$sql = $db->query("SELECT * FROM logc ORDER BY refpoint DESC LIMIT 10");
while($row = mysqli_fetch_assoc($sql)) { $e = $i++; $id=$row['id'];
$peg = sqLx('setup','sn',1,'a5');
$el = ($e<4 AND eligibleWin($row['refpoint'],$peg)==1) ? 'YES' : 'N0';
?>
<tr>
<td><?php echo $e; ?></td>
<td><?php echo userName($id); ?></td>
<td><?php echo userName($id,'user'); ?></td>
<td><?php echo $row['refpoint']; ?></td>
<td><?php echo nextMile($row['refpoint']); ?></td>
<td><?php echo $el; ?></td>
</tr>
<?php } ?>
</tbody>
<tfoot>
</tfoot>
</table>
Target: <?= sqLx('setup','sn',1,'a5') ?> Point. The top 3 that exceed the target will be rewarded<br>
First Position: $<?= sqLx('setup','sn',1,'a1') ?> <br>
Second Position: $<?= sqLx('setup','sn',1,'a2') ?> <br>
Third Position: $<?= sqLx('setup','sn',1,'a3') ?> <br>
Seven Runner-up: $<?= sqLx('setup','sn',1,'a4') ?>
</div>
</div>
</div>
<div class="card">
<div class="card-header text-white bg-dark">
<h5 style="float: left">List of Recent Circlers: <?= $_GET['board']??'' ?></h5>
</div>
<div class="card-body">
<div class="overflow-x-auto">
<table class="table table-striped table-bordered dataTable" id="example1">
<thead>
<tr>
<th>SN</th>
<th>Name</th>
<th>Username</th>
<th>Type</th>
<th>No of Circles</th>
<th>Balance</th>
</tr>
</thead>
<tbody>
<?php
$i=1; $mm = date('ym'); $b = $_GET['board']??0;
$sql = isset($_GET['board']) ? $db->query("SELECT * FROM cuser WHERE type='$b' ORDER BY sn DESC LIMIT 100") : $db->query("SELECT * FROM cuser ORDER BY sn DESC LIMIT 100");
while($row = mysqli_fetch_assoc($sql)) { $e = $i++; $id=$row['id'];
?>
<tr>
<td><?php echo $e; ?></td>
<td><?php echo userName($id); ?></td>
<td><?php echo userName($id,'user'); ?></td>
<td><?php echo $row['type'] ?></td>
<td><?php echo $row['no']; ?></td>
<td>$<?php echo number_format(colSum1('cpay','amount','id',$id),2); ?></td>
</tr>
<?php } ?>
</tbody>
<tfoot>
</tfoot>
</table>
</div>
</div>
</div>
</div>
<div class="col-md-12">
<div class="card">
<div class="card-header text-white bg-dark">
<h5 style="float: left">Transaction History</h5>
</div>
<div class="card-body">
<div class="overflow-x-auto">
<table class="table table-striped table-bordered dataTable" id="example1">
<thead>
<tr>
<th>SN</th>
<th>Name</th>
<th>Username</th>
<th>Amount</th>
<th>Board</th>
<th>Remark</th>
<th>Time</th>
</tr>
</thead>
<tbody>
<?php
$i=1; $mm = date('ym');
$sql = $db->query("SELECT * FROM cpay ORDER BY sn DESC LIMIT 100");
while($row = mysqli_fetch_assoc($sql)) { $e = $i++; $id=$row['id'];
?>
<tr>
<td><?php echo $e; ?></td>
<td><?php echo userName($id); ?></td>
<td><?php echo userName($id,'user'); ?></td>
<td>$<?php echo number_format(abs($row['amount']),2); ?></td>
<td><?php echo $row['amount']>0 ? 'Credit' : 'Debit' ?></td>
<td><?php echo cpayRemark($row['type']) ?></td>
<td><?php echo $row['created']; ?></td>
</tr>
<?php } ?>
</tbody>
<tfoot>
</tfoot>
</table>
</div>
</div>
</div>
</div>
</div><!-- /.card-header -->
<!-- /.card-body -->
<!-- /.card -->
</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 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 payd(u,v){
alert(v+u);
}
$(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>