<?php

$acounter  = mysqli_query($con, "SELECT * FROM `accounts` WHERE account_activation=1") or die(mysqli_connect_error());
$total_users = mysqli_num_rows($acounter);

$bcounter  = mysqli_query($con, "SELECT * FROM `transactions`") or die(mysqli_connect_error());
$total_grp = mysqli_num_rows($bcounter);

$ccounter  = mysqli_query($con, "SELECT * FROM check_deposit") or die(mysqli_connect_error());
$total_pil = mysqli_num_rows($ccounter);

$lcounter  = mysqli_query($con, "SELECT * FROM loan") or die(mysqli_connect_error());
$loan = mysqli_num_rows($lcounter);
?>

<div class="row clearfix">
    <div class="col-lg-3 col-md-4 col-sm-12">
        <div class="card widget_2">
            <div class="body">
                <h6>ACTIVE ACCOUNTS</h6><br>
                <h2 style="font-size:24px; color:black"><?php echo $total_users ?> </h2>
                <div style="margin:0 auto 0 auto;" class="row">
                    <a style="background:red;" href="accounts.php" class="btn">
                        <strong> VIEW ALL</strong>
                    </a>
                </div>
            </div>
        </div>
    </div>

    <div class="col-lg-3 col-md-4 col-sm-12">
        <div class="card widget_2">
            <div class="body">
                <h6>LOAN APPLICATION</h6> <br>
                <h2 style="font-size:24px; color:black"> <?php echo $loan; ?></h2>
                <div style="margin:0 auto 0 auto;" class="row">
                    <a style="background:green;" href="loan.php" class="btn">
                        <strong>VIEW ALL</strong>
                    </a>
                </div>
            </div>
        </div>
    </div>
    <div class="col-lg-3 col-md-4 col-sm-12">
        <div class="card widget_2">
            <div class="body">
                <h6>ALL TRANSACTIONS</h6><br>
                <h2 style="font-size:24px; color:black"><?php echo $total_grp ?> </h2>
                <div style="margin:0 auto 0 auto;" class="row">
                    <a style="background:red;" href="transactions.php" class="btn">
                        <strong> VIEW ALL</strong>
                    </a>
                </div>
            </div>
        </div>
    </div>
    <div class="col-lg-3 col-md-4 col-sm-12">
        <div class="card widget_2">
            <div class="body">
                <h6>CHEQUE DEPOSIT </h6> <br>
                <h2 style="font-size:24px; color:black"> <?php echo $total_pil; ?></h2>
                <div style="margin:0 auto 0 auto;" class="row">
                    <a style="background:green;" href="cheque-management.php" class="btn">
                        <strong>VIEW ALL</strong>
                    </a>
                </div>
            </div>
        </div>
    </div>
</div>