<?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) -->
        <div class="card mb-3">
            <div class="card-body">
                <form method="POST" action="<?= base_url('model/edit/' . $data->kode_model) ?>" enctype="multipart/form-data">
                    <?= csrf_field() ?>
                    <div class="form-group">
                        <label class="form-label" for="exampleNamaModel">Nama Model</label>
                        <input type="text" class="form-control" id="exampleNamaModel" name="nama_model" value="<?= $data->nama_model ?>" placeholder="Input Nama Model" required>
                    </div>
                    <div class="form-group">
                        <label class="form-label" for="exampleOngkosPengerjaan">Ongkos Pengerjaan</label>
                        <input type="number" class="form-control" id="exampleOngkosPengerjaan" name="ongkos_pengerjaan" value="<?= $data->ongkos_pengerjaan ?>" placeholder="Input Ongkos Pengerjaan" required>
                    </div>
                    <img width="100" height="100" class="ml-3" src=" <?= base_url($data->foto_model) ?>" alt="">
                    <div class="form-group">
                        <label class="form-label" for="exampleInputFile">Input Foto Model</label>
                        <div class="input-group">
                            <div class="custom-file">
                                <input type="file" class="custom-file-input" name="foto_model" id="exampleInputFile">
                                <label class="custom-file-label" for="exampleInputFile">Choose file</label>
                            </div>
                        </div>
                    </div>

                    <button type="submit" class="btn btn-primary">Simpan</button>
                </form>
            </div>
        </div>
    </div><!-- /.container-fluid -->
</section>
<?= $this->endSection() ?>