<?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">
        <!-- Small boxes (Stat box) -->
        <!-- Small boxes (Stat box) -->
        <div class="row">
            <?php $i = 1 ?>
            <?php foreach ($data as $data) : ?>
                <div class="col-sm-12 col-md-4 col-lg-3 mb-4">
                    <div class="card">
                        <div style=" margin: 20px;">
                            <img class="card-img-top" src="<?= base_url($data->foto_model) ?>" width="100%" height="150px" alt="Card image cap">
                        </div>
                        <div class="card-body">
                            <h5 class="card-title"><b><?= $data->nama_model  ?></b></h5>
                            <p class="card-text">Rp. <?= number_format($data->ongkos_pengerjaan, 0, ",", ".") ?></p>
                            <button onclick="show('<?= base_url('model/detail/' . $data->kode_model) ?>')" class="btn btn-primary" style="width: 100%; text-align:center;">Detail</button>
                        </div>
                    </div>
                </div>
            <?php endforeach; ?>
        </div><!-- /.container-fluid -->

</section>
<?= $this->endSection() ?>