<?= $this->extend('templates/index'); ?>
<?= $this->section('content'); ?>

<?php if(session()->getFlashdata('pesan')) : ?>
    <div class="alert alert-success" role="alert">
        <?= session()->getFlashdata('pesan'); ?>
    </div>
<?php endif; ?>
<section class="content">
    <div class="container-fluid">
        <div class="row">
            <div class="col">
                
                <div class="card card-primary">
                    <div class="card-header">
                        <h3 class="card-title">Panduan: <small>Isi form yang disediakan dengan tepat</small></h3>
                    </div>
                <!-- /.card-header -->
                <!-- form start -->
                    <form id="tambah_produk" method="post" action="<?= base_url('perusahaan/save/produk'); ?>" novalidate="novalidate">
                        <div class="card-body">
                            <div class="form-group">
                                <label for="nama">Perusahaan</label>
                                <select name="id_perusahaan" class="form-control select2">
                                    <option></option>
                                    <?php foreach($perusahaan as $key => $r) : ?>
                                        <option value="<?= $r['id']; ?>"><?= $r['nama']; ?></option>
                                    <?php endforeach; ?>
                                </select>
                            </div>
                            <div class="form-group">
                                <label for="nama">Nama Produk</label>
                                <input type="text" name="nama" class="form-control" id="nama" placeholder="Masukkan nama perusahaan">
                            </div>
                            <div class="form-group">
                                <label for="exampleInputPassword1">Keterangan</label>
                                <input type="text" name="keterangan" class="form-control" id="keterangan" placeholder="Masukkan keterangan">
                            </div>
                        </div>
                        <!-- /.card-body -->
                        <div class="card-footer">
                            <button type="submit" class="btn btn-primary">Simpan</button>
                            <button type="reset" class="btn btn-warning">Reset</button>
                            <button type="<?= base_url('perusahaan/produk'); ?>" class="btn btn-danger">Batal</button>
                        </div>
                    </form>
                </div>

            </div>
        </div>
    </div>
</section>

<?= $this->endSection(); ?>