<?php if (auth()->user()->role == 'customer'): ?>
    <?= $this->extend('layouts/topbar') ?>
<?php else: ?>
    <?= $this->extend('layouts/sidebar') ?>
<?php endif; ?>

<?= $this->section('content') ?>

<section class="content">
    <div class="container-fluid">
        <h2 class="mb-5">Selamat Datang <?= auth()->user()->name ?></h2>
        <?php if (auth()->user()->role == 'admin' || auth()->user()->role == 'pemilik_toko'): ?>
            <div class="row">
                <div class="col-lg-4 col-md-4 col-sm-12">
                    <!-- small box -->
                    <div class="small-box bg-info" style="height: 133px">
                        <div class="inner">
                            <h3> <i class="fas fa-user"></i> &nbsp;<?= $total_customer  ?></h3>

                            <p>Total Customer</p>
                        </div>

                    </div>
                </div>
                <div class="col-lg-4 col-md-4 col-sm-12">
                    <!-- small box -->
                    <div class="small-box bg-info" style="height: 133px">
                        <div class="inner">
                            <h3><i class="fas fa-user-tie"></i> &nbsp;<?= $total_employee  ?></h3>

                            <p>Total Pegawai</p>
                        </div>

                    </div>
                </div>
                <div class="col-lg-4 col-md-4 col-sm-12">
                    <!-- small box -->
                    <div class="small-box bg-info" style="height: 133px">
                        <div class="inner">
                            <h3> <i class="fab fa-shirtsinbulk"></i> &nbsp;<?= $total_type_of_brics  ?></h3>

                            <p>Total Jenis Kain</p>
                        </div>

                    </div>
                </div>
                <!-- ./col -->
                <div class="col-lg-4 col-md-4 col-sm-12">
                    <!-- small box -->
                    <div class="small-box bg-success" style="height: 133px">
                        <div class="inner">
                            <h3><i class="fas fa-vest-patches"></i> &nbsp;<?= $total_modal  ?></h3>

                            <p>Total Model</p>
                        </div>

                    </div>
                </div>
                <!-- ./col -->
                <div class="col-lg-4 col-md-4 col-sm-12">
                    <!-- small box -->
                    <div class="small-box bg-danger" style="height: 133px">
                        <div class="inner">
                            <h3><i class="fas fa-money-check"></i> &nbsp;Rp. <?= number_format($total_pendapatan, 0, ",", ".") ?></h3>
                            <p>Total Pendapatan</p>
                        </div>

                    </div>
                </div>
            <?php elseif (auth()->user()->role == 'kasir'): ?>
                <!-- ./col -->
                <div class="col-lg-4 col-md-4 col-sm-12">
                    <!-- small box -->
                    <div class="small-box bg-danger" style="height: 133px">
                        <div class="inner">
                            <h3><i class="fas fa-money-check"></i> &nbsp;Rp. <?= number_format($total_pendapatan, 0, ",", ".") ?></h3>
                            <p>Total Pendapatan</p>
                        </div>

                    </div>
                </div>
            <?php endif; ?>
            </div>
    </div><!-- /.container-fluid -->
</section>
<?= $this->endSection() ?>