
<div class="row">
    <div class="col-md-12">
        <div class="table-responsive">
        <table class="table table-sm text-center text-sm">
            <caption class="text-center">Search Result</caption>
            <tr>
                <th>SL</th>
                <th>Name</th>
                <th>Mobile</th>
                <th>Batch</th>
                <th>Month(<?php echo e($year); ?>)</th>
                <th>Total Paid</th>
                <th>Total Due</th>
                <th>&nbsp;</th>
            </tr>
            <?php if($students->isEmpty()): ?>
            <tr class="text-center">
                <td colspan="8">No Data Found!</td>
            </tr>
            <?php endif; ?>
            <?php if($students->isNotEmpty()): ?>
            <?php $__currentLoopData = $students; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key_ => $student): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            
            <tr>
                <td><?php echo e($key_+1); ?></td>
                <td><?php echo e($student->student_name); ?></td>
                <?php if($student->student_contact): ?> 
                <td><?php echo e($student->student_contact); ?> (Std.)</td>
                <?php else: ?> 
                <td><?php echo e($student->guardian_contact); ?> (Grd.)</td>
                <?php endif; ?>
                <td><?php echo e($student->batch->batch_name); ?></td>
                
                <?php if($student->batch->batch_type == 1): ?>
                <?php
                    $arr = explode("-", $student->batch->batch_start);
                    if($year == $arr[0])
                        $month_start = ($arr[1] - 1) * 1;
                    else 
                        $month_start = null;                    
                ?>
                <td style="width: 450px !important;">
                    <div class="d-flex flex-wrap" style="width: 450px !important;" >
                    <?php $__currentLoopData = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $month): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>

                        <?php if(!is_null($month) && $month_start > $key): ?>
                        <div style="width:75px;" class="custom-control custom-checkbox">
                            <input type="checkbox" name="month[]" value="<?php echo e($key); ?>" disabled class="custom-control-input" />
                            <label for="someCheckboxId" class="custom-control-label text-muted"><del><?php echo e($month); ?></del></label>
                        </div>                            
                        <?php else: ?> 
                            <?php if(in_array($key, $student->get_payment_month($year))): ?>
                                <?php if($student->is_paid_this_month($year, $key)): ?>
                                    
                                    <div style="width:75px;" class="custom-control custom-checkbox">
                                        <input type="checkbox" name="month[]" value="<?php echo e($key); ?>" class="custom-control-input" disabled checked id="<?php echo e($month); ?>" />
                                        <label for="<?php echo e($month); ?>_<?php echo e($key_); ?>" class="custom-control-label text-info"><?php echo e($month); ?></label>
                                    </div>
                                <?php else: ?>
                                    
                                    <div style="width:75px;" class="custom-control custom-checkbox">
                                        <input type="checkbox" name="month[]" value="<?php echo e($key); ?>" class="custom-control-input custom-control-input-danger" checked id="<?php echo e($month); ?>_<?php echo e($key_); ?>" />
                                        <label for="<?php echo e($month); ?>_<?php echo e($key_); ?>" class="custom-control-label"><?php echo e($month); ?></label>
                                    </div>
                                <?php endif; ?>
                            <?php else: ?> 
                                <div style="width:75px;" class="custom-control custom-checkbox">
                                    <input type="checkbox" name="month[]" value="<?php echo e($key); ?>" class="custom-control-input" id="<?php echo e($month); ?>_<?php echo e($key_); ?>" />
                                    <label for="<?php echo e($month); ?>_<?php echo e($key_); ?>" class="custom-control-label" ><?php echo e($month); ?></label>
                                </div>
                            <?php endif; ?>
                        <?php endif; ?>

                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </div>
                </td>
                <td>
                    <?php echo e($student->get_total_paid_amount_by_year($year)); ?>

                </td>
                <td>
                    N/A
                </td>
                <?php else: ?> 
                <td>N/A</td>
                <td>
                    <?php echo e($student->get_total_paid_amount_by_year($year)); ?>

                </td>
                <td>
                    <?php echo e($student->get_due_amount($year) ?? ($student->batch->batch_fee ?? 0)); ?>

                </td>                
                <?php endif; ?>
                <td id="action-<?php echo e($student->id); ?>">
                    <a href="javascript:void(0)" class="student_list btn btn-xs btn-dark" data-year="<?php echo e($year); ?>" data-id="<?php echo e($student->id); ?>">
                        Pay Now
                    </a>
                </td>
            </tr>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            <?php endif; ?>
            
        </table>
        </div>
    </div>
</div>
<?php /**PATH /home/spanmmdr/smartqb.info/resources/views/pages/payments/search_list.blade.php ENDPATH**/ ?>