

<?php $__env->startSection('title', 'Users'); ?>
<?php $__env->startSection('dynamic_css_excpt'); ?>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('dynamic_css'); ?>

    <link href="<?php echo asset('css/dataTables.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: 36px;
        }
        .table td {
            padding: .5rem .5rem .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: 25px;
            }
            .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;
        }

        .verification{
            width: 100% !important;
        }

        .verification tbody tr td:nth-child(8){
            display: flex;
        }
        .verification th{
            text-align: center;
        }

        .form-group {
            margin-top: 1rem;
        }

    </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="">Service</a></li>
                    <li class="breadcrumb-item active"><a href="">Initiate Permanent Employee Transfer</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" >
                            <div class="col-md-6 custom-col-md-6 " data-toggle="collapse" href="#collapseExample" aria-expanded="false" aria-controls="collapseExample" style="cursor: pointer;" 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%;">
                                <button type="button" class="btn btn-primary pull-right btn-xsm" style="border-radius: 5px;" id="entryModel">
                                    <i class="fa fa-plus"></i>
                                    Add Employee Transfer
                                </button>
                            </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" selected> All </option>
                                                <?php $__currentLoopData = $data['districts']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $dist): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                    <option value="<?php echo e($dist->district_code); ?>"> <?php echo e($dist->district_name); ?> </option>
                                                <?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 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="" 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  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">Transfer to District</th>
                                            <th scope="col">Transfer to Block</th>
                                            <th scope="col">Transfer to GP</th>
                                            <th>Action</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">Permanent Employee Transfer 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 class="row" id="profile" style="">

                            <div class="col-md-3 mt-1">
                                <label style="color:#2196F3;font-weight:bold;">Employee Code</label>
                                <p class="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;">Transfer Status</label>
                                <p id="status" style="font-weight:bold"></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-3 mt-1">
                                <label style="color:#2196F3;font-weight:bold;">Transfer District</label>
                                <p id="new_district"></p>
                            </div>
                            <div class="col-md-3 mt-1">
                                <label style="color:#2196F3;font-weight:bold;">Transfer Block</label>
                                <p id="new_block"></p>
                            </div>
                            <div class="col-md-3 mt-1">
                                <label style="color:#2196F3;font-weight:bold;">Transfer GP</label>
                                <p id="new_gp"></p>
                            </div>
                            <div class="col-md-3 mt-1">
                                <label style="color:#2196F3;font-weight:bold;">Order Date.</label>
                                <p id="order_date"></p>
                            </div>
							<div class="col-md-6 mt-1">
                                <label style="color:#2196F3;font-weight:bold;">Remerks</label>
                                <p id="remarks" style="font-weight:bold"></p>
                            </div>
							<div class="col-md-6 mt-1">
                                <label style="color:#2196F3;font-weight:bold;">Order Copy</label>
                                <p id="ordercpy" style="font-weight:bold"></p>
                            </div>
                        </div>



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


    <div class="modal fade" id="addEmployeeModel" role="dialog">
        <div class="modal-dialog modal-lg">
            <div class="modal-content" style="">
                <form  method="post" id="addEmployeeForm">
                    <?php echo e(csrf_field()); ?>

                    <div class="modal-body">
                        <!------------------------- TOP BAND ------------------------------>
                        <div class="col-md-12">
                            <div class="card">
                              <div class="card-header light-blue lighten-1 white-text text-uppercase font-weight-bold text-start py-3"><i class="fa fa-plus"></i> Add Employee Transfer
                                <button type="button" class="btn bg-red modal-close" data-dismiss="modal" aria-hidden="true"style="float:right; margin: -7px; padding: 7px;">
                                    <i class="fa fa-close"></i>
                                </button>
                              </div>
                                 <div class="card-body">
                                    <div class="ibox float-e-margins">
                                        <div class="ibox-content">
                                          <div class="row">
                                            <div class="col-md-4 form-group">
                                                <label  style="color:#2196F3;font-weight:bold;">Employee Name<span style="color:red">*</span></label>
                                                <input class="form-control" placeholder="Employee Name
                                                " name="employee_name" id="emp_name_help" type="text">
                                                <span style="color:red" id="er_emp_name"></span>
                                            </div>
                                            <div class="col-md-4 form-group">
                                                <label  style="color:#2196F3;font-weight:bold;">Employee Code</label>
                                                <input class="form-control" placeholder="Employee Code" name="permanent_employee_id" type="text" id="emp_code">
                                            </div>
                                            <div class="col-md-4 form-group">
                                                <label  style="color:#2196F3;font-weight:bold;"> Level<span style="color:red">*</span> </label>
                                                <select class="form-control input-md" name="level_id" id="lvl">
                                                    <option value="" selected>== Select Level ==</option>
                                                    <option value="1">State</option>
                                                    <option value="2">District</option>
                                                    <option value="3">Block</option>
                                                    <option value="4">Gram Panchayat</option>
                                                    
                                                </select>
                                                <span style="color:red" id="er_emp_lavel"></span>
                                            </div>
                                            <div class="col-md-4 form-group">
                                                <label  style="color:#2196F3;font-weight:bold;"> Designation<span style="color:red">*</span> </label>
                                                <select class="form-control input-md" name="designation" id="disg">
                                                    <option value="">== Select Designation ==</option>

                                                </select>
                                                <span style="color:red" id="er_emp_des"></span>
                                            </div>
                                          </div><hr>
                                          <div class="row">
                                            <div class="col-md-4 mt-1">
                                                <label style="color:#2196F3;font-weight:bold;">Current District<span style="color:red">*</span></label>
                                                <select class="form-control input-md" id="district1" name="district_id">
                                                    <?php if($data['districts']): ?>
                                                        <option value="" selected>=== Select District ===</option>


                                                        <?php $__currentLoopData = $data['districts']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $dist): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>

                                                                <option value="<?php echo e($dist->district_code); ?>"> <?php echo e($dist->district_name); ?> </option>

                                                        <?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>
                                                <span style="color:red" id="er_emp_dis"></span>

                                            </div>
                                            <div class="col-md-4 mt-1">
                                                <label  style="color:#2196F3;font-weight:bold;">Current Block</label>
                                                        <select class="form-control input-md" id="block1" name="block_id">

                                                            <?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-4 mt-1">
                                                <label  style="color:#2196F3;font-weight:bold;">Current GP</label>
                                                        <select class="form-control input-md" id="panchyat1" name="gp_id">
                                                            <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><hr>
                                          <div class="row">
                                            <div class="col-md-4 mt-1">
                                                <label  style="color:#2196F3;font-weight:bold;">Transfer District<span style="color:red">*</span></label>
                                                <select class="form-control input-md" id="district2" name="trn_district" required>
                                                    <?php if($data['districts']): ?>
                                                        <option value="" selected>=== Select District ===</option>


                                                        <?php $__currentLoopData = $data['districts']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $dist): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>

                                                                <option value="<?php echo e($dist->district_code); ?>"> <?php echo e($dist->district_name); ?> </option>

                                                        <?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>
                                                <span style="color:red" id="er_emp_trdistrict"></span>

                                            </div>
                                            <div class="col-md-4 mt-1">
                                                <label  style="color:#2196F3;font-weight:bold;">Transfer Block</label>
                                                        <select class="form-control input-md" id="block2" name="trn_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-4 mt-1">
                                                <label  style="color:#2196F3;font-weight:bold;">Transfer Gram Panchayat</label>
                                                        <select class="form-control input-md" id="panchyat2" name="trn_gp">
                                                            <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>
                                          <div class="row">
                                            
                                            <div class="col-md-4 form-group ">
                                                <label  style="color:#2196F3;font-weight:bold;">Order Copy<span style="color:red">*</span></label>
                                                <input class="form-control" placeholder="Order Copy" name="order_copy" type="file" >
                                                <span style="color:red" id="er_emp_order_copy"></span>
                                            </div>
                                            
                                            <div class="col-md-4 form-group ">
                                                <label  style="color:#2196F3;font-weight:bold;">Order Date</label>
                                                <input class="form-control" name="order_date" type="date">
                                            </div>
                                            <div class="col-md-6 form-group ">
                                                <label for="" class="active">Remarks</label>
                                                <textarea rows="3" cols="50" name="remarks"></textarea>
                                            </div>
                                          </div>
                                         <div class="row">
                                                <div class="waves-input-wrapper waves-effect waves-light" style="float: right;">
                                                    <input class="btn btn-primary btn-sm" type="submit" value="Submit">



                                                  <button class="btn btn-primary btn-sm" id="help">?</button>
                                                  <a href="" class="btn btn-default btn-sm waves-effect waves-light"> <i class="fa fa-arrow-left"></i> Back</a>

                                             </div>

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


                    </div>
                </form>
            </div>
        </div>
    </div>
    <div class="modal fade" id="help_transfer" role="dialog">
        <div class="modal-dialog modal-lg">
            <div class="modal-content" style="">

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

                    <div class="modal-body">
                        <div class="col-md-12">
                            <div class="card">
                              <div class="card-header light-blue lighten-1 white-text text-uppercase font-weight-bold text-start py-3"><i class="fa fa-plus"></i> Add Employee Transfer
                                <button type="button" class="btn bg-red modal-close" data-dismiss="modal" aria-hidden="true"style="float:right; margin: -7px; padding: 7px;">
                                    <i class="fa fa-close"></i>
                                </button>
                              </div>
                                 <div class="card-body">
                                 </div>
                            </div>
                        </div>
                    </div>
                        <!------------------------- TOP BAND ------------------------------>


            </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="<?php echo e(asset('vendor/datatables/buttons.server-side.js')); ?>"></script>
    <script>

        $('#district1').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) {
                    $('#block1').empty();
                    $('#block1').append('<option value=""  selected>==== Select A Block ====</option>');
                    if (data.msgType == true) {
                        $.each(data.data,function(key,value){
                            $('#block1').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','#block1',function(e){
            e.preventDefault()
            var  selected_gp=$(this).val();
            get_level_by_block();
            $('.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) {
                    $('#panchyat1').empty();
                    $('#panchyat1').append('<option value=""  selected>==== Select Gram Panchayat ====</option>');
                    if (data.msgType == true) {
                        $.each(data.data,function(key,value){
                            $('#panchyat1').append('<option value=" '+value.gram_panchyat_id+' ">'+value.gram_panchyat_name+'</option>');
                        });
                        $('#panchyat1').on('change',function(e){
                            e.preventDefault();

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

                    callAjaxErrorFunction(jqXHR, textStatus, errorThrown);
                },
                complete: function (data) {
                    $('.page-loader-wrapper').fadeOut();
                }
            });
        })
        $('#district2').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) {
                    $('#block2').empty();
                    $('#block2').append('<option value=""  selected>==== Select A Block ====</option>');
                    if (data.msgType == true) {
                        $.each(data.data,function(key,value){
                            $('#block2').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','#block2',function(e){
            e.preventDefault()
            var  selected_gp=$(this).val();
            get_level_by_block();
            $('.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) {
                    $('#panchyat2').empty();
                    $('#panchyat2').append('<option value=""  selected>==== Select Gram Panchayat ====</option>');
                    if (data.msgType == true) {
                        $.each(data.data,function(key,value){
                            $('#panchyat2').append('<option value=" '+value.gram_panchyat_id+' ">'+value.gram_panchyat_name+'</option>');
                        });
                        $('#panchyat2').on('change',function(e){
                            e.preventDefault();

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

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

        $(document).on('submit','#addEmployeeForm',function (e) {
                e.preventDefault();
                $('.page-loader-wrapper').fadeIn();
                $('#er_emp_name').empty();
                $('#er_emp_lavel').empty();
                $('#er_emp_des').empty();
                $('#er_emp_dis').empty();
                $('#er_emp_trdistrict').empty();
                $('#er_emp_order_copy').empty();


               var formData=new FormData(this);

                $.ajax({
                    type: "POST",
                    url: "<?php echo e(route('verifyTransferVacancy')); ?>",
                    dataType: 'json',
                    data: formData,
                    contentType: false,
                    cache: false,
                    processData: false,
                    success: function (data) {

                        $('.page-loader-wrapper').fadeOut();
                        if(data.type==1){
                           if(data.msg="validationFails"){
                                if(data.data.employee_name){
                                        $('#er_emp_name').append(data.data.employee_name[0]);
                                }
                                    if(data.data.level_id){
                                        $('#er_emp_lavel').append(data.data.level_id[0]);
                                }
                                    if(data.data.designation){
                                        $('#er_emp_des').append(data.data.designation[0]);
                                }
                                     if(data.data.district_id){
                                        $('#er_emp_dis').append(data.data.district_id[0]);
                                }
                                      if(data.data.trn_district){
                                        $('#er_emp_trdistrict').append(data.data.trn_district[0]);
                                }
                                    if(data.data.order_copy){
                                        $('#er_emp_order_copy').append(data.data.order_copy[0]);
                                }
                          }else{
                              swal("Error!", data.msg, "error");
                          }
                       }else if(data.type==2){
                           swal("Error!", data.msg, "error");
                       }else if(data.type==3){



                                 swal({
                                    title: 'Are you sure?',
                                    text: data.msg,
                                    type: 'warning',
                                    showCancelButton: true,
                                    confirmButtonColor: '#3085d6',
                                    cancelButtonColor: '#d33',
                                    confirmButtonText: "Yes",
                                    cancelButtonText: "No"
                                }).then((result) => {
                                      if (result.value) {
/*                                        Swal.fire(
                                          'Deleted!',
                                          'Your file has been deleted.',
                                          'success'
                                        )*/
                                          insertTransferData();
                                      }
                                })

                       }else{
                           insertTransferData();
                       }
                    },
                    error: function (jqXHR, textStatus, errorThrown) {


                    }
                });

        })


       function insertTransferData(){
               var myForm = document.getElementById('addEmployeeForm');
               var formData = new FormData(myForm);


                $.ajax({
                    type: "POST",
                    url: "<?php echo e(route('addEmployeeFormSubmit')); ?>",
                    dataType: 'json',
                    data: formData,
                    contentType: false,
                    cache: false,
                    processData: false,
                    success: function (data) {

                        $('.page-loader-wrapper').fadeOut();
                        if(data.msg=="validationFails"){
                           $.each(data.data, function (index, value) {
                                $('#error').append('<div class="alert alert-danger alert-dismissible" role="alert"><button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button><strong>Warning!</strong>'+value+'</div>');
                            });
                        }
                        if(data.msg=="success"){

                            $('#addEmployeeModel').modal('hide');
                            // $('.verification').DataTable().ajax.reload();
                                    $('.employeeList').DataTable().ajax.reload();

                                    Swal.fire(
                                          'Success!',
                                          'Employee Transfer Added.',
                                          'success'
                                        )

                        }if(data.msg="validationFails"){
                                    if(data.data.employee_name){
                                        $('#er_emp_name').append(data.data.employee_name[0]);
                                }
                                    if(data.data.level_id){
                                        $('#er_emp_lavel').append(data.data.level_id[0]);
                                }
                                    if(data.data.designation){
                                        $('#er_emp_des').append(data.data.designation[0]);
                                }
                                     if(data.data.district_id){
                                        $('#er_emp_dis').append(data.data.district_id[0]);
                                }
                                      if(data.data.trn_district){
                                        $('#er_emp_trdistrict').append(data.data.trn_district[0]);
                                }
                                    if(data.data.order_copy){
                                        $('#er_emp_order_copy').append(data.data.order_copy[0]);
                                }
                        }

                    },
                    error: function (jqXHR, textStatus, errorThrown) {


                    }
                });
       }



//********************************************************************************


        $('#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();
            get_level_by_block();
            $('.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();

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

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

        $('#lvl').on('change',function(e){
            e.preventDefault()
            var  selected_disg=$(this).val();
            $('#disg').empty();

            $('.page-loader-wrapper').fadeIn();
            $.ajax({
                type: "GET",
                url: "<?php echo e(route('get_disg_list')); ?>",
                data: {
                    disg_code: selected_disg
                },
                dataType: "json",
                success: function (data) {
                    $('#disg').empty();
                    $('#disg').append('<option value=""  selected>== Select Designation ==</option>');
                    if (data.msgType == true) {
                        $.each(data.data,function(key,value){
                            $('#disg').append('<option value=" '+value.id+' ">'+value.designation_name+'</option>');
                        });

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

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


        function get_level_by_block(){
            $('#level option:selected').removeAttr('selected');

            $("#level > option").each(function() {
                if(this.value=='3'){
                    $(this).attr("selected","selected");
                }
            });
            var  program=$('#program').val();
            var  level='3';
            get_designation_data(program,level)
        }

        function get_designation_data(program,level){
            $('.page-loader-wrapper').fadeIn();
            $.ajax({
                type: "GET",
                url: "<?php echo e(route('get_designation_by_program')); ?>",
                data: {
                    program: program,level:level
                },
                dataType: "json",
                success: function (data) {
                    $('#designation').empty();
                    $('#designation').append('<option value=""  selected>==== Select Designation ====</option>');
                    if (data.msgType == true) {
                        $.each(data.data,function(key,value){
                            $('#designation').append('<option value=" '+value.designation_id+' ">'+value.designation_name+'</option>');
                        });
                    }else{
                        /*toastr.error(data.msg);*/
                    }
                },
                error: function (jqXHR, textStatus, errorThrown) {

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

        $('.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('getPermanentEmployeeTransferList')); ?>",
                "data": function (d) {
                    d.dis_id=$('#district').val();
                    d.block_id=$('#block').val();
                    d.panchayat_id=$('#panchyat').val();
                    // d.program_id=$('#program').val();
                    // d.level_id=$('#level').val();
                    // d.des_id=$('#designation').val();
                    // d.ser_status=$('#service_status').val();
                }
            },
            "columns": [
                {data: 'DT_Row_Index', name: 'DT_Row_Index'},
                {"data": "permanent_employee_id",
                    // "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"},
                {"data": "d_name"},
                {"data": "b_name"},
                {"data": "gp_name"},

                {"data": "t_d_name"},
                {"data": "t_b_name"},
                {"data": "t_gp_name"},
                // {"data": "action"},
                // {"data": "date_of_joining"},
                // {"data": "home_dist"},
                // {"data": "home_blo"},
                // {"data": "home_town"},
                // {"data": "mobile"},
                {"data": "action"},


            ],



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

        });


        $(document).on('click','#profile_view',function(e){
            e.preventDefault();
            var code=$(this).attr('href');

            $('.code').empty();
            $('#name').empty();
            $('#designation_name').empty();
            $('#posted_district').empty();
            $('#posted_block').empty();
            $('#posted_gp').empty();
            $('#new_district').empty();
            $('#new_block').empty();
            $('#new_gp').empty();
            $('#status').empty();
            $('#remarks').empty();
            $('#order_date').empty();
			$('#ordercpy').empty();
            $.ajax({
                headers: {
                    'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                },
                type: "POST",
                url: "<?php echo e(route('permanentEmployeeProfile')); ?>",
                dataType: 'json',
                data: {'code': code},
                success: function (data) {
                    if (data.msg == 'success') {
                        $('#fluidModalTopWarningDemo').modal('show');
                        $('.code').append(data.data.permanent_employee_id);
                        $('#name').append(data.data.employee_name);
                        $('#designation_name').append(data.data.designation);
                        $('#posted_district').append(data.data.d_name);
                        $('#posted_block').append(data.data.b_name);
                        $('#posted_gp').append(data.data.gp_name);
                        $('#new_district').append(data.data.t_d_name);
                        $('#new_block').append(data.data.t_b_name);
                        $('#new_gp').append(data.data.t_gp_name);
                        $('#order_date').append(data.data.order_date);
                        if(data.data.status==1){
                            $('#status').css('color', 'green');
                           $('#status').append('Initiate');
                        }else if(data.data.status==2){
                            $('#status').css('color', 'red');
                           $('#status').append('Released')
                        }else if(data.data.status==3){
                            $('#status').css('color', 'red');
                           $('#status').append('Joined')
                        }else if(data.data.status==4){
                            $('#status').css('color', 'red');
                           $('#status').append('Conformed');
                        }else if(data.data.status==5){
                            $('#status').css('color', 'green');
                           $('#status').append('Canceled');
                        }else if(data.data.status==6){
                            $('#status').css('color', 'red');
                            $('#status').append('Death');
                        }else if(data.data.status==7){
                            $('#status').css('color', 'red');
                            $('#status').append('Unauthorized');
                        }

                        if(data.data.remarks){
                            // $('#designation_level').css('color', 'green');
                           $('#remarks').text(data.data.remarks);
                        }

						if(data.data.order_copy){
							$('#ordercpy').append('<a href="'+image_url+data.data.order_copy+'" target="_blank" class="btn btn-info btn-rounded btn-xsm" id="view" style="border-radius: 15px;">View</a>');
						}
                    }
                    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!',

                    })
                }
            })
        });

        $('#entryModel').on('click',function(e){
            e.preventDefault();
             $('#addEmployeeForm')[0].reset();
            $('#addEmployeeModel').modal({backdrop: 'static', keyboard: false});
        })

        $(document).on('click','#help',function(e){
            e.preventDefault();
            var des=$('#disg').val();
            var dist=$('#district1').val();
            var block=$('#block1').val();
            var gp=$('#panchyat1').val();
            var name=$('#emp_name').val();

            $.ajax({
                    headers: {
                        'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                    },
                    type: "POST",
                    url: "<?php echo e(route('permanentEmployeeHelp')); ?>",
                    dataType: 'json',
                    data: {'des': des,'dist':dist,'block':block,'gp':gp,'name':name},
                    success: function (data) {
                        if (data.msg == 'success') {
                        swal({
                        title: 'Are you sure?',
                        text: "Employee name is  "+data.data.employee_name,
                        type: 'warning',
                        showCancelButton: true,
                        confirmButtonColor: '#3085d6',
                        cancelButtonColor: '#d33',

                        confirmButtonText: "Insert Employee Code and Name",
                        cancelButtonText: "cancel"
                    }).then((result) => {
                        if (result.value)
                    {
                        $('#emp_code').val(data.data.employee_code);
                        $('#emp_name_help').val(data.data.employee_name);

                    }
                    })


                    }
                    if (data.msg == 'failed') {

                        Swal.fire({
                            type: 'error',
                            title: 'Oops...',
                            text: 'No data found'
                        })
                        }
                    },
                    error: function (jqXHR, textStatus, errorThrown) {

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

                        })
                    }
                })


        })

        $(document).on('click','#update',function(e){
            e.preventDefault();
            var id=$(this).attr('href');
            swal({
                        title: 'Are you sure?',
                        text: "You want to update main table",
                        type: 'warning',
                        showCancelButton: true,
                        confirmButtonColor: '#3085d6',
                        cancelButtonColor: '#d33',

                        confirmButtonText: "CONFIRM",
                        cancelButtonText: "CANCEL"
                    }).then((result) => {
                        if (result.value)
                    {
                        $.ajax({
                            headers: {
                                'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                            },
                            type: "POST",
                            url: "<?php echo e(route('permanentEmployeeUpdate')); ?>",
                            dataType: 'json',
                            data: {'id': id},
                            success: function (data) {
                                if (data.msg == 'success') {

                                     swal("Success!", "Thank you for update employee current posting", "success");
                                     $('.employeeList').DataTable().ajax.reload();
                                }
                                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('click','#revert',function(e){
            e.preventDefault();
            var id=$(this).attr('href');
            swal({
                        title: 'Are you sure?',
                        text: "You want to revert employee transfer",
                        type: 'warning',
                        showCancelButton: true,
                        confirmButtonColor: '#3085d6',
                        cancelButtonColor: '#d33',

                        confirmButtonText: "CONFIRM",
                        cancelButtonText: "CANCEL"
                    }).then((result) => {
                        if (result.value)
                    {
                        $.ajax({
                            headers: {
                                'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                            },
                            type: "POST",
                            url: "<?php echo e(route('permanentEmployeeRevert')); ?>",
                            dataType: 'json',
                            data: {'id': id},
                            success: function (data) {
                                if (data.msg == 'success') {

                                     swal("Success!", "Employee transfer revert success");
                                     $('.employeeList').DataTable().ajax.reload();
                                }
                                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!',

                                })
                            }
                        })
                    }
                })



        });

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

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