<?php $__env->startSection('content'); ?>
<div class="row">
    <div class="col-12 col-md-8 offset-md-2">
        <div class="card mb-4">
            <h5 class="card-header"><?php echo e($location->exists ? 'Edit Lokasi / Ruangan' : 'Tambah Lokasi / Ruangan Baru'); ?></h5>
            <div class="card-body">
                <form method="POST" action="<?php echo e($action); ?>" class="row g-3">
                    <?php echo csrf_field(); ?>
                    <?php if($method !== 'POST'): ?>
                        <?php echo method_field($method); ?>
                    <?php endif; ?>

                    <div class="col-12">
                        <label class="form-label">Nama Lokasi / Ruangan <span class="text-danger">*</span></label>
                        <input type="text" name="name" class="form-control" value="<?php echo e(old('name', $location->name)); ?>" required placeholder="Contoh: Ruang Kelas 1A, Gudang Utama, Asrama Putra">
                    </div>

                    <div class="col-12">
                        <label class="form-label">Deskripsi</label>
                        <textarea name="description" class="form-control" rows="3" placeholder="Keterangan opsional tentang lokasi ini"><?php echo e(old('description', $location->description)); ?></textarea>
                    </div>

                    <div class="col-12 mt-4">
                        <div class="form-check">
                            <input type="checkbox" name="is_active" class="form-check-input" id="is_active" value="1" <?php if(old('is_active', $location->is_active ?? true)): echo 'checked'; endif; ?>>
                            <label class="form-check-label" for="is_active">Lokasi aktif dan bisa digunakan</label>
                        </div>
                    </div>

                    <div class="col-12 text-end mt-4">
                        <a href="<?php echo e(route('locations.index')); ?>" class="btn btn-label-secondary me-2">Batal</a>
                        <button type="submit" class="btn btn-primary">Simpan Lokasi</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', ['title' => 'Form Lokasi', 'heading' => $location->exists ? 'Edit Lokasi' : 'Tambah Lokasi'], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH G:\Project\inventaris-pondok\resources\views/locations/form.blade.php ENDPATH**/ ?>