<div class="page-header">
    <h3 class="page-title">
        <span class="page-title-icon bg-gradient-primary text-white mr-2">
            <i class="mdi mdi-account-convert"></i>
        </span>
        Sellers
    </h3>

</div>

<div class="row">
    <div class="col-12 grid-margin">
        <div class="card shadow border10">
            <div class="card-body">
                <h4 class="card-title">All Sellers</h4>
                <div class="table-responsive">
                    <table id="datatable" class="table dataTable display">
                        <thead>
                            <tr>
                                <th>
                                    #
                                </th>
                                <th>
                                    Name
                                </th>
                                <th>
                                    Total Product
                                </th>

                                <th>
                                    Actions
                                </th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php $serial = 1;$total_seller=0;$total_product=0;?>
                            <?php foreach ( $users as $member ): ?>
                            <?php foreach ( $sellers as $seller ): ?>
                            <?php if ( $seller->seller_id == $member->id ): ?>

                            <tr>
                               <?php 
                                $total_seller  =+ $serial;
                                $total_product += $seller->total_pdt;
                                ?>
                                <td><?=$serial++?>
                                </td>
                                <td><a href="<?=base_url()?>/ProfileCtrl?user_id=<?=$member->id?>"
                                        target="_blank"><?=$member->name?></a></td>
                                <td><?=$seller->total_pdt?></td>


                                <td>
                                    <a href="<?=base_url()?>/ProfileCtrl?user_id=<?=$member->id?>" target="_blank"
                                        class="btn btn-inverse-primary btn-sm btn-rounded" data-toggle="tooltip"
                                        title="View Profile"><i class="mdi mdi-eye-outline"></i></a>
                                  

                                </td>
                            </tr>
                                <?php endif?>
                            <?php endforeach?>
                            <?php endforeach?>
                        </tbody>
                    </table>

                    <h5>Total Product : <?=$total_product?></h5>
                    <h5>Total Seller : <?=$total_seller?> </h5>
                </div>
            </div>
        </div>
    </div>
</div>







<script>
$(document).ready(function() {
    $('#datatable').DataTable();
});
$(document).ready(function() {
    $('[data-toggle="tooltip"]').tooltip();
});

</script>