<?php $__env->startSection('main-content'); ?>
    <main>
        <div class="container-fluid">
            <h2 class="mt-5 mb-4">PSPL Report List</h2>

            <div class="row">
            <div class="col-md-12">
            <div class="card card-primary">
                        <div class="card-header">
                            <h6 class="card-title"></h6>
                        </div>
                        <form action="<?php echo e(url('/operator/report/pspl-report')); ?>" method="get">
                        <div class="card-body" id="demo">
                            <div class="col-md-2">
                                <div class="form-group">
                                    <label for="">From Date</label>
                                    <input type="date" class="form-control" name="from_date" id="from_date" value="<?php echo e(Request::get('from_date')); ?>">
                                </div>
                            </div>
                            <div class="col-md-2">
                                <div class="form-group">
                                    <label for="">To Date</label>
                                    <input type="date" class="form-control" name="to_date" id="to_date" value="<?php echo e(Request::get('to_date')); ?>">
                                </div>
                            </div>

                            <div class="col-md-2">
                                <input type="submit" class="btn btn-primary" value="Filter" style="margin-top: 25px;">
                            </div>
                        </div>
                        </form>
                </div>
            </div>
            <div class="col-md-12"></div>
                <div class="col-md-12">
                    <div class="card card-primary">
                        <div class="card-header">
                            <h6 class="card-title"></h6>
                             <?php if(DB::table('model_has_permissions_operators')->where([['operator_code',Session::get('operatorsession')->Operator_Code ],['model_id','85']])->first()): ?>
               
                            <a onclick="downloadExcel()" class="btn btn-primary" ><i class="fa fa-download"></i> PSPL Report</a>
                            <?php endif; ?>
                           

                        </div>
                        <div class="card-body" id="demo">
                            <div class="table-responsive">
                                <table class="table table-bordered table-striped" width="100%" cellspacing="0">
                                    <thead>
                                        <tr>
                                            <th width="5%">S.No.</th>
                                            <th width="8%">Branch Code</th>
                                            <th width="12%">Date of Enrolment</th>
                                            <th width="20%">Station_ID</th>
                                            <th width="10%">Operator_ID</th>
                                            <th width="10%">Operator Name</th>
                                            <th width="10%">District</th>
                                            <th>State	</th>
                                            <th>Pincode	</th>
                                            <th>Total No of Enrollment</th>
                                            <th>Total No of update</th>
                                            <th>New Enrolments</th>
                                            <th>Demographic Updates </th>
                                            <th>Mandatory Biometric Updates(5/15 years)	</th>
                                            <th>Biometric Updates	</th>
                                            <th>Total Amount Collected Towards Demographic Updates.	</th>
                                            <th>Total Amount  Collected Towards Biometric Updates	</th>
                                            
                                            
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <?php $__empty_1 = true; $__currentLoopData = $enrollmentList; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key =>$val): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                                        <?php
                                          $bankAmt = 0;
                                          $bankData = DB::table('bankuplods')->select('amount_credited')->where('Operator_Code',$val['Operator_Code'])->whereDate('date_of_transaction',$val->c_date)->first();
                                        ?>
                                        <tr>
                                            <td><?php echo e($key+$enrollmentList->firstItem()); ?>.</td>
                                            <td><?php echo e($val['branch_code']); ?></td>
                                            <td><?php echo e(date('d-m-Y', strtotime($val['c_date']))); ?></td>
                                            <td><?php echo e($val['Station_ID']); ?></td>
                                            <td><?php echo e($val['Operator_Code']); ?></td>
                                            <td><?php echo e($val['Operator_Name']); ?></td>
                                            <td><?php echo e($val['District']); ?></td>
                                            <td><?php echo e($val['State']); ?></td>
                                            <td><?php echo e($val['pincode']); ?></td>
                                            <td><?php echo e($val['total_enrollment']); ?></td>
                                            <td><?php echo e($val['total_no_of_update']); ?></td>
                                            <td><?php echo e($val['new_enrollments']); ?></td>
                                            <td><?php echo e($val['total_demographic_update']); ?></td>
                                            <td><?php echo e($val['mandatory_bio_biometric_update']); ?></td>
                                            <td><?php echo e($val['biometric_update']); ?></td>
                                            <td><?php echo e($val['total_amount_collected_A']); ?></td>
                                            <td><?php echo e($val['total_amount_collected_B']); ?></td>
                                            
                                        </tr>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>

                                        <tr>
                                            <td colspan="19">No Record Found !!</td>
                                        </tr>

                                        <?php endif; ?>


                                    </tbody>
                                </table>
                                <?php echo $enrollmentList->appends($_GET)->links(); ?>

                            </div>
                        </div>
                        <!-- /.card-body -->
                    </div>
                    <!-- /.card -->

                    <!-- end -->
                </div>
            </div>

        </div>
    </main>

   <!-- Include jQuery -->
<script src="https://code.jquery.com/jquery-3.6.4.min.js"></script>

<!-- Include Select2 CSS -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.13/css/select2.min.css"  />

<!-- Include Select2 JS -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.13/js/select2.min.js" ></script>
<!-- Initialize Select2 -->
<script>
    jQuery(document).ready(function($) {
        $('#Operator1').select2();
        $('#Branch1').select2();
        $('#District1').select2();
    });
</script>
<script>
    function downloadExcel(){
        var from_date     = $('#from_date').val();
        var to_date       = $('#to_date').val();

        window.location.href = "<?php echo e(url('/operator/get-excel-report')); ?>/?from_date="+from_date+"&to_date="+to_date;
    }

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

<?php echo $__env->make('operator.layouts.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/aks5g/public_html/aadhar.aks.5g.in/resources/views/operator/pspl_report.blade.php ENDPATH**/ ?>