<?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('type_of_fabrics/edit/' . $data->kode_jenis_kain) ?>" enctype="multipart/form-data">
                    <?= csrf_field() ?>
                    <div class="form-group">
                        <label class="form-label" for="exampleInputNama">Nama Jenis Kain</label>
                        <input type="text" class="form-control" id="exampleInputNama" name="nama_jenis_kain" value="<?= $data->nama_jenis_kain ?>" placeholder="Input Nama Jenis Kain" required>
                    </div>
                    <div class="form-group">
                        <label class="form-label" for="exampleInputWarna">Warna</label>
                        <input type="text" class="form-control" id="exampleInputWarna" name="warna" value="<?= $data->warna ?>" placeholder="Input Warna" required>
                    </div>
                    <div class="form-group">
                        <label class="form-label" for="exampleInputStok">Harga Per Meter</label>
                        <input type="number" class="form-control" id="exampleInputStok" name="harga_per_meter" value="<?= $data->harga_per_meter ?>" placeholder="Input Harga Per Meter" required>
                    </div>

                    <img width="100" height="100" class="ml-3" src=" <?= base_url($data->foto_jenis_kain) ?>" alt="">
                    <div class="form-group">
                        <label class="form-label" for="exampleInputFile">Input Foto Jenis Kain</label>
                        <div class="input-group">
                            <div class="custom-file">
                                <input type="file" class="custom-file-input" name="foto_jenis_kain" 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() ?>