
<div class="content-wrapper">
    <section class="content-header">
        <div class="container-fluid">
            <div class="row mb-2">
                <div class="col-sm-6">
                    <h1><?= $title; ?></h1>
                </div>
                <div class="col-sm-6">
                    <ol class="breadcrumb float-sm-right">
                     <li class="breadcrumb-item"><a href="#"><?= $root; ?></a></li>
                <li class="breadcrumb-item active"><?= $title; ?></li>
                    </ol>
                </div>
            </div>
        </div><!-- /.container-fluid -->
    </section>
    <div class="container-fluid mt-3">
   
        <div class="card">
            <div class="card-header">
                <h2 class="text-center">Data Inventaris</h2>
                <!-- Button trigger modal -->
                <button type="button" class="btn btn-primary btn-sm pd-left" data-toggle="modal" data-target="#exampleModal">
                Tambah data
                </button>
            <div class="card-body">
                <?php echo $this->session->flashdata('notif') ?>
                <div class="table-responsive">
                    <table id="tabel" class="table table-bordered">
                        <thead>
                            <tr>
                                <th>No.</th>
                                <th>Image</th>
                                <th>Nama Inventaris</th>
                                <th>Kondisi</th>
                                <th>Jenis</th>
                                <th>Milik</th>
                                <th>Jumlah</th>
                                <th>Action</th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php $no = 1; ?>
                            <?php foreach ($inventaris as $q) : ?>
                                <tr>
                                    <td><?php echo $no++; ?></td>
                                    <td>
                                        <img src="<?php echo base_url();?>files/inventaris/<?php echo $q->image;?>" class="img-thumbnail" width="30%" alt="">
                                    </td>
                                    <td><?php echo $q->nama_inv; ?></td>
                                    <td><?php echo $q->kondisi; ?></td>
                                    <td><?php echo $q->jenis; ?></td>
                                    <td><?php echo $q->milik;?></td>
                                    <td><?php echo $q->jumlah; ?></td>
                                    <td>
                                        <a href="<?php echo base_url('inventaris/del/' . $q->id_inv) ?>" onclick="return confirm('Hapus?')" class="badge badge-danger">Hapus</a>
                                        <a href="<?php echo base_url('inventaris/edit/' . $q->id_inv) ?>" class="badge badge-success">Edit  </a>
                                    </td>
                                </tr>
                            <?php endforeach; ?>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>

<!-- Modal -->
<div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
                <div class="modal-dialog">
                    <div class="modal-content">
                    <div class="modal-header">
                        <h5 class="modal-title" id="exampleModalLabel">Tambah Inventaris</h5>
                          <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                        </button>
                    </div>
                    <div class="modal-body">
                    <?php echo form_open_multipart('inventaris/proses_tambahdata');?>
                            
                            <div class="form-group">
                            <label for="exampleFormControlSelect1">Nama Inventaris</label>
                                    <input type="text" class="form-control" id="nama_inv" name="nama_inv" required="" >
                          </div>
                             <div class="form-group">
                                    <label  id="kondisi" >Kondisi</label>
                                    <select class="form-control"name="kondisi" id="FormControl" required="">
                                        <option>Bagus</option>
                                        <option>Rusak</option>
                                        <option>Sedang Diperbaiki</option>
                                    </select>
                            </div>
                            <div class="form-group">
                            <label for="exampleFormControlSelect1">Jenis</label>
                                    <select class="form-control" name="jenis" id="exampleFormControlSelect1" required="">
                                        <option>Laptop</option>
                                        <option>alat kebersihan</option>
                                        <option>Perangkat Komputer</option>
                                        <option>Perangkat Jaringan</option>
                                        <option>Elektronik</option>
                                    </select>
                             </div>
                             <div class="form-group">
                             <label for="exampleFormControlSelect1">Milik</label>
                                    <select class="form-control" name="milik" id="exampleFormControlSelect1" required="">
                                        <option>MTs Assaidiyyah</option>
                                        <option>MA Assaidiyyah</option>
                                        <option>SMK Assaidiyyah</option>
                                        <option>Ponpes Assaidiyyah</option>
                                        
                                    </select>
                            </div>
                            <div class="form-group">
                            <label for="exampleFormControlSelect1">Tambah Image</label>
                                    <input type="file" class="form-control" id="image" name="image"  required="">
                          </div>
                            <div class="form-group">
                                <label for="exampleFormControlSelect1">Jumlah</label>
                                    <input type="text" class="form-control" id="jumlah" name="jumlah" required="">
                             </div>
                             <div class="text-center">
                                    <button type="submit" class="btn btn-outline-success btn-user btn-block" value="upload">Simpan Data </button>
                            </div>
                    <?php echo form_close();?>
                    </div>
                   
                   </div>
               </div>
               </div>

            </div>