<!-- Modal Form untuk Tambah Inventory -->
<div class="modal fade" id="InventoryModal" tabindex="-1" aria-labelledby="InventoryModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-dialog-centered">
        <div class="modal-content">
            <!-- Modal Header with custom styling -->
            <div class="modal-header bg-primary text-white">
                <h5 class="modal-title" id="InventoryModalLabel"><i class="fas fa-user-plus"></i> Tambah Data ATK</h5>
                <button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal"></button>
            </div>
            
            <!-- Modal Body with improved form styling -->
            <div class="modal-body">
                <form action="<?php echo site_url('Admin/ATK/Atk_Product_Controller/tambah'); ?>" method="post">
                    <input type="hidden" name="created_by" value="<?php echo $this->session->userdata('user_id'); ?>">


                    
                    <div class="mb-4">
                        <label for="client_id" class="form-label">Kategori ATK</label>
                        <div class="input-group">
                            <span class="input-group-text"><i class="fas fa-building"></i></span>
                            <select class="form-control" id="atk_product_categories" name="atk_product_categories" >
                                <option value="">-- Pilih Kategori --</option>
                                <?php foreach ($kategori as $inventory): ?>
                                    <option value="<?= $inventory->atk_categories_id; ?>" <?= set_select('atk_categories_id ', $inventory->atk_categories_id); ?>>
                                        <?= $inventory->atk_categories_nama; ?>
                                    </option>
                                <?php endforeach; ?>
                            </select>
                        </div>
                    </div>


                    <div class="mb-4">
                        <label for="atk_product_nama" class="form-label">Nama ATK</label>
                        <div class="input-group">
                            <span class="input-group-text"><i class="fas fa-building"></i></span>
                            <input type="text" class="form-control" id="atk_product_nama" name="atk_product_nama" placeholder="Masukkan nama ATK" value="<?= set_value('atk_product_nama') ?>" >
                        </div>
                    </div>


                    <div class="mb-4">
                        <label for="client_id" class="form-label">Brand ATK</label>
                        <div class="input-group">
                            <span class="input-group-text"><i class="fas fa-building"></i></span>
                            <select class="form-control" id="atk_product_brand" name="atk_product_brand" >
                                <option value="">-- Pilih Brand --</option>
                                <?php foreach ($brand as $inventory): ?>
                                    <option value="<?= $inventory->brand_categories_id ; ?>" <?= set_select('brand_categories_id  ', $inventory->brand_categories_id ); ?>>
                                        <?= $inventory->brand_categories_nama; ?>
                                    </option>
                                <?php endforeach; ?>
                            </select>
                        </div>
                    </div>

                    <div class="mb-4">
                        <label for="atk_product_stok" class="form-label">Stok</label>
                        <div class="input-group">
                            <span class="input-group-text"><i class="fas fa-building"></i></span>
                            <input type="text" class="form-control" id="atk_product_stok" name="atk_product_stok" placeholder="Masukkan Stok" value="<?= set_value('atk_product_stok') ?>" >
                        </div>
                    </div>


                    <div class="mb-4">
                        <label for="client_id" class="form-label">Satuan</label>
                        <div class="input-group">
                            <span class="input-group-text"><i class="fas fa-building"></i></span>
                            <select class="form-control" id="atk_product_uom" name="atk_product_uom" >
                                <option value="">-- Pilih Satuan --</option>
                                <?php foreach ($uom as $inventory): ?>
                                    <option value="<?= $inventory->uom_categories_id  ; ?>" <?= set_select('uom_categories_id   ', $inventory->uom_categories_id  ); ?>>
                                        <?= $inventory->uom_categories_nama ; ?>
                                    </option>
                                <?php endforeach; ?>
                            </select>
                        </div>
                    </div>


                    <div class="mb-4">
                        <label for="atk_product_location" class="form-label">Lokasi ATK</label>
                        <div class="input-group">
                            <span class="input-group-text"><i class="fas fa-building"></i></span>
                            <select class="form-control" id="atk_product_location" name="atk_product_location" >
                                <option value="">-- Pilih Satuan --</option>
                                <?php foreach ($location as $inventory): ?>
                                    <option value="<?= $inventory->inventory_location_id   ; ?>" <?= set_select('inventory_location_id    ', $inventory->inventory_location_id   ); ?>>
                                        <?= $inventory->inventory_location_nama  ; ?>
                                    </option>
                                <?php endforeach; ?>
                            </select>
                        </div>
                    </div>



                    <div class="mb-4">
                        <label for="atk_product_notes" class="form-label">Notes</label>
                        <div class="input-group">
                            <span class="input-group-text"><i class="fas fa-building"></i></span>
                            <input type="text" class="form-control" id="atk_product_notes" name="atk_product_notes" placeholder="Masukkan Notes" value="<?= set_value('atk_product_notes') ?>" >
                        </div>
                    </div>

                    
                   

                    <!-- Modal Footer with styled buttons -->
                    <div class="modal-footer">
                        <button type="button" class="btn btn-secondary" data-bs-dismiss="modal"><i class="fas fa-times"></i> Close</button>
                        <button type="submit" class="btn btn-primary"><i class="fas fa-save"></i> Save</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
