<div class="content-header">
    <div class="container-fluid">
        <div class="row mb-2">
            <div class="col-sm-6">
                <!-- <h1 class="m-0">Deactive Member </h1> -->
            </div>
            <div class="col-sm-6">
                <ol class="breadcrumb float-sm-right">
                    <li class="breadcrumb-item"><a href="#">Home</a></li>
                    <li class="breadcrumb-item active">Dashboard</li>
                </ol>
            </div>
        </div>
    </div>
</div>



<section class="content">
<div class="container-fluid">



<div class="row">
<div class="col-lg-3 col-6">

<div class="small-box bg-info">
<div class="inner">

<div class="panel-center">
                        <br>
                        <strong>Members </strong>

                        <h4><?php foreach ($active as $key => $tot_thrift) ?>
                            <?php if ($tot_thrift['me_no'] > 0) { ?>
                                <?= $tot_thrift['me_no']; ?>
                            <?php } else { ?>
                                0
                            <?php } ?>
                        </h4>
                    </div>
                    <div class="panel-center">
                        <h4><?php foreach ($inactive as $key => $tot_thrift) ?>
                            <?php if ($tot_thrift['me_no'] > 0) { ?>
                                <?= $tot_thrift['me_no']; ?>
                            <?php } else { ?>
                                0
                            <?php } ?>
                        </h4>
                    </div>
                    <div class="panel-center">
                        <h4><?php foreach ($member as $key => $tot_thrift) ?>
                            <?php if ($tot_thrift['me_no'] > 0) { ?>
                                <?= $tot_thrift['me_no']; ?>
                            <?php } else { ?>
                                0
                            <?php } ?>
                        </h4>
                    </div>
</div>
<div class="icon">
<i class="ion ion-bag"></i>
</div>
</div>
</div>

<div class="col-lg-3 col-6">

<div class="small-box bg-success">
<div class="inner">
<div class="panel-center">
                        <br>
                        <strong>Thrift </strong>

                        <h4><?php foreach ($active_thrift as $key => $tot_thrift) ?>
                            <?php if ($tot_thrift['tot_thrift'] > 0) { ?>
                                <?= $tot_thrift['tot_thrift']; ?>
                            <?php } else { ?>
                                0
                            <?php } ?>
                        </h4>
                    </div>
                    <div class="panel-center">
                        <h4><?php foreach ($inactive_thrift as $key => $tot_thrift) ?>
                            <?php if ($tot_thrift['tot_thrift'] > 0) { ?>
                                <?= $tot_thrift['tot_thrift']; ?>
                            <?php } else { ?>
                                0
                            <?php } ?>
                        </h4>
                    </div>
                    <div class="panel-center">
                        <h4><?php foreach ($thrift as $key => $tot_thrift) ?>
                            <?php if ($tot_thrift['tot_thrift'] > 0) { ?>
                                <?= $tot_thrift['tot_thrift']; ?>
                            <?php } else { ?>
                                0
                            <?php } ?>
                        </h4>
                    </div>
</div>
<div class="icon">
<i class="ion ion-stats-bars"></i>
</div>
</div>
</div>

<div class="col-lg-3 col-6">

<div class="small-box bg-warning">
<div class="inner">
<div class="panel-center">
                        <br>
                        <strong>Share </strong>

                        <h4><?php foreach ($active_share as $key => $tot_thrift) ?>
                            <?php if ($tot_thrift['tot_share'] > 0) { ?>
                                <?= $tot_thrift['tot_share']; ?>
                            <?php } else { ?>
                                0
                            <?php } ?>
                        </h4>
                    </div>
                    <div class="panel-center">
                        <h4><?php foreach ($inactive_share as $key => $tot_thrift) ?>
                            <?php if ($tot_thrift['tot_share'] > 0) { ?>
                                <?= $tot_thrift['tot_share']; ?>
                            <?php } else { ?>
                                0
                            <?php } ?>
                        </h4>
                    </div>
                    <div class="panel-center">
                        <h4><?php foreach ($share as $key => $tot_thrift) ?>
                            <?php if ($tot_thrift['tot_share'] > 0) { ?>
                                <?= $tot_thrift['tot_share']; ?>
                            <?php } else { ?>
                                0
                            <?php } ?>
                        </h4>
                    </div>
</div>
<div class="icon">
<i class="ion ion-person-add"></i>
</div>
</div>
</div>

<div class="col-lg-3 col-6">

<div class="small-box bg-danger">
<div class="inner">
<div class="panel-center">
                        <br>
                        <strong>Insurance </strong>

                        <h4><?php foreach ($active_ins as $key => $tot_thrift) ?>
                            <?php if ($tot_thrift['tot_insurance'] > 0) { ?>
                                <?= $tot_thrift['tot_insurance']; ?>
                            <?php } else { ?>
                                0
                            <?php } ?>
                        </h4>
                    </div>
                    <div class="panel-center">
                        <h4><?php foreach ($inactive_ins as $key => $tot_thrift) ?>
                            <?php if ($tot_thrift['tot_insurance'] > 0) { ?>
                                <?= $tot_thrift['tot_insurance']; ?>
                            <?php } else { ?>
                                0
                            <?php } ?>
                        </h4>
                    </div>
                    <div class="panel-center">
                        <h4><?php foreach ($ins as $key => $tot_thrift) ?>
                            <?php if ($tot_thrift['tot_insurance'] > 0) { ?>
                                <?= $tot_thrift['tot_insurance']; ?>
                            <?php } else { ?>
                                0
                            <?php } ?>
                        </h4>
                    </div>
</div>
<div class="icon">
<i class="ion ion-pie-graph"></i>
</div>
</div>
</div>
</div>




<div class="row">
<div class="col-lg-3 col-6">

<div class="small-box bg-info">
<div class="inner">
<div class="panel-center">
                        <br>
                        <strong>Loan </strong>

                        <h4><?php foreach ($loan_amt as $key => $tot_thrift) ?>
                            <?php if ($tot_thrift['os_pay'] > 0) { ?>
                                <?= $tot_thrift['os_pay']; ?>
                            <?php } else { ?>
                                0
                            <?php } ?>
                        </h4>


                    </div>
</div>
<div class="icon">
<i class="ion ion-bag"></i>
</div>
</div>
</div>

<div class="col-lg-3 col-6">

<div class="small-box bg-success">
<div class="inner">
<div class="panel-center">
                        <br>
                        <strong> Demand </strong>

                        <h4><?php foreach ($demand as $key => $tot_thrift) ?>
                            <?php if ($tot_thrift['demand'] > 0) { ?>
                                <?= $tot_thrift['demand']; ?>
                                <?php $val = $tot_thrift['demand']; ?>

                            <?php } else { ?>
                                0
                            <?php } ?>
                        </h4>
                    </div>
</div>
<div class="icon">
<i class="ion ion-stats-bars"></i>
</div>
</div>
</div>

<div class="col-lg-3 col-6">

<div class="small-box bg-warning">
<div class="inner">

<div class="panel-center">
                        <br>
                        <strong> Demand Collection</strong>
                        <h4><?php foreach ($recovery as $key => $tot_thrift) ?>
                            <?php if ($tot_thrift->recover_total > 0) { ?>
                                <?= $tot_thrift->recover_total; ?>
                            <?php } else { ?>
                                0
                            <?php } ?>
                        </h4>
                    </div>
</div>
<div class="icon">
<i class="ion ion-person-add"></i>
</div>
</div>
</div>

<div class="col-lg-3 col-6">

<div class="small-box bg-danger">
<div class="inner">
<div class="panel-center">
                        <br>
                        <strong>Balance </strong>

                        <?php foreach ($recovery as $key => $tot_thrift) ?>
                        <?php if ($tot_thrift->recover_total > 0) { ?>
                            <?php if ($tot_thrift->recover_total > $val) { ?>
                                <h4>
                                    <?= $tot_thrift->recover_total - $val; ?>
                                </h4>

                            <?php } else if ($val > $tot_thrift->recover_total) { ?>
                                <h4 style="color:#ffac33">
                                    <?= $val - $tot_thrift->recover_total; ?>
                                </h4>

                            <?php } ?>
                        <?php } else { ?>
                            <h4>
                                0
                            </h4>
                        <?php } ?>
                    </div>
</div>
<div class="icon">
<i class="ion ion-pie-graph"></i>
</div>
</div>
</div>
</div>







<div class="row">
<div class="col-lg-3 col-6">

<div class="small-box bg-info">
<div class="inner">
<div class="panel-center">
                        <br>
                        <strong> Partial Collection</strong>
                        <h4><?php foreach ($partial as $key => $tot_thrift) ?>
                            <?php if ($tot_thrift->recover_total > 0) { ?>
                                <?= $tot_thrift->recover_total; ?>
                            <?php } else { ?>
                                0
                            <?php } ?>
                        </h4>

                       
                    </div>
</div>
<div class="icon">
<i class="ion ion-bag"></i>
</div>
</div>
</div>

<div class="col-lg-3 col-6">

<div class="small-box bg-success">
<div class="inner">
<h3>53<sup style="font-size: 20px">%</sup></h3>
<p>Bounce Rate</p>
</div>
<div class="icon">
<i class="ion ion-stats-bars"></i>
</div>
</div>
</div>

<div class="col-lg-3 col-6">

<div class="small-box bg-warning">
<div class="inner">
<h3>44</h3>
<p>User Registrations</p>
</div>
<div class="icon">
<i class="ion ion-person-add"></i>
</div>
</div>
</div>

<div class="col-lg-3 col-6">

<div class="small-box bg-danger">
<div class="inner">
<h3>65</h3>
<p>Unique Visitors</p>
</div>
<div class="icon">
<i class="ion ion-pie-graph"></i>
</div>
</div>
</div>
</div>





</div>
</section>

</div>