

<?php $__env->startSection('title', 'Users'); ?>
<?php $__env->startSection('dynamic_css_excpt'); ?>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('dynamic_css'); ?>
    <!-- <link href="https://cdn.datatables.net/1.10.19/css/dataTables.bootstrap4.min.css" media="all" rel="stylesheet" type="text/css"/>-->
    <link href="<?php echo asset('css/dataTables.bootstrap4.min.css'); ?>" media="all" rel="stylesheet" type="text/css"/>
    <link href="https://cdn.datatables.net/buttons/1.5.6/css/buttons.bootstrap4.min.css" media="all" rel="stylesheet" type="text/css"/>
    <style>
        select.form-control:not([size]):not([multiple]) {
            height: calc(1.95rem + 0px);
        }
        .panel-title{
            font-size: 15px;
            display: table-cell;
            vertical-align: middle;
        }
        .custom-col-md-6{
            width:50%;
            display: table;
            height: 40px;
        }
        .table td {
            padding: .5rem 1rem .5rem 1rem;
            vertical-align: middle;
            border-top: 1px solid #dee2e6;
        }
        .table .btn{
            min-width: 89px;
        }

        select options {
            text-transform: capitalize;
        }

        .text-blue{
            color: #304192;
            font-weight: 600;
            font-size: 14px;
        }
        /************************ slider button ************************************/

        /* The switch - the box around the slider */
        .switch {
            position: relative;
            display: inline-block;
            width: 55px;
            height: 26px;
        }

        /* Hide default HTML checkbox */
        .switch input {
            opacity: 0;
            width: 0;
            height: 0;
        }

        /* The slider */
        .slider {
            position: absolute;
            cursor: pointer;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: #ccc;
            /* background-color: red;*/
            -webkit-transition: .4s;
            transition: .4s;
        }

        .slider:before {
            position: absolute;
            content: "";
            height: 24px;
            width: 24px;
            left: 3px;
            bottom: 1px;
            background-color: white;
            -webkit-transition: .4s;
            transition: .4s;

        }

        input:checked + .slider {
            background-color: #2196F3;
            /* background-color: green;*/
        }

        input:focus + .slider {
            box-shadow: 0 0 1px #2196F3;
            /* background-color: green;*/
        }

        input:checked + .slider:before {
            -webkit-transform: translateX(26px);
            -ms-transform: translateX(26px);
            transform: translateX(26px);
        }

        /* Rounded sliders */
        .slider.round {
            border-radius: 34px;
        }

        .slider.round:before {
            border-radius: 50%;
        }

        .vl{
            height: 26px;
            border-left: 1px solid #999;
        }

        .fBlack{
            color:#999;
        }

        /*****************************************************************************/
        @media (max-width: 768px)
        {
            li.page-item {

                display: none;
            }
            .custom-col-md-6{
                width:50%;
                display: table;
                height: 34px;
            }
            .page-item.previous,
            .page-item.next,
            .page-item:first-child,
            .page-item:last-child,
            .page-item.active {

                display: block;
            }

            .result-set{
                padding-left: 15px;
                padding-right: 15px;
            }

            .btn.btn-sm,.btn.btn-xsm {
                padding: .3rem .7rem;
                font-size: .54rem;
            }
            .table .btn {
                min-width: 50px;
            }

            .btn.btn-xsm{
                padding: .2rem .2rem;
            }

            #data-table{
                width: 100% !important;
            }

        }

        .dataTables_filter{
            display: inline-block;
            float: right;
        }

        .btn-secondary {
            background-color: #1c7095!important;
            color: #fff!important;
            padding: .40rem .60rem;
        }

        .employeeList{
            width: 100% !important;
        }

        /*.verification tbody tr td:nth-child(8){*/
            /*display: flex;*/
        /*}*/
        .verification th{
            text-align: center;
        }
        .verification td{
            text-align: center;
        }
        .dataTables_length{
            display: inline;
        }
        .img-circular{
            width: 95px;
            height: 95px;
            background-size: cover;
           
        }



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

<?php $__env->startSection('content'); ?>
    <div class="container">
        <div class="row container_layout">
            <div class="col-md-12 pl0 pr0 mobile_view">
                <nav aria-label="breadcrumb">
                    <ol class="breadcrumb">
                        <li class="breadcrumb-item">
                            <a href="<?php echo e(route('adminhome')); ?>">
                                <i class="material-icons">home</i>
                            </a>
                        </li>
                        <li class="breadcrumb-item"><a href="<?php echo e(route('employees')); ?>">Employees</a></li>
                        <li class="breadcrumb-item active"><a href="<?php echo e(route('employeeVerificationView')); ?>">Employee Verification</a></li>
                    </ol>
                </nav>
            </div>


            <div class="col-md-12 p20 bg-white">
                <div class="panel panel-default">
                    <div class="panel-heading ">

                        <div class="row e1f5fe bdbdbd grey lighten-1 custom_row_o" data-toggle="collapse" href="#collapseExample" aria-expanded="false" aria-controls="collapseExample" style="cursor: pointer;">
                            <div class="col-md-6 custom-col-md-6" style="max-width: 50%;">

                                <div class="panel-title pl5">
                                    <i class="fa fa-filter"></i> <span class="label_text"> Custom Filter </span>
                                </div>

                            </div>
                            <div class="col-md-6 custom-col-md-6 text-right" style="max-width: 50%;">

                            </div>
                        </div>

                    </div>
                    <div class="panel-body">
                        <div class="row bg_body custom_row_o">
                            <div class="col-md-12 collapse show mt10" id="collapseExample">

                                    <?php echo e(csrf_field()); ?>

                                    <div class="row result-set">
                                        <div class="col-md-3 mb-3">
                                            <label class="control-label text-blue"> District </label>
                                            <select class="form-control input-md" id="district" name="district">
                                                <?php if($data['districts']): ?>
                                                    <option value="" selected disabled>==== Select District ====</option>
                                                    <option value="1" <?php if($data['district']==1): ?> <?php echo e('selected'); ?> <?php endif; ?>> All </option>

                                                    <?php $__currentLoopData = $data['districts']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $dist): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                        <?php if(($data['district']) && ($data['district']==$dist->district_code)): ?>
                                                            <option value="<?php echo e($dist->district_code); ?>" selected> <?php echo e($dist->district_name); ?> </option>
                                                        <?php else: ?>
                                                            <option value="<?php echo e($dist->district_code); ?>"> <?php echo e($dist->district_name); ?> </option>
                                                        <?php endif; ?>
                                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                <?php else: ?>
                                                    <option value="<?php echo e($data['district']); ?>" selected><?php echo e($data['district_name']); ?></option>
                                                <?php endif; ?>
                                            </select>
                                        </div>
                                        <div class="col-md-3 mb-3">
                                            <label class="control-label text-blue">Block</label>
                                            <select class="form-control input-md" id="block" name="block">

                                                <?php if($data['block_list']): ?>
                                                    <option value="" disabled selected>==== Select A Block ====</option>
                                                    <?php $__currentLoopData = $data['block_list']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $blk): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                        <?php if(($data['block']) && ($data['block']==$blk->block_id)): ?>
                                                            <option value="<?php echo e($blk->block_id); ?>" selected> <?php echo e($blk->block_name); ?> </option>
                                                        <?php else: ?>
                                                            <option value="<?php echo e($blk->block_id); ?>"> <?php echo e($blk->block_name); ?> </option>
                                                        <?php endif; ?>
                                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                <?php elseif($data['block']): ?>
                                                    <option value="<?php echo e($data['block']); ?>" selected><?php echo e($data['block_name']); ?></option>
                                                <?php else: ?>
                                                    <option value="" disabled selected>==== Select A Block ====</option>
                                                <?php endif; ?>

                                            </select>
                                        </div>
                                        <div class="col-md-3 mb-3">
                                            <label class="control-label text-blue">Gram Panchayat</label>
                                            <select class="form-control input-md" id="panchyat" name="panchyat">
                                                <option value="">==== Select Gram Panchayat ====</option>
                                                <?php if($data['panchyat_list']): ?>
                                                    <?php $__currentLoopData = $data['panchyat_list']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $pan): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                        <?php if(($data['panchyat']) && ($data['panchyat']==$pan->gram_panchyat_id)): ?>
                                                            <option value="<?php echo e($pan->gram_panchyat_id); ?>" selected> <?php echo e($pan->gram_panchyat_name); ?> </option>
                                                        <?php else: ?>
                                                            <option value="<?php echo e($pan->gram_panchyat_id); ?>"> <?php echo e($pan->gram_panchyat_name); ?> </option>
                                                        <?php endif; ?>
                                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                <?php endif; ?>
                                            </select>



                                        </div>
                                        <div class="col-md-3 mb-3">
                                            <label class="control-label text-blue">Level</label>
                                            <select class="form-control input-md" id="level" name="level">
                                                <option value=""  selected>==== Select Levels ====</option>
                                                <?php if($data['level']): ?>
                                                    <?php $__currentLoopData = $data['level']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $lev): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                        <?php if(($data['level_s']) && ($data['level_s']==$lev->level_id)): ?>
                                                            <option value="<?php echo e($lev->level_id); ?>" selected> <?php echo e($lev->level); ?> </option>
                                                        <?php else: ?>
                                                            <option value="<?php echo e($lev->level_id); ?>"> <?php echo e($lev->level); ?> </option>
                                                        <?php endif; ?>
                                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                <?php endif; ?>
                                            </select>
                                        </div>
                                        
                                    </div>
                                    <div class="row result-set">
                                       
                                        <div class="col-md-3 mb-3">
                                            <label class="control-label text-blue"> Designation </label>
                                            <select class="form-control input-md" id="designation" name="designation">
                                                <option value="">==== Select Designation ====</option>
                                               
                                            </select>
                                        </div>
                                      
                                        <div class="col-md-3 text-right margin-auto">
                                            <button type="submit" class="btn btn-primary btn-sm search"><i class="fa fa-search" aria-hidden="true"></i> Search</button>
                                            <a href="<?php echo e(route('employeeusers.display')); ?>" class="btn btn-warning  btn-sm"> <i class="fa fa-refresh" aria-hidden="true"></i> Reset</a>
                                        </div>
                                    </div>

                            </div>
                        </div>
                        <div class="result-set mt10" id="no-more-tables">
                            <div class="row">
                                <div class="col-md-12 pl0 pr0">
                                    <table class="table table-responsive employeeList" cellspacing="10">
                                        <thead>
                                        <tr class="note note-primary">
                                            <th scope="col" class="note-dange">#</th>
                                            <th scope="col">Employee Code</th>
                                            <th scope="col">Employee Name</th>
                                            <th scope="col">Designation</th>
                                            <th scope="col">Posted District</th>
                                            <th scope="col">Posted Block</th>
                                            <th scope="col">GP</th>
                                       
                                            <th scope="col">Date Of Joining</th>
                                          
                                            <th scope="col">Contact No</th>
                                            
                                            
                                        </tr>
                                        </thead>

                                    </table>

                                </div>
                            </div>
                        </div>


                    </div>
                </div>
            </div>



        </div>

    </div>
    <div class="modal fade top" id="fluidModalTopWarningDemo" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" data-backdrop="true"  style="display: none;" aria-hidden="true">
        <div class="modal-dialog modal-lg modal-top modal-notify modal-primary" role="document">
            <!--Content-->
            <div class="modal-content">
                <!--Header-->
                <div class="modal-header mod_head">
                    <p class="heading lead">Employement Details</p>

                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true" class="white-text">×</span>
                    </button>
                </div>

                <!--Body-->
                <div class="modal-body">
                    <div id="printSection">
                    <div class="container">
                        <div class="row" id="profile" style="font-size:13px;box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);">
                            <div class="col-md-12 mt-2" style="text-align:center;">
                                
                                <img src="" id="dp" class="img-circular" onerror="if (this.src != '<?php echo e(asset('images/profile_pic.jpg')); ?>') this.src = '<?php echo e(asset('images/profile_pic.jpg')); ?>';" style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);">
                             </div>
                           
                           
                            <div class="col-md-3 mt-1">
                                <label style="color:#2196F3;font-weight:bold;">Employee Code</label>
                                <p id="code"></p>

                            </div>
                            <div class="col-md-3 mt-1">
                                <label style="color:#2196F3;font-weight:bold;">Employee Name</label>
                                <p id="name"></p>
    
                            </div>
                           
                           <div class="col-md-3 mt-1">
                                <label style="color:#2196F3;font-weight:bold;">Designation</label>
                                <p id="designation_name"></p>

                            </div>
                            
                          
                            <div class="col-md-3 mt-1">
                                    <label style="color:#2196F3;font-weight:bold;">Date Of Joining</label>
                                    <p id="joining_date"></p>
    
                            </div>
                           
                            <div class="col-md-3 mt-1">
                                <label style="color:#2196F3;font-weight:bold;">Date of Birth</label>
                                <p id="dob"></p>

                            </div>
                           
                            <div class="col-md-3 mt-1">
                                <label style="color:#2196F3;font-weight:bold;">Posted District</label>
                                <p id="posted_district"></p>
                            </div>
                            <div class="col-md-3 mt-1">
                                <label style="color:#2196F3;font-weight:bold;">Posted Block</label>
                                <p id="posted_block"></p>
                            </div>
                            <div class="col-md-3 mt-1">
                                <label style="color:#2196F3;font-weight:bold;">Posted GP</label>
                                <p id="posted_gp"></p>
                            </div>
                           
                           
                            
                            
                            <div class="col-md-12" style="background-color:#1f2b49">
                                <p style="padding-top: 11px;color: white;font-size: 15px;">Contact Details</p>
                            </div>
                            <div class="col-md-4 mt-1">
                                <label style="color:#2196F3;font-weight:bold;">Mobile</label>
                                <p id="mobile"></p>

                            </div>
                            <div class="col-md-4 mt-1">
                                <label style="color:#2196F3;font-weight:bold;" class="bs-linebreak">Alternate Mobile</label>
                                <p id="alt_mobile"></p>
                            </div>
                            <div class="col-md-4 mt-1">
                                <label style="color:#2196F3;font-weight:bold;">Email</label>
                                <p id="email"></p>
                            </div>
                            <div class="col-md-4 mt-1">
                                <label style="color:#2196F3;font-weight:bold;">Permanent address</label>
                                <p id="home_district"></p>
                            </div>
                            <div class="col-md-4 mt-1">
                                <label style="color:#2196F3;font-weight:bold;">Correspondence Address</label>
                                <p id="home_block"></p>
                            </div>
                            
                            <div class="col-md-12" style="background-color:#1f2b49">
                                <p style="padding-top: 11px;color: white;font-size: 15px;">Remark</p>
                            </div>
                            <div class="col-md-4 mt-1">
                                <label style="color:#2196F3;font-weight:bold;">Remark</label>
                                <p id="remark"></p>

                            </div>
                           
                            <div class="col-md-12" style="text-align:center;">
                                <button type="submit" onclick="printDiv('printSection')" class="btn btn-success btn-sm">Print</button>
                                <button type="submit" data-dismiss="modal" aria-label="Close"  class="btn btn-danger btn-sm">Cancel</button>
                            </div>
                           
                        </div>
                        </div>
                    
                    </div>
                    
                
                </div>
            </div>
        </div>
    </div>

    

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

<?php $__env->startSection('dynamic_js'); ?>
    <script src="<?php echo e(asset('js/lib/jquery.dataTables.min.js')); ?>"></script>
    <script src="<?php echo e(asset('js/lib/dataTables.bootstrap4.min.js')); ?>"></script>
    <script src="https://cdn.datatables.net/buttons/1.5.6/js/dataTables.buttons.min.js"></script>
    <script src="https://cdn.datatables.net/buttons/1.5.6/js/buttons.bootstrap4.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/pdfmake.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/vfs_fonts.js"></script>
    <script src="https://cdn.datatables.net/buttons/1.5.6/js/buttons.html5.min.js"></script>
    <script src="https://cdn.datatables.net/buttons/1.5.6/js/buttons.print.min.js"></script>
    <script src="https://cdn.datatables.net/buttons/1.5.6/js/buttons.colVis.min.js"></script>
    <script src="<?php echo e(asset('vendor/datatables/buttons.server-side.js')); ?>"></script>
    <script src="<?php echo e(asset('plugins/bootstrap-material-datetimepicker/js/bootstrap-material-datetimepicker.js')); ?>"></script>

    <!--<script src="https://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js"></script>
    <script src="https://cdn.datatables.net/1.10.19/js/dataTables.bootstrap4.min.js"></script>-->
    <script>


        $('#district').on('change',function(e){
            e.preventDefault()
            var  selected_district=$(this).val();

            $('.page-loader-wrapper').fadeIn();
            $.ajax({
                type: "GET",
                url: "<?php echo e(route('get_block_list')); ?>",
                data: {
                    district_code: selected_district
                },
                dataType: "json",
                success: function (data) {
                    $('#block').empty();
                    $('#block').append('<option value=""  selected>==== Select A Block ====</option>');
                    if (data.msgType == true) {
                        $.each(data.data,function(key,value){
                            $('#block').append('<option value=" '+value.block_id+' ">'+value.block_name+'</option>');
                        });

                    }else{
                        toastr.error(data.msg);
                    }
                },
                error: function (jqXHR, textStatus, errorThrown) {

                    callAjaxErrorFunction(jqXHR, textStatus, errorThrown);
                },
                complete: function (data) {
                    $('.page-loader-wrapper').fadeOut();
                }
            });
        })


        $(document).on('change','#block',function(e){
            e.preventDefault()
            var  selected_gp=$(this).val();
       
            $('.page-loader-wrapper').fadeIn();
            $.ajax({
                type: "GET",
                url: "<?php echo e(route('get_gp_list')); ?>",
                data: {
                    gp_code: selected_gp
                },
                dataType: "json",
                success: function (data) {
                    $('#panchyat').empty();
                    $('#panchyat').append('<option value=""  selected>==== Select Gram Panchayat ====</option>');
                    if (data.msgType == true) {
                        $.each(data.data,function(key,value){
                            $('#panchyat').append('<option value=" '+value.gram_panchyat_id+' ">'+value.gram_panchyat_name+'</option>');
                        });
                        $('#panchyat').on('change',function(e){
                            e.preventDefault();
                            get_level_by_gp();
                        })
                    }else{
                        toastr.error(data.msg);
                    }
                },
                error: function (jqXHR, textStatus, errorThrown) {

                    callAjaxErrorFunction(jqXHR, textStatus, errorThrown);
                },
                complete: function (data) {
                    $('.page-loader-wrapper').fadeOut();
                }
            });
        })



        $('.btn-edit').on('click',function(e){
            e.preventDefault;
            var employee_code=$(this).data('id');
            $('#employee_code_of_employee').val(employee_code);
            $('#employeeDataDisplay').submit();
        })



       
      
      

       


        $(document).on('input','.account_action',function(e){

            var id=$(this).parent('label').data('id');

            /*$('.page-loader-wrapper').fadeIn();*/
            $.ajax({
                type: "GET",
                url: "<?php echo e(route('accountaction')); ?>",
                data: {
                    id: id
                },
                dataType: "json",
                success: function (data) {
                    if (data.msgType == true) {
                        toastr.success(data.msg);
                    }else{
                        toastr.error(data.msg);
                    }

                    table.ajax.reload(null, false);
                },
                error: function (jqXHR, textStatus, errorThrown) {

                    callAjaxErrorFunction(jqXHR, textStatus, errorThrown);
                },
                complete: function (data) {
                    /* $('.page-loader-wrapper').fadeOut();*/
                }
            });
        })


        /*function get_user_list(){
         $('.page-loader-wrapper').fadeIn();
         var form = $('#search-form')[0];
         var data = new FormData(form);
         $.ajax({
         type: "POST",
         enctype: 'multipart/form-data',
         processData: false,
         contentType: false,
         cache: false,
         url: "<?php echo e(route('get_user_by_condition')); ?>",
         data: data,
         dataType: "json",
         success: function (data) {
         if(data.msgType == true) {
         $('#data-table-body').empty();
         var i=1;
         $.each(data.data,function(key,value){
         var action_btn='';
        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('edit_users', 'delete_users')): ?>
        action_btn='<td class="text-center">Actions</td>'+
        <?php endif; ?>
        $('#data-table-body').append('<tr>'+
         '<td>'+i+'</td>'+
         '<td>'+value.username+'</td>'+
         '<td>'+value.email+'</td>'+
         '<td>'+value.roles+'</td>'+
         '<td>Created At</td>'+
         '<td>Status</td>'+
         +action_btn+
         '</tr>');
         i++;
         });




         }else {
         toastr.error(data.msg)
         }
         },
         error: function (jqXHR, textStatus, errorThrown) {
         callAjaxErrorFunction(jqXHR, textStatus, errorThrown);
         },
         complete: function (data) {
         $('.page-loader-wrapper').fadeOut();
         }
         });
         }

         get_user_list();*/
        $(document).ready(function () {
        


        
            $(document).on('click', '.search', function (e) {
                e.preventDefault();
                 $('.employeeList').DataTable().ajax.reload();
                

            });



    

        
            $(document).on('change','#district_name',function () {
                var dis_id=$('#district_name').val();
                $('#block_name').empty();
                var option = "<option value=''>Select Block Name</option>";
                $('#block_name').append(option);
                $('#gp_name').empty();
                var option = "<option value=''>Select Gram Panchayat</option>";
                $('#gp_name').append(option);
                $.ajax({
                    headers: {
                        'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                    },
                    type: "POST",
                    url: "<?php echo e(route('employeeVerificationGetBlock')); ?>",
                    dataType: 'json',
                    data: {'dis_id': dis_id},
                    success: function (data) {
                        if (data.msg == 'success') {
                            $('#block_name').empty();
                            var option = "<option value=''>Select Block Name</option>";
                            $.each(data.block,function (index,value) {
                                option += '<option value="'+value.block_id+'">'+value.block_name+'</option>'
                            });

                            $('#block_name').append(option);
                        }
                        if (data.msg == 'failed') {

                            Swal.fire({
                                type: 'error',
                                title: 'Oops...',
                                text: 'Something went wrong!'
                            })
                        }
                    },
                    error: function (jqXHR, textStatus, errorThrown) {

                        Swal.fire({
                            type: 'error',
                            title: 'Oops...',
                            text: 'Something went wrong!',

                        })
                    }
                })

            });

            $(document).on('change','#block_name',function () {
                var block_id=$('#block_name').val();
                $('#gp_name').empty();
                var option = "<option value=''>Select Gram Panchayat</option>";
                $('#gp_name').append(option);
                $.ajax({
                    headers: {
                        'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                    },
                    type: "POST",
                    url: "<?php echo e(route('employeeVerificationGetGp')); ?>",
                    dataType: 'json',
                    data: {'block_id': block_id},
                    success: function (data) {
                        if (data.msg == 'success') {
                            $('#gp_name').empty();
                            var option = "<option value=''>Select Gram Panchayat</option>";
                            $.each(data.gp,function (index,value) {
                                option += '<option value="'+value.gram_panchyat_id+'">'+value.gram_panchyat_name+'</option>'
                            });

                            $('#gp_name').append(option);
                        }
                        if (data.msg == 'failed') {

                            Swal.fire({
                                type: 'error',
                                title: 'Oops...',
                                text: 'Something went wrong!'
                            })
                        }
                    },
                    error: function (jqXHR, textStatus, errorThrown) {

                        Swal.fire({
                            type: 'error',
                            title: 'Oops...',
                            text: 'Something went wrong!',


                         })
                    }
                })

            });

            $(document).on('change','#level',function(){
                    var id=$('#level').val();
                    $.ajax({
                    headers: {
                        'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                    },
                    type: "POST",
                    url: "<?php echo e(route('others.employeeGetDesignation')); ?>",
                    dataType: 'json',
                    data: {'id': id},
                    success: function (data) {
                        if (data.msg == 'success') {
                            $('#designation').empty();
                            var option = "<option value=''>==== Select Designation ====</option>";
                            $.each(data.data,function (index,value) {
                                option += '<option value="'+value.id+'">'+value.designation_name+'</option>'
                            });

                            $('#designation').append(option);
                        }
                        if (data.msg == 'failed') {

                            Swal.fire({
                                type: 'error',
                                title: 'Oops...',
                                text: 'Something went wrong!'
                            })
                        }
                    },
                    error: function (jqXHR, textStatus, errorThrown) {

                        Swal.fire({
                            type: 'error',
                            title: 'Oops...',
                            text: 'Something went wrong!',

                        })
                    }
                })
                    
            })

            
        $('.employeeList').DataTable({
            "processing": true,
            "serverSide": true,
            "responsive": true,
            "scrollX": true,
            buttons: [
                'copyHtml5',
                'excelHtml5',
                'csvHtml5',
                'pdfHtml5'
            ],
            "lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]],
            dom: 'Blfrtip',
            "language": {
                "processing": 'Loading data...'
            },

            "ajax": {
                "url": "<?php echo e(route('others.getPermanentEmployeeList')); ?>",
                "data": function (d) {
                    d.dis_id=$('#district').val();
                    d.block_id=$('#block').val();
                    d.panchayat_id=$('#panchyat').val();
              
                    d.level_id=$('#level').val();
                    d.des_id=$('#designation').val();
               
                }
            },
            "columns": [
                {data: 'DT_Row_Index', name: 'DT_Row_Index'},
                {"data": "employee_code",
                    "render": function(data, type, row, meta){
                        if(type === 'display'){
                            data = '<a href="' + row.employee_code + '" style="color:blue;" id="profile_view">'+ row.employee_code +'</a>';
                        }
                        return data;
                    }
                },
                {"data": "employee_name"},
                {"data": "designation_name"},
                {"data": "district_name"},
                {"data": "block_name"},
                {"data": "gram_panchyat_name"},
            
                {"data": "date_of_join"},
                {"data": "mobile_no"},
               
               

            ],
           


        });

    });

        $(document).on('click','#profile_view',function(e){
            e.preventDefault();
            var code=$(this).attr('href');
           
            $('#code').empty();
            $('#name').empty();
            $('#designation_name').empty();
            $('#joining_date').empty();
        
            $('#posted_district').empty();
            $('#posted_block').empty();
            $('#posted_gp').empty();
       
            $('#dob').empty();
            $('#mobile').empty();
            $('#alt_mobile').empty();
            $('#email').empty();
            $('#home_district').empty();
            $('#home_block').empty();
            $('#home_town').empty();
           
         
            $.ajax({
                headers: {
                    'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                },
                type: "POST",
                url: "<?php echo e(route('others.permanentEmployeeViewProfile')); ?>",
                dataType: 'json',
                data: {'code': code},
                success: function (data) {
                    if (data.msg == 'success') {
                        $('#fluidModalTopWarningDemo').modal('show');
                        $('#code').append(data.data.employee_code);
                        $('#name').append(data.data.employee_name);
                        $('#designation_name').append(data.data.designation_name);
                        $('#joining_date').append(data.data.date_of_join);
                       
                        $('#posted_district').append(data.data.district_name);
                        $('#posted_block').append(data.data.block_name);
                        $('#posted_gp').append(data.data.gram_panchyat_name);
                      
                        $('#dob').append(data.data.date_of_birth);
                        $('#mobile').append(data.data.mobile_no);
                        $('#alt_mobile').append(data.data.alt_mobile_no);
                        $('#email').append(data.data.email);
                        $('#home_district').append(data.data.permanent_address);
                        $('#home_block').append(data.data.correspondence_address);
                        $('#remark').append(data.data.employee_remarks);
                    }
                    if (data.msg == 'failed') {

                        Swal.fire({
                            type: 'error',
                            title: 'Oops...',
                            text: 'Something went wrong!'
                        })
                    }
                },
                error: function (jqXHR, textStatus, errorThrown) {

                    Swal.fire({
                        type: 'error',
                        title: 'Oops...',
                        text: 'Something went wrong!',

                    })
                }
            })
           });

      

        function printDiv(printSection) {
            var printContents = document.getElementById(printSection).innerHTML;
            var originalContents = document.body.innerHTML;

            document.body.innerHTML = printContents;

            window.print();

            document.body.innerHTML = originalContents;
            
            setTimeout(function() {
                location.reload();
            }, 1000);
        }




    </script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.app2', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>