<!DOCTYPE html>
<html lang="en">
<head>
	
    <?php

        include "header.php";

    ?>
		
</head>
<body data-background-color="dark">
    <div id="app">
        
        <!--/PayPal-->
            
        <!--Start of Tawk.to Script-->
        <script type="text/javascript">
        {tawk to codess}
        </script>
        <!--End of Tawk.to Script-->
		<div class="wrapper">
			        <div class="main-header">
    <!-- Logo Header -->
<div class="logo-header" data-background-color="blue">
        <a href="/" class="logo" style="font-size: 27px; color:#fff;">
            P.S.M
        </a>
    <button class="ml-auto navbar-toggler sidenav-toggler" type="button" data-toggle="collapse" data-target="collapse" aria-expanded="false" aria-label="Toggle navigation">
            <span class="navbar-toggler-icon">
                <i class="icon-menu "></i>
            </span>
        </button>
        <button class="topbar-toggler more"><i class="icon-options-vertical "></i></button>
        <div class="nav-toggle">
            <button class="btn btn-toggle toggle-sidebar">
                <i class="icon-menu "></i>
            </button>
        </div>
        
    </div>
    <!-- End Logo Header -->

    <!-- Navbar Header -->
    <nav class="navbar navbar-header navbar-expand-lg" data-background-color="blue">
        
        <div class="container-fluid">
            <div class="collapse" id="search-nav">
                
                <script>
                    document.getElementById('searchform').addEventListener('subit' searchuser);
                   function searchuser(){
                       console.log('ddj');
                       let url = "https://platinumsignalmarket.com/trader/admin/dashboard/manageusers";
                       window.location.href = url;
                   }
               </script>
            </div>
            <ul class="navbar-nav topbar-nav ml-md-auto align-items-center">
                <li>
                    <form action="javascript:void(0)" method="post" id="styleform">
                        <div class="form-group">
                            <label class="style_switch">
                                <input name="style" id="style" type="checkbox" value="true" class="modes">
                                <span class="slider round"></span>
                            </label>
                        </div> 
                                                <input type="hidden" name="_token" value="KVw1wltuYedQnml0SQxyePDG6m3G8ANwpiRawibI">
                    </form>
                    
                </li>
                                <li class="nav-item dropdown hidden-caret">
                    <a class="nav-link" data-toggle="dropdown" href="#" aria-expanded="false">
                        <i class="text-white fas fa-user"></i>
                    </a>
                   
                    <ul class="dropdown-menu dropdown-user animated fadeIn">
                        <div class="dropdown-user-scroll scrollbar-outer">
                            <li>
                                <a class="dropdown-item" href="adminchangepassword.php">Change Password</a>
                                <div class="dropdown-divider"></div>
                                <a class="dropdown-item" href="logout.php">
                                Logout
                                </a>
                            </li>
                        </div>
                    </ul>
                </li>
            </ul>
        </div>
    </nav>
    <!-- End Navbar -->
</div>


<script type="text/javascript">
    //create investment
        $("#styleform").on('change',function(){
        $.ajax({
            url: "https://platinumsignalmarket.com/trader/admin/dashboard/changestyle",
            type: 'POST',
            data:$("#styleform").serialize(),
            success: function (data) {
				location.reload(true);
            },
            error: function (data) {
                console.log('Something went wrong');
            },

        });
    });
    
</script>
        <!-- Stored in resources/views/child.blade.php -->

<!-- Sidebar -->
<?php

    include "sidebar.php";

?>
<!-- End Sidebar -->
        <div class="main-panel">
        <div class="content bg-light">
            <div class="panel-header bg-primary-gradient ">
                <div class="py-5 page-inner">
                    <div class="d-flex align-items-left align-items-md-center flex-column flex-md-row">
                        <div>
                            <h2 class="pb-2 text-white fw-bold">Dashboard</h2>
                            <h5 class="mb-2 text-white op-7">Welcome, Super Admin!</h5> 
                        </div>
                        <div class="py-2 ml-md-auto py-md-0">
                            <a href="mdeposits.php" class="mr-2 btn btn-success btn-border ">Deposits</a>
                            <a href="mnfts.php" class="mr-2 btn btn-success btn-border ">NFTs</a>
                            <a href="mwithdrawals.php" class="mr-2 btn btn-danger btn-border ">Withdrawals</a>
                            <a href="manageusers.php" class="btn btn-secondary ">Users</a>
                        </div>
                    </div>
                </div>
            </div>
            <div>
    </div>            <div>
    </div>            <div class="page-inner mt--5">
                <!-- Beginning of  Dashboard Stats  -->
                 <?php
                                    $rs1 = mysqli_query($link, "SELECT * FROM transactions WHERE type = 'Deposit'");
                                    if ($rs1) {
                                        $deposit = mysqli_num_rows($rs1);
                                    }else{
                                        $deposit = 0;
                                    }

                                    $rs1 = mysqli_query($link, "SELECT * FROM transactions WHERE type = 'Withdrawal' ");
                                    if ($rs1) {
                                        $withdraw = mysqli_num_rows($rs1);
                                    }else{
                                        $withdraw = 0;
                                    }

                                    $rs1 = mysqli_query($link, "SELECT * FROM user");
                                    if ($rs1) {
                                        $users = mysqli_num_rows($rs1);
                                    }else{
                                        $users = 0;
                                    }
                                    
                                    $rs1 = mysqli_query($link, "SELECT * FROM user WHERE account_status = 'Blocked' ");
                                    if ($rs1) {
                                        $block = mysqli_num_rows($rs1);
                                    }else{
                                        $block = 0;
                                    }
                                    $rs1 = mysqli_query($link, "SELECT * FROM user WHERE kyc = 'Not Verified Yet' ");
                                    if ($rs1) {
                                        $kyc = mysqli_num_rows($rs1);
                                    }else{
                                        $kyc = 0;
                                    }

                                ?>
                <div class="row row-card-no-pd bg-light shadow-lg mt--2">
                    <div class="col-sm-6 col-md-3">
                        <div class="card card-stats card-round bg-light full-height">
                            <div class="card-body ">
                                <div class="row">
                                    <div class="col-4">
                                        <div class="text-center icon-big">
                                            <i class="fa fa-download text-warning"></i>
                                        </div>
                                    </div>
                                    <div class="col-8 col-stats">
                                        <div class="numbers">
                                            <p class="card-category">Total Deposit</p>
                                                                                                                                   <?php
                                                                                                                                        echo $deposit
                                                                                                                                   ?>
                                                                                                                                </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-6 col-md-3">
                        <div class="card card-stats card-round bg-light full-height">
                            <div class="card-body ">
                                <div class="row">
                                    <div class="col-4">
                                        <div class="text-center icon-big">
                                            <i class="flaticon-download text-info"></i>
                                        </div>
                                    </div>
                                    <div class="col-8 col-stats">
                                        <div class="numbers">
                                            <p class="card-category">Pending Deposit(s)</p>
                                                                                                                                    0
                                                                                                                                </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-6 col-md-3">
                        <div class="card card-stats card-round bg-light full-height">
                            <div class="card-body">
                                <div class="row">
                                    <div class="col-4">
                                        <div class="text-center icon-big">
                                            <i class="flaticon-arrows-1 text-danger"></i>
                                        </div>
                                    </div>
                                    <div class="col-8 col-stats">
                                        <div class="numbers">
                                            <p class="card-category">Total Withdrawal</p>
                                                                                                                                    <?php
                                                                                                                                        echo $withdrawal
                                                                                                                                   ?>
                                                                                                                                </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-6 col-md-3">
                        <div class="card card-stats card-round bg-light full-height">
                            <div class="card-body">
                                <div class="row">
                                    <div class="col-4">
                                        <div class="text-center icon-big">
                                            <i class="flaticon-arrow text-secondary"></i>
                                        </div>
                                    </div>
                                    <div class="col-8 col-stats">
                                        <div class="numbers">
                                            <p class="card-category">Pending Withdrawal</p>
                                                                                                                                    0
                                                                                                                                </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-6 col-md-3">
                        <div class="card card-stats card-round bg-light">
                            <div class="card-body ">
                                <div class="row">
                                    <div class="col-4">
                                        <div class="text-center icon-big">
                                            <i class="flaticon-users text-success"></i>
                                        </div>
                                    </div>
                                    <div class="col-8 col-stats">
                                        <div class="numbers">
                                            <p class="card-category">Total Users</p>
                                            <h4 class="card-title text-dark"><?php
                                                                                                                                        echo $users
                                                                                                                                   ?></h4>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-6 col-md-3">
                        <div class="card card-stats card-round bg-light">
                            <div class="card-body ">
                                <div class="row">
                                    <div class="col-4">
                                        <div class="text-center icon-big">
                                            <i class="flaticon-remove-user text-danger"></i>
                                        </div>
                                    </div>
                                    <div class="col-8 col-stats">
                                        <div class="numbers">
                                            <p class="card-category">Block Users</p>
                                            <h4 class="card-title text-dark"><?php
                                                                                                                                        echo $block
                                                                                                                                   ?></h4>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-6 col-md-3">
                        <div class="card card-stats card-round bg-light">
                            <div class="card-body ">
                                <div class="row">
                                    <div class="col-4">
                                        <div class="text-center icon-big">
                                            <i class="flaticon-user-2 text-success"></i>
                                        </div>
                                    </div>
                                    <div class="col-8 col-stats">
                                        <div class="numbers">
                                            <p class="card-category">Active Users</p>
                                            <h4 class="card-title text-dark"><?php
                                                                                                                                        echo $users
                                                                                                                                   ?></h4> 
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <div class="col-sm-6 col-md-3">
                        <div class="card card-stats card-round bg-light">
                            <div class="card-body ">
                                <div class="row">
                                    <div class="col-4">
                                        <div class="text-center icon-big">
                                            <i class="flaticon-diagram text-warning"></i>
                                        </div>
                                    </div>
                                    <div class="col-8 col-stats">
                                        <div class="numbers">
                                            <p class="card-category">Pending KYC</p>
                                            <h4 class="card-title text-dark"><?php
                                            
                                            echo $kyc
                                            
                                            ?></h4> 
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-12">
                        <div class="overflow-auto">
                            <canvas id="myChart" height="100" class="text-dark" ></canvas>
                        </div>
                        
                        <script>
                            var ctx = document.getElementById('myChart').getContext('2d');
                            var myChart = new Chart(ctx, {
                                type: 'bar',
                                data: {
                                    labels: ['Deposit', 'Pending Deposit', 'Withdrawal', 'Pending Withdrawal', 'Total Transactions'],
                                    datasets: [{
                                        label: "# System Statistics in $",
                                        data: [
                                            "9980", 
                                            "0",
                                            "11050", 
                                            "2900", 
                                            "85799"
                                            ],
                                        backgroundColor: [
                                            'rgba(255, 99, 132, 0.2)',
                                            'rgba(54, 162, 235, 0.2)',
                                            'rgba(255, 206, 86, 0.2)',
                                            'rgba(75, 192, 192, 0.2)',
                                            'rgba(153, 102, 255, 0.2)'
                                        ],
                                        borderColor: [
                                            'rgba(255, 99, 132, 1)',
                                            'rgba(54, 162, 235, 1)',
                                            'rgba(255, 206, 86, 1)',
                                            'rgba(75, 192, 192, 1)',
                                            'rgba(153, 102, 255, 1)'
                                        ],
                                        borderWidth: 1
                                    }]
                                },
                                options: {
                                    scales: {
                                        y: {
                                            beginAtZero: true
                                        }
                                    }
                                }
                            });
                        </script>
                    </div>
                </div>
            </div>
        </div>
    				<footer class="footer bg-dark text-light">
					<div class="container-fluid">
						<div class="text-center row copyright text-align-center">
							<p>All Rights Reserved &copy; P.S.M 2022</p>
						</div>
					</div>
				</footer>
			</div>
		</div>
	</div>

				<!--   Core JS Files   -->
		<?php

            include "footer.php";

        ?>
	    
</body>
</html>


