<?php $__env->startSection('title', 'Fee Structure'); ?>
<?php $__env->startSection('page_title', 'Fee Structure'); ?>
<?php $__env->startSection('breadcrumbs'); ?>
    <li class="breadcrumb-item"><a href="<?php echo e(route('dashboard')); ?>">Home</a></li><li class="breadcrumb-item active">Fee Structure</li>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
    <div class="card mb-3"><div class="card-body">
        <form method="GET" class="row g-2 align-items-end">
            <div class="col-md-4"><label class="form-label small">Session</label>
                <select name="session_id" class="form-select form-select-sm">
                    <?php $__currentLoopData = $sessions; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $s): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><option value="<?php echo e($s->id); ?>" <?php if($sessionId==$s->id): echo 'selected'; endif; ?>><?php echo e($s->name); ?></option><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </select></div>
            <div class="col-md-4"><label class="form-label small">Class</label>
                <select name="class_id" class="form-select form-select-sm">
                    <option value="">— Select class —</option>
                    <?php $__currentLoopData = $classes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $c): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><option value="<?php echo e($c->id); ?>" <?php if($classId==$c->id): echo 'selected'; endif; ?>><?php echo e($c->name); ?></option><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </select></div>
            <div class="col-md-4"><button class="btn btn-sm btn-primary"><i class="bi bi-search me-1"></i>Load</button></div>
        </form>
    </div></div>

    <?php if($classId): ?>
        <form method="POST" action="<?php echo e(route('fee-structure.store')); ?>">
            <?php echo csrf_field(); ?>
            <input type="hidden" name="session_id" value="<?php echo e($sessionId); ?>">
            <input type="hidden" name="class_id" value="<?php echo e($classId); ?>">
            <div class="card">
                <div class="card-header"><i class="bi bi-table me-1"></i>Amounts for selected class</div>
                <div class="card-body">
                    <table class="table align-middle">
                        <thead><tr><th>Fee Head</th><th>Frequency</th><th style="width:200px">Amount (Rs)</th></tr></thead>
                        <tbody>
                            <?php $__currentLoopData = $feeTypes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $type): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <tr>
                                    <td class="fw-semibold"><?php echo e($type->name); ?></td>
                                    <td><span class="badge bg-soft-info text-capitalize"><?php echo e(str_replace('_',' ',$type->frequency)); ?></span></td>
                                    <td><input type="number" step="0.01" name="amounts[<?php echo e($type->id); ?>]" value="<?php echo e($amounts[$type->id] ?? $type->default_amount); ?>" class="form-control form-control-sm"></td>
                                </tr>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </tbody>
                    </table>
                </div>
                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('fees.update')): ?><div class="card-footer text-end"><button class="btn btn-primary"><i class="bi bi-save me-1"></i>Save Structure</button></div><?php endif; ?>
            </div>
        </form>
    <?php else: ?>
        <div class="card"><div class="card-body text-center text-muted py-4">Select a session and class to edit the fee structure.</div></div>
    <?php endif; ?>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /home/u385418287/domains/itartificer.com/public_html/sms-erp/resources/views/fees/structure/index.blade.php ENDPATH**/ ?>