<?php
session_start();
include 'include/config.php';

if(!isset($_SESSION['id'])){
    // echo "<script> window.location.href = 'index.php' </script>";
  }
?>

<?php  include 'include/head.php'; ?>

                    <!-- Start Content-->
                    <div class="container-fluid">

                        <!-- start page title -->
                        <div class="row">
                            <div class="col-12">
                                <div class="page-title-box">
                                    
                                    <h4 class="page-title" style="text-align:center; color:blue;">Dashboard</h4>
                                </div>
                            </div>
                        </div>
                        <!-- end page title -->

                        <div class="row">
                            <div class="col-xl-12 col-lg-12">

                                <div class="row">
                                    <div class="col-sm-4">
                                    <div class="card widget-flat bg-success text-white">
                                        <div class="card-body">
                                            <div class="float-end">
                                                <i class="mdi mdi-account-multiple widget-icon"></i>
                                            </div>
                                            <h5 class="" title="Total Users" style="color:black">Total Users</h5>
                                            <?php
                                            $query = "SELECT * FROM user_details";
                                            $result = mysqli_query($conn, $query);
                                            $row = mysqli_num_rows($result);
                                            ?>
                                            <h3 class="mt-3 mb-3"><?= $row  ?></h3>
                                            <a class="btn btn-primary" href="user.php">View All</a>
                                        </div> <!-- end card-body-->
                                    </div> <!-- end card-->
                                </div> <!-- end col-->

                                    <div class="col-sm-4">
                                        <div class="card widget-flat bg-primary text-white">
                                            <div class="card-body">
                                                <div class="float-end">
                                                    <i class="mdi mdi-cart-plus widget-icon"></i>
                                                </div>
                                                <h5 class="" title="Total Fitness Center" style="color:black">Total Notification</h5>
                                                <?php
                                                    $query1 = "SELECT * FROM notification";
                                                    $result1 = mysqli_query($conn, $query1);
                                                    $row1 = mysqli_num_rows($result1);
                                                ?>
                                                <h3 class="mt-3 mb-3"><?= $row1 ?> </h3>
                                                <a class="btn btn-primary" href="notifucation.php">View All</a>
                                            </div> <!-- end card-body-->
                                        </div> <!-- end card-->
                                    </div> <!-- end col-->

                                     <div class="col-sm-4">
                                         <div class="card widget-flat bg-danger text-white">
                                             <div class="card-body">
                                                 <div class="float-end">
                                                     <i class="mdi mdi-currency-usd widget-icon"></i>
                                                 </div>
                                                 <h5 class="" title="Total Active Divies" style="color:black">Total Loan Applied Users</h5>
                                                 <?php
                                                     $query2 = "SELECT * FROM loan";
                                                      $result2 = mysqli_query($conn, $query2);
                                                     $row2 = mysqli_num_rows($result2);
                                                 ?>
                                                 <h3 class="mt-3 mb-3"><?= $row2 ?></h3>
                                                 <a class="btn btn-primary" href="loan.php">View All</a>
                                             </div> <!-- end card-body-->
                                         </div> <!-- end card-->
                                     </div> <!-- end col-->
                                    
                                    

                                           
                                        
                                    

                                     

                                    
                                    

                                    <!--<div class="col-sm-4">-->
                                    <!--    <div class="card widget-flat">-->
                                    <!--        <div class="card-body">-->
                                    <!--            <div class="float-end">-->
                                    <!--                <i class="mdi mdi-currency-usd widget-icon"></i>-->
                                    <!--            </div>-->
                                    <!--            <h5 class="text-muted fw-normal mt-0" title="Total Active Divies">Green Play</h5>-->
                                                <?php
                                                    // $game3 = "SELECT * FROM play_game WHERE game_num='green' ";
                                                    // $game = mysqli_query($conn, $game3);
                                                    // $gaemgreen = mysqli_num_rows($game);
                                                ?>
                                    <!--            <h3 class="mt-3 mb-3"><?= $gaemgreen; ?></h3>-->
                                    <!--            <a class="btn btn-primary" href="#">View All</a>-->
                                                
                                    <!--        </div> -->
                                    <!--    </div> -->
                                    <!--</div>-->

                                    <!--<div class="col-sm-4">-->
                                    <!--    <div class="card widget-flat">-->
                                    <!--        <div class="card-body">-->
                                    <!--            <div class="float-end">-->
                                    <!--                <i class="mdi mdi-currency-usd widget-icon"></i>-->
                                    <!--            </div>-->
                                    <!--            <h5 class="text-muted fw-normal mt-0" title="Total Active Divies">Violet Play</h5>-->
                                                <?php
                                                    // $game4 = "SELECT * FROM play_game WHERE game_num='violet' ";
                                                    // $game4 = mysqli_query($conn, $game4);
                                                    // $gaemgren = mysqli_num_rows($game4);
                                                ?>
                                    <!--            <h3 class="mt-3 mb-3"><?= $gaemgren; ?></h3>-->
                                    <!--            <a class="btn btn-primary" href="#">View All</a>-->
                                                
                                    <!--        </div> -->
                                    <!--    </div> -->
                                    <!--</div>-->

                                    <!--<div class="col-sm-4">-->
                                    <!--    <div class="card widget-flat">-->
                                    <!--        <div class="card-body">-->
                                    <!--            <div class="float-end">-->
                                    <!--                <i class="mdi mdi-currency-usd widget-icon"></i>-->
                                    <!--            </div>-->
                                    <!--            <h5 class="text-muted fw-normal mt-0" title="Total Active Divies">Red Play</h5>-->
                                                <?php
                                                    // $game5 = "SELECT * FROM play_game WHERE game_num='red' ";
                                                    // $game5 = mysqli_query($conn, $game5);
                                                    // $gaemgeen = mysqli_num_rows($game5);
                                                ?>
                                    <!--            <h3 class="mt-3 mb-3"><?= $gaemgeen; ?></h3>-->
                                    <!--            <a class="btn btn-primary" href="#">View All</a>-->
                                                
                                    <!--        </div> -->
                                    <!--    </div> -->
                                    <!--</div>-->

                                    

                                </div> <!-- end row -->

                            </div> <!-- end col -->

                        </div>
                        <!-- end row -->

                    </div>
                    <!-- container -->

<?php  
include 'include/footer.php'; 
?>