Your IP : 3.145.35.234
<?php
session_start(); ob_start();
include("lib/connect.inc.php");
if($uidx != 1){
header("Location:../login.php");
}
if(isset($_POST['AddMUser'])){
$id = $_POST['AddMUser'];
$time = time();
$db->query("UPDATE user SET m='$time' WHERE id='$id' ");
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Markrters</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>CCI Marketers</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">Marketers</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">Find User</h5>
<form class="mt-3" method="post">
<div class="float-right" style="margin-top: -20px"><table><tr><td><input type="text" name="q" required class="form-control" placeholder="Serach for"></td><td><select required name="filter" class="form-control">
<option value="">Select Option</option>
<option value="firstname">Firstname</option>
<option value="lastname">Lastname</option>
<option value="user">Username</option>
<option value="email">E-mail</option>
<option value="phone">Phone Number</option>
</select></td><td><button type="submit" name="Serach" class="btn btn-primary">Search Item</button></td><td></td></tr></table></div>
</form>
</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>Joined On</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
$i=1;
if(isset($_POST['q'])){
$q = $_POST['q']; $filter = $_POST['filter'];
$sql = $db->query("SELECT * FROM user WHERE $filter LIKE '%$q%' ");
while($row = $sql->fetch_assoc()) { $e = $i++;
?>
<tr <?php if($row['m']>1000){ ?> bgcolor="grey"<?php } ?>>
<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 substr($row['created'],0,10); ?></td>
<td><?php if($row['m']==0){ ?><form method="post">
<button type="submit" value="<?php echo $row['id']; ?>" name="AddMUser">Create Marketer</button>
</form><?php } ?></td>
</tr>
<?php } } ?>
</tbody>
<tfoot>
</tfoot>
</table>
</div>
</div>
</div>
<div class="card">
<div class="card-header text-white bg-dark">
<h5 style="float: left">Registered Marketers</h5>
</div>
<div class="card-body">
<div class="overflow-x-auto">
<table class="table table-bordered table-sm" id="example3">
<thead>
<tr>
<th>No</th>
<th>Name(s)</th>
<th>Email</th>
<th>Username</th>
<th>Registered On</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
$i=1;
$sql = $db->query("SELECT * FROM user WHERE m > 1000 ");
while($row = $sql->fetch_assoc()) { $e = $i++;
?>
<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 date('jS M Y',$row['m']); ?></td>
<td><form method="post">
<button type="submit" value="<?php echo $row['id']; ?>" name="ViewUser">Statistics</button>
</form></td>
</tr>
<?php } ?>
</tbody>
<tfoot>
</tfoot>
</table>
</div>
</div>
</div>
<?php
if(isset($_POST['ViewUser'])){ $_SESSION['ViewUser']=$_POST['ViewUser']; }
if(isset($_SESSION['ViewUser'])){
$id = $_SESSION['ViewUser'];
?>
<div class="card">
<div class="card-header text-white bg-dark">
<h5 style="float: left">Team Statistics: <?= userName($id) ?> [<?= userName($id,'user') ?>]</h5>
</div>
<div class="card-body">
<div class="overflow-x-auto table-responsive">
<table class="table table-bordered table-sm" id="example3">
<thead>
<tr>
<?php $i=1; while($i<=12){ $e=$i++; ?>
<th><?= date("M", mktime(0, 0, 0, $e, 10)); ?></th>
<?php } ?>
</tr>
</thead>
<tbody>
<tr>
<?php $i=1; while($i<=12){ $e=$i++; $e = $e<10?'0'.$e:$e ?>
<td><?php $mm = date('y').$e; echo $covis->userMonthTeam($id,$mm) ?></td>
<?php } ?>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<?php } ?>
</div>
</div><!-- /.card-header -->
<!-- /.card-body -->
<!-- /.card -->
<!-- /.row (main row) -->
<?php
?>
</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 -->
<!-- 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>