Your IP : 18.188.218.219


Current Path : /home/lentoinv/believersfamilyfoundation.com/profile/
Upload File :
Current File : //home/lentoinv/believersfamilyfoundation.com/profile/stat.php

<?php
session_start(); ob_start();

include('class.php');
if(!isset($_SESSION['user_id'])){header('location: login.php'); }
elseif($id>1003){header('location: .'); }

?>

<!DOCTYPE html>
<html lang="en">

<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>Dashboard</title>

    <!-- Custom fonts for this template-->
    <link href="vendor/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css">
    <link
        href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i"
        rel="stylesheet">

    <!-- Custom styles for this template-->
    <link href="css/sb-admin-2.min.css" rel="stylesheet">
    <!-- Custom styles for this page -->
    <link href="vendor/datatables/dataTables.bootstrap4.min.css" rel="stylesheet">


</head>

<body id="page-top">

    <!-- Page Wrapper -->
    <div id="wrapper">

        <!-- Sidebar -->
       <?php include('nav.php') ?>
        <!-- Content Wrapper -->
        <div id="content-wrapper" class="d-flex flex-column">

            <!-- Main Content -->
            <div id="content">

                <!-- Topbar -->
                <nav class="navbar navbar-expand navbar-light bg-white topbar mb-4 static-top shadow">

                    <!-- Sidebar Toggle (Topbar) -->
                    <button id="sidebarToggleTop" class="btn btn-link d-md-none rounded-circle mr-3">
                        <i class="fa fa-bars"></i>
                    </button>

                    <!-- Topbar Search -->
                    <form
                        class="d-none d-sm-inline-block form-inline mr-auto ml-md-3 my-2 my-md-0 mw-100 navbar-search">
                        <div class="input-group">
                            <input type="text" class="form-control bg-light border-0 small" placeholder="Search for..."
                                aria-label="Search" aria-describedby="basic-addon2">
                            <div class="input-group-append">
                                <button class="btn btn-primary" type="button">
                                    <i class="fas fa-search fa-sm"></i>
                                </button>
                            </div>
                        </div>
                    </form>

                    <!-- Topbar Navbar -->
                    <ul class="navbar-nav ml-auto">

                       

                        <!-- Nav Item - User Information -->
                        <li class="nav-item dropdown no-arrow">
                            <a class="nav-link dropdown-toggle" href="#" id="userDropdown" role="button"
                                data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                <span class="mr-2 d-none d-lg-inline text-gray-600 small"><?php echo userName($id) ?></span>
                                <img class="img-profile rounded-circle"
                                    src="img/undraw_profile.svg">
                            </a>
                            <!-- Dropdown - User Information -->
                            <div class="dropdown-menu dropdown-menu-right shadow animated--grow-in"
                                aria-labelledby="userDropdown">
                                <a class="dropdown-item" href="#" data-toggle="modal" data-target="#ProfileModal">
                                    <i class="fas fa-user fa-sm fa-fw mr-2 text-gray-400"></i>
                                    Profile
                                </a>
                                <!-- <a class="dropdown-item" href="#">
                                    <i class="fas fa-cogs fa-sm fa-fw mr-2 text-gray-400"></i>
                                    Settings
                                </a>
                                <a class="dropdown-item" href="#">
                                    <i class="fas fa-list fa-sm fa-fw mr-2 text-gray-400"></i>
                                    Activity Log
                                </a> -->
                                <div class="dropdown-divider"></div>
                                <a class="dropdown-item" href="#" data-toggle="modal" data-target="#logoutModal">
                                    <i class="fas fa-sign-out-alt fa-sm fa-fw mr-2 text-gray-400"></i>
                                    Logout
                                </a>
                            </div>
                        </li>

                    </ul>

                </nav>
                <!-- End of Topbar -->

                <!-- Begin Page Content -->
                <div class="container-fluid">

                    <!-- Page Heading -->
                    <div class="d-sm-flex align-items-center justify-content-between mb-4">
                        <h1 class="h3 mb-0 text-gray-800">Dashboard</h1>
                        <!-- <a href="#" class="d-none d-sm-inline-block btn btn-sm btn-primary shadow-sm"><i
                                class="fas fa-download fa-sm text-white-50"></i> Generate Report</a> -->
                    </div>

                    <!-- Content Row -->
                    <div class="row">

                        <!-- Earnings (Monthly) Card Example -->
                        <div class="col-xl-3 col-md-6 mb-4">
                            <div class="card border-left-primary shadow h-100 py-2">
                                <div class="card-body">
                                    <div class="row no-gutters align-items-center">
                                        <div class="col mr-2">
                                            <div class="text-xs font-weight-bold text-primary text-uppercase mb-1">
                                                Believers</div>
                                            <div class="h5 mb-0 font-weight-bold text-gray-800"><?php echo sqL('user') ?></div>
                                        </div>
                                        <div class="col-auto">
                                            <i class="fas fa-calendar fa-2x text-gray-300"></i>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <!-- Earnings (Monthly) Card Example -->
                        <div class="col-xl-3 col-md-6 mb-4">
                            <div class="card border-left-success shadow h-100 py-2">
                                <div class="card-body">
                                    <div class="row no-gutters align-items-center">
                                        <div class="col mr-2">
                                            <div class="text-xs font-weight-bold text-success text-uppercase mb-1">
                                               Total Team</div>
                                            <div class="h5 mb-0 font-weight-bold text-gray-800"><?php echo sqL('user') ?></div>
                                        </div>
                                        <div class="col-auto">
                                            <i class="fas fa-dollar-sign fa-2x text-gray-300"></i>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <!-- Earnings (Monthly) Card Example -->
                        <div class="col-xl-3 col-md-6 mb-4">
                            <div class="card border-left-info shadow h-100 py-2">
                                <div class="card-body">
                                    <div class="row no-gutters align-items-center">
                                        <div class="col mr-2">
                                            <div class="text-xs font-weight-bold text-info text-uppercase mb-1">Total Points
                                            </div>
                                            <div class="row no-gutters align-items-center">
                                                <div class="col-auto">
                                                    <div class="h5 mb-0 mr-3 font-weight-bold text-gray-800"><?php echo sqL('user')+sqL('user')*3  ?></div>
                                                </div>
                                                
                                            </div>
                                        </div>
                                        <div class="col-auto">
                                            <i class="fas fa-clipboard-list fa-2x text-gray-300"></i>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <!-- Pending Requests Card Example -->
                        <div class="col-xl-3 col-md-6 mb-4">
                            <div class="card border-left-warning shadow h-100 py-2">
                                <div class="card-body">
                                    <div class="row no-gutters align-items-center">
                                        <div class="col mr-2">
                                            <div class="text-xs font-weight-bold text-warning text-uppercase mb-1">
                                                Value</div>
                                            <div class="h5 mb-0 font-weight-bold text-gray-800">Hidden</div>
                                        </div>
                                        <div class="col-auto">
                                            <i class="fas fa-comments fa-2x text-gray-300"></i>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>

                    <!-- Content Row -->




                    <div class="card shadow mb-4">
                        <div class="card-header py-3">
                            <h6 class="m-0 font-weight-bold text-primary">Registered Believers</h6>
                        </div>
                        <div class="card-body">
                            <div class="table-responsive">
                                <table class="table table-bordered " id="dataTable" width="100%" cellspacing="0">
                                    <thead>
                                        <tr>
                                            <th>SN</th>
                                            <th>Name</th>
                                            <th>Gender</th>
                                            <th>Phone</th>
                                            <th>WhatsApp</th>
                                            <th>Email</th>
                                         <!--    <th>Address</th> -->
                                            <th>Date</th>
                                            <th>Referrals</th>
                                            
                                        </tr>
                                    </thead>
                                    <tfoot>
                                        <tr>
                                            <th>SN</th>
                                            <th>Name</th>
                                            <th>Gender</th>
                                            <th>Phone</th>
                                            <th>WhatsApp</th>
                                            <th>Email</th>
                                         <!--    <th>Address</th> -->
                                            <th>Date</th>
                                            <th>Referrals</th>
                                            
                                        </tr>
                                    </tfoot>
                                    <tbody>
                                        <?php $sql = $db->query("SELECT * FROM user ORDER BY sn DESC LIMIT 1000"); $i=1;
                                         while($row=mysqli_fetch_assoc($sql)) { $e=$i++;
                                               ?>
                                        <tr>
                                            <td><?php echo $e ?></td>
                                            <td><a href="?userid=<?php echo $row['sn'] ?>"> <?php echo userName($row['id']) ?></a></td>
                                            <td><?php echo $row['sex'] ?></td>
                                            <td><?php echo $row['phone'] ?></td>
                                            <td><?php echo $row['whatsapp'] ?></td>
                                            <td><?php echo $row['email'] ?></td>
                                            <td><?php echo substr($row['created'],0,10) ?></td>
                                            <td><?php echo sqL1('user','sponsor',$row['sn']) ?></td>
                                        </tr>
                                    <?php } ?>
                                       
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>

                
 <?php if(isset($_GET['userid'])){  $userid = $_GET['userid'];  $id=sqLx('user','sn',$_GET['userid'],'id'); ?>

                    <div class="card shadow mb-4">
                        <div class="card-header py-3">
                            <h6 class="m-0 font-weight-bold text-primary">Referred By <?php echo userName($id) ?></h6>
                        </div>
                        <div class="card-body">
                            <div class="table-responsive">
                                <table class="table table-bordered " id="dataTable" width="100%" cellspacing="0">
                                    <thead>
                                        <tr>
                                            <th>SN</th>
                                            <th>Name</th>
                                            <th>Gender</th>
                                            <th>Phone</th>
                                            <th>WhatsApp</th>
                                            <th>Email</th>
                                         <!--    <th>Address</th> -->
                                            <th>Date</th>
                                            <th>Referrals</th>
                                            
                                        </tr>
                                    </thead>
                                    <tfoot>
                                        <tr>
                                            <th>SN</th>
                                            <th>Name</th>
                                            <th>Gender</th>
                                            <th>Phone</th>
                                            <th>WhatsApp</th>
                                            <th>Email</th>
                                         <!--    <th>Address</th> -->
                                            <th>Date</th>
                                            <th>Referrals</th>
                                            
                                        </tr>
                                    </tfoot>
                                    <tbody>
                                        <?php $sql = $db->query("SELECT * FROM user WHERE sponsor='$userid' ORDER BY sn DESC LIMIT 1000"); $i=1;
                                         while($row=mysqli_fetch_assoc($sql)) { $e=$i++;
                                               ?>
                                        <tr>
                                            <td><?php echo $e ?></td>
                                            <td><a href="?userid=<?php echo $row['sn'] ?>"> <?php echo userName($row['id']) ?></a></td>
                                            <td><?php echo $row['sex'] ?></td>
                                            <td><?php echo $row['phone'] ?></td>
                                            <td><?php echo $row['whatsapp'] ?></td>
                                            <td><?php echo $row['email'] ?></td>
                                            <td><?php echo substr($row['created'],0,10) ?></td>
                                            <td><?php echo sqL1('user','sponsor',$row['sn']) ?></td>
                                        </tr>
                                    <?php } ?>
                                       
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>

                <?php } ?>

                </div>
                <!-- /.container-fluid -->

            </div>
            <!-- End of Main Content -->

            <!-- Footer -->
            <footer class="sticky-footer bg-white">
                <div class="container my-auto">
                    <div class="copyright text-center my-auto">
                        <span>Copyright &copy; 2020. Believers Family Foundation</span>
                    </div>
                </div>
            </footer>
            <!-- End of Footer -->

        </div>
        <!-- End of Content Wrapper -->

    </div>
    <!-- End of Page Wrapper -->

    <!-- Scroll to Top Button-->
    <a class="scroll-to-top rounded" href="#page-top">
        <i class="fas fa-angle-up"></i>
    </a>

    <!-- Logout Modal-->
    <form method="post">
    <div class="modal fade" id="logoutModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
        aria-hidden="true">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title" id="exampleModalLabel">Confirm Logout</h5>
                    <button class="close" type="button" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">×</span>
                    </button>
                </div>
                <div class="modal-body">Are you sure you want to leave now?</div>
                <div class="modal-footer">
                    <button class="btn btn-secondary" type="button" data-dismiss="modal">Cancel</button>
                    <button type="submit" class="btn btn-primary" name="LogoutUser" >Logout</button>
                </div>
            </div>
        </div>
    </div>
</form>
    <!-- Logout Modal-->
    <form method="post">
    <div class="modal fade" id="ProfileModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
        aria-hidden="true">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title" id="exampleModalLabel">User Information</h5>
                    <button class="close" type="button" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">×</span>
                    </button>
                </div>
                <div class="modal-body">
                    <?php //if(isset($_GET['userid'])){ } ?>
                    <table class="table">
                       <tr><th>Surname</th><td><?php echo userName($id,'firstname') ?></td></tr>
                        <tr><th>Other Names</th><td><?php echo userName($id,'lastname') ?></td></tr>
                        <tr><th>Date of Birt</th><td><?php echo userName($id,'dob') ?></td></tr>
                        <tr><th>Gender</th><td><?php echo userName($id,'sex') ?></td></tr>
                        <tr><th>Phone Number</th><td><?php echo userName($id,'phone') ?></td></tr>
                        <tr><th>WhatsApp Number</th><td><?php echo userName($id,'whatsapp') ?></td></tr>
                        <tr><th>Email</th><td><?php echo userName($id,'email') ?></td></tr>
                        <tr><th>Address</th><td><?php echo userName($id,'address') ?></td></tr>
                        <tr><th>City</th><td><?php echo userName($id,'city') ?></td></tr>
                        <tr><th>State</th><td><?php echo userName($id,'state') ?></td></tr>
                        <tr><th>User ID</th><td><?php echo userName($id,'sn') ?></td></tr>
                        <tr><th>Registered on</th><td><?php echo userName($id,'created') ?></td></tr>
                    </table>
                </div>
               
            </div>
        </div>
    </div>
</form>
    <!-- Bootstrap core JavaScript-->
    <script src="vendor/jquery/jquery.min.js"></script>
    <script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>

    <!-- Core plugin JavaScript-->
    <script src="vendor/jquery-easing/jquery.easing.min.js"></script>

    <!-- Custom scripts for all pages-->
    <script src="js/sb-admin-2.min.js"></script>

    <!-- Page level plugins -->
    <script src="vendor/chart.js/Chart.min.js"></script>
    <!-- Page level plugins -->
    <script src="vendor/datatables/jquery.dataTables.min.js"></script>
    <script src="vendor/datatables/dataTables.bootstrap4.min.js"></script>
        <!-- Page level custom scripts -->
    <script src="js/demo/datatables-demo.js"></script>


    <!-- Page level custom scripts -->
    <script src="js/demo/chart-area-demo.js"></script>
    <script src="js/demo/chart-pie-demo.js"></script>
  <?php if(isset($_GET['userid'])){  ?>
    <script type="text/javascript">
        //remove the on load to trigger it any time you want 
    $(window).on('load',function(){
        $('#ProfileModal').modal('show');
    });
</script>
<?php } ?>
</body>

</html>

?>