<?php $__env->startSection('title', 'Print Challans'); ?>
<?php $__env->startSection('page_title', 'Print Challans (Class / Section)'); ?>
<?php $__env->startSection('breadcrumbs'); ?>
    <li class="breadcrumb-item"><a href="<?php echo e(route('challans.index')); ?>">Challans</a></li>
    <li class="breadcrumb-item active">Print</li>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
    <div class="card"><div class="card-body">
        <p class="text-muted small">Select a class to print <b>all its challans</b>. Choose a section to limit it to that section, and optionally a month/status.</p>
        <form method="GET" action="<?php echo e(route('challans.print-bulk')); ?>" target="_blank" class="row g-3">
            <div class="col-md-3">
                <label class="form-label">Class <span class="text-danger">*</span></label>
                <select name="class_id" id="pc_class" class="form-select" required>
                    <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 echo e($c->name); ?></option><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </select>
            </div>
            <div class="col-md-3">
                <label class="form-label">Section</label>
                <select name="section_id" id="pc_section" class="form-select">
                    <option value="">All sections</option>
                </select>
            </div>
            <div class="col-md-3">
                <label class="form-label">Billing Month</label>
                <input type="month" name="month" class="form-control">
                <div class="form-text">Leave blank for all months.</div>
            </div>
            <div class="col-md-3">
                <label class="form-label">Status</label>
                <select name="status" class="form-select">
                    <option value="all">All</option>
                    <option value="unpaid">Unpaid</option>
                    <option value="partial">Partial</option>
                    <option value="paid">Paid</option>
                </select>
            </div>
            <div class="col-12">
                <button class="btn btn-primary"><i class="bi bi-printer me-1"></i>Open & Print Challans</button>
                <a href="<?php echo e(route('challans.index')); ?>" class="btn btn-light border">Cancel</a>
            </div>
        </form>
    </div></div>

    <?php $__env->startPush('scripts'); ?>
    <script>
        const PC_SECTIONS = <?php echo json_encode($sections, 15, 512) ?>;
        function pcLoad() {
            const c = document.getElementById('pc_class').value;
            const sel = document.getElementById('pc_section');
            sel.innerHTML = '<option value="">All sections</option>';
            PC_SECTIONS.filter(s => String(s.class_id) === String(c)).forEach(s => {
                const o = document.createElement('option'); o.value = s.id; o.textContent = s.name; sel.appendChild(o);
            });
        }
        document.getElementById('pc_class').addEventListener('change', pcLoad);
    </script>
    <?php $__env->stopPush(); ?>
<?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/challans/print-challans.blade.php ENDPATH**/ ?>