

<?php $__env->startSection('content'); ?>
    <div class="row">
        <div class="col-lg-12">
            <div class="card card-fullheight">
                <div class="card-header">
                    <h5 class="box-title"><?php echo e(isset($Value) ? 'Edit Value' : 'Add Value'); ?></h5>
                </div>

                <div class="card-body">
                    <?php echo $__env->make('components.alert', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

                    <form action="<?php echo e(isset($Value) ? route('values.update', $Value->id) : route('values.store')); ?>"
                        method="POST" enctype="multipart/form-data">

                        <?php echo csrf_field(); ?>
                        <?php if(isset($Value)): ?>
                            <?php echo method_field('PUT'); ?>
                        <?php endif; ?>

                        <input name="type" value="4" hidden>

                        
                        <div class="mb-3">
                            <label for="name" class="form-label">Name <span class="text-danger">*</span></label>
                            <input type="text" name="name" id="name" class="form-control"
                                value="<?php echo e(old('name', $Value->name ?? '')); ?>" required>
                        </div>

                        
                        <div class="mb-3">
                            <label for="desc" class="form-label">Description</label>
                            <textarea name="description" id="desc" class="form-control" rows="4"><?php echo e(old('description', $Value->description ?? '')); ?></textarea>
                        </div>



                        
                        <div class="mb-3">
                            <label for="image" class="form-label">Image</label>
                            <input type="file" name="image" id="image" class="form-control" accept="image/*">
                            <?php if(isset($Value) && $Value->image): ?>
                                <div class="mt-2">
                                    <img src="<?php echo e(asset($Value->image)); ?>" alt="Current Image" width="120">
                                </div>
                            <?php endif; ?>
                        </div>

                        
                        <div class="mt-4">
                            <button type="submit" class="btn btn-success">
                                <?php echo e(isset($Value) ? 'Update' : 'Save'); ?>

                            </button>
                            <a href="<?php echo e(route('values.index')); ?>" class="btn btn-secondary">Cancel</a>
                        </div>

                    </form>
                </div>
            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('admin.masterAdmin', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\TGP-hospital-site\resources\views/admin/commitments/valueform.blade.php ENDPATH**/ ?>