<?php
    $layout = auth()->user()->role === 'super_admin' ? 'layouts.admin' : 'component2.layouts.app';
?>



<?php $__env->startSection('title', 'Add WEOF Beneficiary'); ?>

<?php $__env->startSection('content'); ?>
<div class="container-fluid px-4 py-3">
    <!-- Header -->
    <div class="dashboard-header">
        <div class="container-fluid">
            <div class="row align-items-center dashboard-header-content">
                <div class="col-lg-6">
                    <h1 class="dashboard-title">
                        <i class="fas fa-tachometer-alt" style="color: var(--dhis2-blue-primary);"></i>
                        Add New WEOF Beneficiary
                    </h1>
                    <nav aria-label="breadcrumb">
                        <ol class="breadcrumb">
                            <li class="breadcrumb-item"><a href="<?php echo e(route('component2.dashboard')); ?>">Component 1 Dashboard</a></li>
                            <li class="breadcrumb-item active">WEOF Beneficiary</li>
                        </ol>
                    </nav>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="container py-4">
    <div class="row justify-content-center">
        <div class="col-lg-10">
            <h3 class="text-success mb-4 text-center fw-bold">
                Register New WEOF Beneficiary
                <?php if($selectedGroup): ?>
                    <small class="text-muted d-block mt-1">from <?php echo e(\App\Models\C1Group::find($selectedGroup)->name); ?></small>
                <?php endif; ?>
            </h3>

            <div class="card border-secondary border-2 shadow-lg rounded-3">
                <div class="card-body p-4 p-md-5">
                    <form action="<?php echo e(route('component2.store')); ?>" method="POST">
                        <?php echo csrf_field(); ?>

                        <h5 class="mb-3 text-primary border-bottom border-secondary pb-2"><i class="fas fa-user-circle me-2"></i> 1. Basic Information</h5>
                        <div class="row g-4 mb-4">
                            <div class="col-md-3">
                                <label class="form-label fw-bold">WEOF ID <span class="text-danger">*</span></label>
                                <input type="text" name="woef_id" class="form-control <?php $__errorArgs = ['woef_id'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>"
                                       value="<?php echo e(old('woef_id')); ?>" required maxlength="50">
                                <?php $__errorArgs = ['woef_id'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <div class="invalid-feedback"><?php echo e($message); ?></div> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                            </div>
                            <div class="col-md-5">
                                <label class="form-label fw-bold">Full Name <span class="text-danger">*</span></label>
                                <input type="text" name="name" class="form-control <?php $__errorArgs = ['name'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>"
                                       value="<?php echo e(old('name')); ?>" required>
                                <?php $__errorArgs = ['name'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <div class="invalid-feedback"><?php echo e($message); ?></div> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                            </div>
                            <div class="col-md-2">
                                <label class="form-label fw-bold">Age <span class="text-danger">*</span></label>
                                <input type="number" name="age" class="form-control <?php $__errorArgs = ['age'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>"
                                       value="<?php echo e(old('age')); ?>" min="18" max="100" required>
                                <?php $__errorArgs = ['age'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <div class="invalid-feedback"><?php echo e($message); ?></div> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                            </div>
                            <div class="col-md-2">
                                <label class="form-label fw-bold">Phone</label>
                                <input type="text" name="phone_no" class="form-control" value="<?php echo e(old('phone_no')); ?>" maxlength="20">
                            </div>

                            <div class="col-md-4">
                                <label class="form-label fw-bold">Marital Status <span class="text-danger">*</span></label>
                                <select name="marital_status" class="form-select <?php $__errorArgs = ['marital_status'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" required>
                                    <option value="">-- Select --</option>
                                    <option value="married" <?php echo e(old('marital_status') == 'married' ? 'selected' : ''); ?>>Married</option>
                                    <option value="not_married" <?php echo e(old('marital_status') == 'not_married' ? 'selected' : ''); ?>>Not Married</option>
                                    <option value="divorced" <?php echo e(old('marital_status') == 'divorced' ? 'selected' : ''); ?>>Divorced</option>
                                    <option value="widowed" <?php echo e(old('marital_status') == 'widowed' ? 'selected' : ''); ?>>Widowed</option>
                                </select>
                                <?php $__errorArgs = ['marital_status'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <div class="invalid-feedback"><?php echo e($message); ?></div> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                            </div>
                            <div class="col-md-4">
                                <label class="form-label fw-bold">Resident Status <span class="text-danger">*</span></label>
                                <select name="resident_status" class="form-select <?php $__errorArgs = ['resident_status'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" required>
                                    <option value="">-- Select --</option>
                                    <option value="resident" <?php echo e(old('resident_status') == 'resident' ? 'selected' : ''); ?>>Resident</option>
                                    <option value="returnee" <?php echo e(old('resident_status') == 'returnee' ? 'selected' : ''); ?>>Returnee</option>
                                    <option value="idp" <?php echo e(old('resident_status') == 'idp' ? 'selected' : ''); ?>>IDP</option>
                                </select>
                                <?php $__errorArgs = ['resident_status'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <div class="invalid-feedback"><?php echo e($message); ?></div> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                            </div>
                            <div class="col-md-4">
                                <label class="form-label fw-bold">Education <span class="text-danger">*</span></label>
                                <select name="education" class="form-select <?php $__errorArgs = ['education'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" required>
                                    <option value="">-- Select --</option>
                                    <option value="none" <?php echo e(old('education') == 'none' ? 'selected' : ''); ?>>None</option>
                                    <option value="primary" <?php echo e(old('education') == 'primary' ? 'selected' : ''); ?>>Primary</option>
                                    <option value="secondary" <?php echo e(old('education') == 'secondary' ? 'selected' : ''); ?>>Secondary</option>
                                    <option value="tertiary" <?php echo e(old('education') == 'tertiary' ? 'selected' : ''); ?>>Tertiary</option>
                                    <option value="vocational" <?php echo e(old('education') == 'vocational' ? 'selected' : ''); ?>>Vocational</option>
                                </select>
                                <?php $__errorArgs = ['education'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <div class="invalid-feedback"><?php echo e($message); ?></div> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                            </div>
                            
                            <div class="col-md-4">
                                <label class="form-label fw-bold">County <span class="text-danger">*</span></label>
                                <input type="text" name="county" class="form-control <?php $__errorArgs = ['county'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>"
                                       value="<?php echo e(old('county')); ?>" required>
                                <?php $__errorArgs = ['county'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <div class="invalid-feedback"><?php echo e($message); ?></div> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                            </div>
                            <div class="col-md-4">
                                <label class="form-label fw-bold">Payam <span class="text-danger">*</span></label>
                                <input type="text" name="payam" class="form-control <?php $__errorArgs = ['payam'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>"
                                       value="<?php echo e(old('payam')); ?>" required>
                                <?php $__errorArgs = ['payam'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <div class="invalid-feedback"><?php echo e($message); ?></div> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                            </div>
                            <div class="col-md-4">
                                <label class="form-label fw-bold">Group (Optional)</label>
                                <select name="group_id" class="form-select">
                                    <option value="">-- No Group --</option>
                                    <?php $__currentLoopData = $groups; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $id => $name): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <option value="<?php echo e($id); ?>" <?php echo e(old('group_id', $selectedGroup) == $id ? 'selected' : ''); ?>>
                                            <?php echo e($name); ?>

                                        </option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </select>
                            </div>
                        </div>

                        <h5 class="mb-3 mt-4 text-primary border-bottom border-secondary pb-2"><i class="fas fa-briefcase me-2"></i> 2. Business Details</h5>
                        <div class="row g-4 mb-4">
                            <div class="col-md-6">
                                <label class="form-label fw-bold">Business Name <span class="text-danger">*</span></label>
                                <input type="text" name="business_name" class="form-control <?php $__errorArgs = ['business_name'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>"
                                       value="<?php echo e(old('business_name')); ?>" required>
                                <?php $__errorArgs = ['business_name'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <div class="invalid-feedback"><?php echo e($message); ?></div> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                            </div>
                            <div class="col-md-3">
                                <label class="form-label fw-bold">Category <span class="text-danger">*</span></label>
                                <input type="text" name="business_category" class="form-control <?php $__errorArgs = ['business_category'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>"
                                       value="<?php echo e(old('business_category')); ?>" required>
                                <?php $__errorArgs = ['business_category'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <div class="invalid-feedback"><?php echo e($message); ?></div> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                            </div>
                            <div class="col-md-3">
                                <label class="form-label fw-bold">Type <span class="text-danger">*</span></label>
                                <select name="business_type" class="form-select <?php $__errorArgs = ['business_type'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" required>
                                    <option value="">-- Select --</option>
                                    <option value="existing" <?php echo e(old('business_type') == 'existing' ? 'selected' : ''); ?>>Existing</option>
                                    <option value="new" <?php echo e(old('business_type') == 'new' ? 'selected' : ''); ?>>New</option>
                                </select>
                                <?php $__errorArgs = ['business_type'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <div class="invalid-feedback"><?php echo e($message); ?></div> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                            </div>

                            <div class="col-md-3">
                                <label class="form-label fw-bold">Establishment Year <span class="text-danger">*</span></label>
                                <input type="number" name="establishment_year" class="form-control <?php $__errorArgs = ['establishment_year'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>"
                                       value="<?php echo e(old('establishment_year')); ?>" min="1900" max="<?php echo e(date('Y')); ?>" required>
                                <?php $__errorArgs = ['establishment_year'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <div class="invalid-feedback"><?php echo e($message); ?></div> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                            </div>
                            <div class="col-md-3">
                                <label class="form-label fw-bold">Registered?</label>
                                <div class="form-check form-switch mt-2">
                                    <input class="form-check-input" type="checkbox" name="registration_status" value="1"
                                           id="reg_status" <?php echo e(old('registration_status') ? 'checked' : ''); ?>>
                                    <label class="form-check-label" for="reg_status">Yes</label>
                                </div>
                            </div>
                            <div class="col-md-6">
                                <label class="form-label fw-bold">Target Customers <span class="text-danger">*</span></label>
                                <input type="text" name="target_customers" class="form-control <?php $__errorArgs = ['target_customers'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>"
                                       value="<?php echo e(old('target_customers')); ?>" required>
                                <?php $__errorArgs = ['target_customers'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <div class="invalid-feedback"><?php echo e($message); ?></div> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                            </div>
                            
                            <div class="col-md-4">
                                <label class="form-label fw-bold">Monthly Revenue (SSP) <span class="text-danger">*</span></label>
                                <input type="number" step="0.01" name="monthly_revenue" class="form-control <?php $__errorArgs = ['monthly_revenue'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>"
                                       value="<?php echo e(old('monthly_revenue')); ?>" min="0" required>
                                <?php $__errorArgs = ['monthly_revenue'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <div class="invalid-feedback"><?php echo e($message); ?></div> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                            </div>
                        </div>

                        <h5 class="mb-3 mt-4 text-primary border-bottom border-secondary pb-2"><i class="fas fa-hand-holding-usd me-2"></i> 3. Financing Sources (select all)</h5>
                        <div class="row g-4 mb-4">
                            <?php $__currentLoopData = ['equity', 'loan', 'debt', 'grant']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $source): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <div class="col-md-3">
                                    <div class="form-check pt-2">
                                        <input class="form-check-input" type="checkbox" name="financing_sources[]"
                                               value="<?php echo e($source); ?>" id="fin_<?php echo e($source); ?>"
                                               <?php echo e(in_array($source, old('financing_sources', [])) ? 'checked' : ''); ?>>
                                        <label class="form-check-label text-capitalize fw-bold" for="fin_<?php echo e($source); ?>"><?php echo e(ucfirst($source)); ?></label>
                                    </div>
                                </div>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            <?php $__errorArgs = ['financing_sources'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <div class="text-danger small mt-1"><?php echo e($message); ?></div> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                        </div>

                        <h5 class="mb-3 mt-4 text-primary border-bottom border-secondary pb-2"><i class="fas fa-users me-2"></i> 4. Employment</h5>
                        <div class="row g-4 mb-4">
                            <div class="col-md-6">
                                <label class="form-label fw-bold">Employees Before Program</label>
                                <div class="row g-2">
                                    <div class="col-6">
                                        <input type="number" name="employees_before_male" class="form-control" placeholder="Male" min="0"
                                               value="<?php echo e(old('employees_before_male')); ?>" required>
                                    </div>
                                    <div class="col-6">
                                        <input type="number" name="employees_before_female" class="form-control" placeholder="Female" min="0"
                                               value="<?php echo e(old('employees_before_female')); ?>" required>
                                    </div>
                                </div>
                            </div>
                            <div class="col-md-6">
                                <label class="form-label fw-bold">Employees Now</label>
                                <div class="row g-2">
                                    <div class="col-6">
                                        <input type="number" name="employees_now_male" class="form-control" placeholder="Male" min="0"
                                               value="<?php echo e(old('employees_now_male')); ?>" required>
                                    </div>
                                    <div class="col-6">
                                        <input type="number" name="employees_now_female" class="form-control" placeholder="Female" min="0"
                                               value="<?php echo e(old('employees_now_female')); ?>" required>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <h5 class="mb-3 mt-4 text-primary border-bottom border-secondary pb-2"><i class="fas fa-graduation-cap me-2"></i> 5. Training & Participation</h5>
                        <div class="row g-4 mb-4 align-items-end">
                            <div class="col-md-3">
                                <label class="form-label fw-bold">Received Training?</label>
                                <div class="form-check form-switch mt-2">
                                    <input class="form-check-input" type="checkbox" name="received_training" value="1"
                                           id="received_training" <?php echo e(old('received_training') ? 'checked' : ''); ?>>
                                    <label class="form-check-label" for="received_training">Yes</label>
                                </div>
                            </div>
                            <div class="col-md-6" id="training_types" style="display: <?php echo e(old('received_training') ? 'block' : 'none'); ?>">
                                <label class="form-label fw-bold">Training Types (select all)</label>
                                <div class="row g-2">
                                    <?php $__currentLoopData = ['functional_literacy', 'vsla_ops', 'business_dev', 'digital_literacy', 'specialized']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $type): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <div class="col-md-6">
                                            <div class="form-check">
                                                <input class="form-check-input" type="checkbox" name="training_type[]"
                                                       value="<?php echo e($type); ?>" id="train_<?php echo e($type); ?>"
                                                       <?php echo e(in_array($type, old('training_type', [])) ? 'checked' : ''); ?>>
                                                <label class="form-check-label small" for="train_<?php echo e($type); ?>">
                                                    <?php echo e(ucwords(str_replace('_', ' ', $type))); ?>

                                                </label>
                                            </div>
                                        </div>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </div>
                                <?php $__errorArgs = ['training_type'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <div class="text-danger small mt-1"><?php echo e($message); ?></div> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                            </div>

                            <div class="col-md-3">
                                <label class="form-label fw-bold">Participation <span class="text-danger">*</span></label>
                                <select name="participation" class="form-select <?php $__errorArgs = ['participation'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" required>
                                    <option value="">-- Select --</option>
                                    <option value="successful" <?php echo e(old('participation') == 'successful' ? 'selected' : ''); ?>>Successful</option>
                                    <option value="0.5" <?php echo e(old('participation') == '0.5' ? 'selected' : ''); ?>>50% Alignment</option>
                                    <option value="0.8" <?php echo e(old('participation') == '0.8' ? 'selected' : ''); ?>>80% Alignment</option>
                                    <option value="1_completed" <?php echo e(old('participation') == '1_completed' ? 'selected' : ''); ?>>Fully Completed</option>
                                </select>
                                <?php $__errorArgs = ['participation'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <div class="invalid-feedback"><?php echo e($message); ?></div> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                            </div>
                        </div>

                        <h5 class="mb-3 mt-4 text-primary border-bottom border-secondary pb-2"><i class="fas fa-rocket me-2"></i> 6. Accelerator & Grants</h5>
                        <div class="row g-4 mb-4">
                            <div class="col-md-3">
                                <label class="form-label fw-bold">Accelerator Participation?</label>
                                <div class="form-check form-switch mt-2">
                                    <input class="form-check-input" type="checkbox" name="accelerator_participation" value="1"
                                           id="accel_part" <?php echo e(old('accelerator_participation') ? 'checked' : ''); ?>>
                                    <label class="form-check-label" for="accel_part">Yes</label>
                                </div>
                            </div>
                            <div class="col-md-3" id="accel_grad" style="display: <?php echo e(old('accelerator_participation') ? 'block' : 'none'); ?>">
                                <label class="form-label fw-bold">Graduated?</label>
                                <div class="form-check form-switch mt-2">
                                    <input class="form-check-input" type="checkbox" name="accelerator_graduation" value="1"
                                           id="accel_graduated" <?php echo e(old('accelerator_graduation') ? 'checked' : ''); ?>>
                                    <label class="form-check-label" for="accel_graduated">Yes</label>
                                </div>
                            </div>
                            <div class="col-md-3">
                                <label class="form-label fw-bold">Onsite Validation?</label>
                                <div class="form-check form-switch mt-2">
                                    <input class="form-check-input" type="checkbox" name="onsite_validation" value="1"
                                           id="onsite" <?php echo e(old('onsite_validation') ? 'checked' : ''); ?>>
                                    <label class="form-check-label" for="onsite">Yes</label>
                                </div>
                            </div>
                            <div class="col-md-3">
                                <label class="form-label fw-bold">WEOF Connect?</label>
                                <div class="form-check form-switch mt-2">
                                    <input class="form-check-input" type="checkbox" name="participation_woef_connect" value="1"
                                           id="woef_connect" <?php echo e(old('participation_woef_connect') ? 'checked' : ''); ?>>
                                    <label class="form-check-label" for="woef_connect">Yes</label>
                                </div>
                            </div>

                            <div class="col-md-3">
                                <label class="form-label fw-bold">1st Tranche (SSP)</label>
                                <input type="number" step="0.01" name="grant_1st_tranche" class="form-control"
                                       value="<?php echo e(old('grant_1st_tranche')); ?>" min="0">
                            </div>
                            <div class="col-md-3">
                                <label class="form-label fw-bold">2nd Tranche (SSP)</label>
                                <input type="number" step="0.01" name="grant_2nd_tranche" class="form-control"
                                       value="<?php echo e(old('grant_2nd_tranche')); ?>" min="0">
                            </div>
                        </div>

                        <div class="mt-4 pt-3 border-top border-secondary text-end">
                            <a href="<?php echo e(route('component1.weof.index')); ?>" class="btn btn-outline-secondary me-2"><i class="fas fa-times me-1"></i> Cancel</a>
                            <button type="submit" class="btn btn-success px-4"><i class="fas fa-save me-1"></i> Save Beneficiary</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

<?php $__env->startPush('scripts'); ?>
<script>
    // Toggle training types
    document.getElementById('received_training').addEventListener('change', function () {
        document.getElementById('training_types').style.display = this.checked ? 'block' : 'none';
    });

    // Toggle graduation
    document.getElementById('accel_part').addEventListener('change', function () {
        document.getElementById('accel_grad').style.display = this.checked ? 'block' : 'none';
    });
</script>
<?php $__env->stopPush(); ?>
<?php $__env->stopSection(); ?>
<?php echo $__env->make($layout, array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /home/kulzweru/sswseepdatabase.blockchaintech.co.ke/resources/views/component2/create.blade.php ENDPATH**/ ?>