<?php $__env->startSection('main-content'); ?>
<style>

</style>
<main>
    <div class="container-fluid">
        <h2 class="mt-3 mb-4">View not upload mis operator   </h2>

        <div class="row">
            <div class="card-body">
                
            </div>
            <div class="col-md-12">
                <div class="card card-primary">

                    <div class="card-body" id="demo">
                        <div class="card-header">
                            <h6 class="card-title"></h6>
                            <a onclick="downloadExcel()" class="btn btn-primary"><i class="fa fa-download"></i> Operator
                                List Donload</a>

                        </div>
                        <div class="table-responsive">
                            <table class="table table-bordered table-striped" width="100%" style="height: 600px;"
                                cellspacing="0">
                                <thead>
                                    <tr>
                                        <th width="5%">S.No.</th>
                                        <th>Registrar Code</th>
                                        <th>EA Code</th>
                                        <th>Operator Code</th>
                                        <th>Operator Name</th>
                                        <th>Aadhaar Number</th>
                                        <th>SALARY</th>
                                        <th>PF No</th>
                                        <th>ESI No</th>
                                        <th>Station Code</th>
                                        <th>NSE IT Certificate</th>
                                        <th>VTC Village Town City</th>
                                        <th>Post Office</th>
                                        <th>Block</th>
                                        <th>District</th>
                                        <th>State</th>
                                        <th>Center Address</th>
                                        <th>Email ID</th>
                                        <th>Mobile No</th>
                                        <th>Any Desk ID</th>
                                        <th>view passsword</th>
                                        <th>Status</th>

                                        <!-- <th width="10%"></th>
                                            <th width="10%"></th> -->

                                    </tr>
                                </thead>
                                <tbody>


                                    <?php $__empty_1 = true; $__currentLoopData = $operatorList; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key =>$value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                                    <tr>
                                        <td><?php echo e($key+ $operatorList->firstItem()); ?>.</td>
                                        <td><?php echo e($value->Registrar_Code); ?></td>
                                        <td><?php echo e($value->EA_Code); ?></td>
                                        <td><?php echo e($value->Operator_Code); ?></td>
                                        <td><?php echo e($value->Operator_Name); ?></td>
                                        <td><?php echo e($value->Aadhaar_Number); ?></td>
                                        <td><?php echo e($value->SALARY); ?></td>
                                        <td><?php echo e($value->PF_No); ?></td>
                                        <td><?php echo e($value->ESI_No); ?></td>
                                        <td><?php echo e($value->Station_Code); ?></td>
                                        <td><?php echo e($value->NSE_IT_Certificate); ?></td>
                                        <td><?php echo e($value->VTC_Village_Town_City); ?></td>
                                        <td><?php echo e($value->Post_Office); ?></td>
                                        <td><?php echo e($value->Block); ?></td>
                                        <td><?php echo e($value->District); ?></td>
                                        <td><?php echo e($value->State); ?></td>
                                        <td><?php echo e($value->Center_Address); ?></td>
                                        <td><?php echo e($value->Email_ID); ?></td>
                                        <td><?php echo e($value->Mobile_No); ?></td>
                                        <td><?php echo e($value->Any_Desk_ID); ?></td>
                                        <td><?php echo e($value->view_password); ?></td>
                                        <td>
                                            <select name="status" onchange="test(this,<?php echo e($value->id); ?>)"
                                                id="status_<?php echo e($value->id); ?>_<?php echo e($value->status); ?>">
                                                <option value="1" <?php echo e($value->status == '1' ? 'selected' : ''); ?>>Active
                                                </option>
                                                <option value="2" <?php echo e($value->status == '2' ? 'selected' : ''); ?>>Inactive
                                                </option>
                                                <option value="3" <?php echo e($value->status == '3' ? 'selected' :
                                                    ''); ?>>Disassociated </option>
                                                <option value="0" <?php echo e($value->status == '0' ? 'selected' :
                                                    ''); ?>>Blacklisted </option>
                                            </select>
                                        </td>
                                        <!-- <td><a href="#"><i class="far fa-edit"></i> Edit</a>
                                                </td>
                                                <td><a href="#"><i class="far fa-trash-alt"></i> Delete</a></td> -->
                                    </tr>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>

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

                                    <?php endif; ?>


                                </tbody>
                            </table>
                            <?php echo $operatorList->links(); ?>

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

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

    </div>
</main>
<?php $__env->stopSection(); ?>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<script>
    function test(a,id) {
        // alert(a);
        // alert(id);
        // alert('id');
    var x = (a.value || a.options[a.selectedIndex].value);  //crossbrowser solution =)

      $.ajax({
            type : "post",
            url  : "<?php echo e(route('admin.StatusChange')); ?>",
            data : {
              'id' : id,
              "status"   : x,
              "_token"    : "<?php echo e(csrf_token()); ?>"
            },
            success  : function(res) {
              if(res.data==1){
                toastr.success("successfully");
                // alert('successfully!');
                // $('#player-container').css('display','none');
                // $('#filterdataAjax').empty();
                // $("#loadingbutton").find(".fa-spinner").remove();
                // $('#filterdataAjax').append(res.data);
              }else{
                toastr.error("fail!");
              }
            }
          });

}

    function downloadExcel(){
        var from_date     = $('#from_date').val();
        var to_date       = $('#to_date').val();


        var selectElement = document.getElementById("status");

        // Get the selected option
        var selectedOption = selectElement.options[selectElement.selectedIndex];

        // Get the ID of the selected option (value attribute)
        var selectedOptionId = selectedOption.value;

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

</script>

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