<?php

$page_name='U_DASHBOARD';

?>






<?php $__env->startSection('dynamic_css'); ?>
<link href="<?php echo asset('/plugins/bootstrap-material-datetimepicker/css/bootstrap-material-datetimepicker.css'); ?>" rel="stylesheet" />
    <style>
        select.form-control:not([size]):not([multiple]) {
            height: calc(2rem + 2px);
        }

        .modal-backdrop{
            display: contents;
        }
        @media (max-width: 768px)
        {

        }

        /*body{
    background: -webkit-linear-gradient(left, #3931af, #00c6ff);
}*/
        .emp-profile{
            /*padding: 3%;*/
            margin-top: 1%;
            margin-bottom: 1%;
            border-radius: 0.5rem;
            background: #fff;
        }
        .profile-img{
            text-align: center;

        }
        .profile-img img{
            width: 225px;
            height:200px;
        }
        .profile-img .file {
            position: relative;
            overflow: hidden;
            margin-top: -14%;
            width: 225px;
            border: none;
            border-radius: 0;
            font-size: 15px;
            background: #212529b8;
        }
        .profile-img .file input {
            position: absolute;
            opacity: 0;
            right: 0;
            top: 0;
        }
        .profile-head h5{
            color: #333;
        }
        .profile-head h6{
            color: #0062cc;
        }
        .profile-edit-btn{
            border: none;
            border-radius: 1.5rem;
            width: 70%;
            padding: 2%;
            font-weight: 600;
            color: #6c757d;
            cursor: pointer;
        }
        .proile-rating{
            font-size: 12px;
            color: #818182;
            margin-top: 5%;
        }
        .proile-rating span{
            color: #495057;
            font-size: 15px;
            font-weight: 600;
        }
        .profile-head .nav-tabs{
            margin-bottom:5%;
        }
        .profile-head .nav-tabs .nav-link{
            font-weight:600;
            border: none;
        }
        .profile-head .nav-tabs .nav-link.active{
            border: none;
            border-bottom:2px solid #0062cc;
        }
        .profile-work{
            padding: 14%;
            margin-top: -20%;
        }
        .profile-work p{
            font-size: 12px;
            color:white;
            font-weight: 600;
            margin-top: 10%;
            padding: 7px 5px;
            background-color: #1d93ae;
            box-shadow: 0px 1px 5px 0px #083c50;
        }
        .profile-work a{
            text-decoration: none;
            color:white;
            /*font-weight: 600;*/
            font-size: 14px;
            display: -webkit-box;
        }
        .profile-work ul{
            list-style: none;
        }
        .profile-tab label{
            font-weight: 600;
        }

        .profile-tab label{
            font-weight: 800;
            color: #0062cc;
        }

        .profile-tab .row{
            margin-top: 10px;
        }


        .nav-tabs .nav-item {
            margin-bottom: -1px;
            margin-top: 5px;
            margin-left: 5px;
            border-right: 1px solid white;
        }

        .full-width-tabs > ul.nav.nav-tabs {
            display: table;
            width: 100%;
            table-layout: fixed;
        }
        .full-width-tabs > ul.nav.nav-tabs > li {
            float: none;
            display: table-cell;
        }
        .full-width-tabs > ul.nav.nav-tabs > li > a {
            text-align: center;
        }


        .box_shadow{
            box-shadow: 0 2px 5px 0 rgba(0, 0, 0, .16), 0 2px 10px 0 rgba(0, 0, 0, .12);
        }

        .profile_padding_left{
            padding-left: 0px;
        }
        .mt0 {
            margin-top: 0px !important;
        }

        p{
           margin-bottom: .2rem;
           color: #3c3939;
        }
        .mt25{
            margin-top: 25px !important;
        }
    </style>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>
    <div class="container">
        <div class="row container_layout ">
            <div class="col-md-12">
                <div class="emp-profile">

                    <div class="row box_shadow">
                        <div class="col-md-4 profile_padding_left" style=" <!--background: linear-gradient(to bottom,#0d7c96 0,#c3dbe4 20%,#f3f4f9 50%,#bed9e2 70%,#0d7c96 100%);-->">

                            <div class="" style="background:#1a7395; height: 100%;padding: 3% 0%;">
                                <form method="post" id="upload_form" enctype="multipart/form-data">
                                    <div class="profile-img " style="">
                                        <input type="hidden" id="image_url" value="<?php echo e($global_data['config']->image_url); ?>">

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



                                        <?php if(!empty($employee_detail->photo_upload)): ?>

                                            <?php
                                             $user_image_url=storage_path()."\/app\/".$employee_detail->photo_upload;
                                            ?>

                 <!--                           <?php if(\File::exists($user_image_url)): ?>
                                              <?php echo e('yess'); ?>

                                            <?php else: ?>
                                              <?php echo e('nooo'); ?>

                                            <?php endif; ?>-->


                                            <?php if(file_exists($user_image_url)): ?>
                                                <img src="<?php echo e($global_data['config']->image_url.$employee_detail->photo_upload); ?>" id="img_source"  alt=""/>
                                            <?php else: ?>
                                                <img src="<?php echo e(asset('images/profile_pic.jpg')); ?>" id="img_source" alt=""/>
                                            <?php endif; ?>
                                        <?php else: ?>
                                          <img src="<?php echo e(asset('images/profile_pic.jpg')); ?>" id="img_source" alt=""/>
                                        <?php endif; ?>

                                        <div class="file btn btn-sm btn-primary" style="padding:5px;font-size:12px;background-color:rgba(66,65,167,0.55)!important;top:1px;">
                                            Change Photo
                                            <input type="file" name="image_file" id="image_file" accept="image/x-png,image/jpeg,image/jpg"/>
                                        </div>


                                        <input type="submit" name="upload" id="upload" value="Save changes" class="btn btn-info btn-sm" style="width:225px;"  />
                                    </div>


                                </form>
                                <div class="profile-work" style="<!--height: 348px;-->">
                                    <p>
                                        <i class="fa fa-info-circle fa-lg" aria-hidden="true"></i> EMPLOYEE INFO
                                    </p>
                                    <input type="hidden" id="employee_id" value="<?php echo e($employee_detail->employee_id); ?>">

                                    <a href="" class="mti5">
                                        <i class="fa fa-id-card" aria-hidden="true"></i>
                                        <span ><?php echo e($employee_detail->employee_code); ?></span>
                                    </a>
                                    <a href="" class="mti5">
                                        <i class="fa fa-birthday-cake" aria-hidden="true"></i>
                                        <span ><?php echo e($employee_detail->date_of_birth); ?></span>
                                    </a>
                                    <a href="" class="mti5">
                                        <i class="fa fa-phone-square" aria-hidden="true"></i>
                                        <span ><?php echo e($employee_detail->mobile); ?></span>
                                    </a>
                                    <a href="" class="mti5">
                                        <i class="fa fa-phone" aria-hidden="true"></i>
                                        <span ><?php echo e($employee_detail->alternate_mobile); ?></span>
                                    </a>
                                    <a href="" class="mti5">
                                        <i class="fa fa-envelope" aria-hidden="true"></i>
                                        <span ><?php echo e($employee_detail->email); ?></span>
                                    </a>

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

                        <div class="col-md-8" style="">
                            <div style="padding: 3% 0%;">
                                <div class="profilehead">
                                    <h5 class="text-uppercase"><?php echo e($employee_detail->employee_name); ?></h5>
                                    <h6 class="text-capitalize"><?php echo e($employee_detail->designation_name); ?></h6>
                                    <h7>
                                        <?php if(in_array($employee_detail->level_id, array(2,3,4))): ?>
                                            <span class="text-uppercase blue-text">District</span>
                                            <span class="text-uppercase">: <?php echo e($employee_detail->employee_district_name); ?></span>
                                        <?php endif; ?>
                                        <?php if(in_array($employee_detail->level_id, array(3,4))): ?>
                                            <span  class="text-uppercase blue-text"> Block </span>
                                            <span class="text-uppercase">: <?php echo e($employee_detail->employee_block_name); ?></span>

                                        <?php endif; ?>
                                        <?php if($employee_detail->level_id==4): ?>
                                            <span  class="text-uppercase blue-text"> Gram Panchayat </span>
                                            <span class="text-uppercase">: <?php echo e($employee_detail->gram_panchyat_name); ?></span>
                                        <?php endif; ?>

                                    </h7>
                                    <p class="proile-rating"></p>

                                    <div class="tabbable full-width-tabs">
                                        <ul class="nav nav-tabs" id="myTab" role="tablist" style="background: #349ac1;color:white;">
                                            <li class="nav-item">
                                                <a class="nav-link active " id="personal-tab" data-toggle="tab" href="#personal" role="tab" aria-controls="home" aria-selected="true">Personal <br> Details</a>
                                            </li>
                                            <li class="nav-item ">
                                                <a class="nav-link" id="contact-tab" data-toggle="tab" href="#contact" role="tab" aria-controls="profile" aria-selected="false">Contact <br> Details</a>
                                            </li>

                                            <li class="nav-item">
                                                <a class="nav-link" id="employment-tab" data-toggle="tab" href="#employment" role="tab" aria-controls="profile" aria-selected="false">Employment <br> Details</a>
                                            </li>
                                            <li class="nav-item ">
                                                <a class="nav-link" id="bank-tab" data-toggle="tab" href="#bank" role="tab" aria-controls="profile" aria-selected="false">Bank <br> Details</a>
                                            </li>
                                            <li class="nav-item ">
                                                <a class="nav-link" id="bank-tab" data-toggle="tab" href="#qualification" role="tab" aria-controls="qualification" aria-selected="false">Qualification <br> Details</a>
                                            </li>
                                        </ul>
                                    </div>
                                </div>
                                <div class="tab-content profile-tab mt10 pl5 pr5" id="myTabContent">
                                    <div class="tab-pane fade show active" id="personal" role="tabpanel" style="margin:10px;">
                                        <div class="row mt25">
                                            <div class="col-md-5">
                                                <label>Employee Code</label>
                                            </div>
                                            <div class="col-md-7">
                                                <span><?php echo e($employee_detail->employee_code); ?></span>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-md-5">
                                                <label>Employee Name</label>
                                            </div>
                                            <div class="col-md-7">
                                                <span><?php echo e($employee_detail->employee_name); ?></span>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-md-5">
                                                <label>Father's Name</label>
                                            </div>
                                            <div class="col-md-7">
                                                <span><?php echo e($employee_detail->father_name); ?></span>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-md-5">
                                                <label>Mother's Name</label>
                                            </div>
                                            <div class="col-md-7">
                                                <span><?php echo e($employee_detail->mother_name); ?></span>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-md-5">
                                                <label>Gender</label>
                                            </div>
                                            <div class="col-md-7">
                                                <span><?php echo e($employee_detail->gender); ?></span>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-md-5">
                                                <label>Date Of Birth</label>
                                            </div>
                                            <div class="col-md-7">
                                                <span><?php echo e($employee_detail->date_of_birth); ?></span>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-md-5">
                                                <label>Pan Number</label>
                                            </div>
                                            <div class="col-md-7">
                                                <span><?php echo e($employee_detail->pan_no); ?></span>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-md-5">
                                                <label>Adhar Number</label>
                                            </div>
                                            <div class="col-md-7">
                                                <span><?php echo e($employee_detail->adhar_no); ?></span>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="tab-pane fade" id="contact" role="tabpanel" aria-labelledby="contact-tab" style="padding: 0px;">
                                        <div id="mobile_details" style="padding: 5px;">
                                            <div class="row mt0" style="margin-top: 0px;">
                                                <div class="col-md-12">
                                                  <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('user_edit_contact_details')): ?>
                                                    <a href="#" id="change_mobile" title="edit" class="float-right"><i class="fa fa-edit fa-2x"></i></a>
                                                   <?php endif; ?>
                                                </div>
                                            </div>
                                            <div class="row">
                                                <div class="col-md-5">
                                                    <label>Home District</label>
                                                </div>
                                                <div class="col-md-7">
                                                    <span><?php echo e($employee_detail->employee_home_district_name); ?></span>
                                                </div>
                                            </div>
                                            <div class="row">
                                                <div class="col-md-5">
                                                    <label>Home Block</label>
                                                </div>
                                                <div class="col-md-7">
                                                    <span><?php echo e($employee_detail->employee_home_block_name); ?></span>
                                                </div>
                                            </div>
                                            <div class="row">
                                                <div class="col-md-5">
                                                    <label>Email</label>
                                                </div>
                                                <div class="col-md-7">
                                                    <span><?php echo e($employee_detail->email); ?></span>
                                                </div>
                                            </div>
                                            <div class="row">
                                                <div class="col-md-5">
                                                    <label>Mobile Number</label>
                                                </div>
                                                <div class="col-md-5">
                                                    <span><?php echo e($employee_detail->mobile); ?></span>
                                                </div>

                                            </div>
                                            <div class="row">
                                                <div class="col-md-5">
                                                    <label>Alternate Mobile Number</label>
                                                </div>
                                                <div class="col-md-7">
                                                    <span><?php echo e($employee_detail->alternate_mobile); ?></span>
                                                </div>
                                            </div>
                                            <div class="row">
                                                <div class="col-md-5">
                                                    <label>Permanent Address</label>
                                                </div>
                                                <div class="col-md-7">
                                                    <span><?php echo e($employee_detail->permanent_address); ?></span>
                                                </div>
                                            </div>
                                            <div class="row">
                                                <div class="col-md-5">
                                                    <label>Corespondance Address</label>
                                                </div>
                                                <div class="col-md-7">
                                                    <span><?php echo e($employee_detail->corespondance_address); ?></span>
                                                </div>
                                            </div>
                                        </div>
                                        <div id="change_mobile_form" style="padding: 5px;">
                                            <div class="row">
                                                <div class="col-md-12">
                                                    <hr>
                                                    <p style="color: #00bfa5">Your contact information update request is in under process.</p>
                                                    <hr>
                                                </div>

                                            </div>

                                            <div class="row">
                                                <div class="col-md-5">
                                                    <label>Mobile Number</label>
                                                </div>
                                                <div class="col-md-7">
                                                    <?php if(!empty($mob_change_req->mobile)): ?>
                                                        <span id="mobile_req"><?php echo e($mob_change_req->mobile); ?></span>
                                                    <?php else: ?>
                                                        <span id="mobile_req"></span>
                                                    <?php endif; ?>
                                                </div>
                                            </div>
                                            <div class="row">
                                                <div class="col-md-5">
                                                    <label>Alternate Mobile Number</label>
                                                </div>
                                                <div class="col-md-7">
                                                    <?php if(!empty($mob_change_req->alt_mobile)): ?>
                                                        <span id="alt_mobile_req"><?php echo e($mob_change_req->alt_mobile); ?></span>
                                                    <?php else: ?>
                                                        <span id="alt_mobile_req"></span>
                                                    <?php endif; ?>
                                                </div>
                                            </div>
                                            <div class="row" style="margin-left: -2px;">

                                                <button class="btn btn-warning btn-sm" id="mobile_back">cancel</button>

                                            </div>

                                        </div>
                                        <form id="mobile_edit" method="post">
                                            <?php echo e(csrf_field()); ?>

                                            <div id="edit_mobile_form" style="padding: 5px;">
                                                <div id="error_mobile">

                                                </div>
                                                <div class="row">
                                                    <div class="col-md-5">
                                                        <label>Mobile Number</label>
                                                    </div>
                                                    <div class="col-md-5">
                                                        <div class="form-group">
                                                            <input type="text" class="form-control" name="mobile_number" value="<?php echo e($employee_detail->mobile); ?>">

                                                        </div>
                                                    </div>

                                                </div>
                                                <div class="row">
                                                    <div class="col-md-5">
                                                        <label>Alternate Mobile Number</label>
                                                    </div>
                                                    <div class="col-md-5">
                                                        <div class="form-group">
                                                            <input type="text" class="form-control" name="alt_mobile" value="<?php echo e($employee_detail->alternate_mobile); ?>">

                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="row" style="margin-left: -2px;">
                                                    <input type="submit" class="btn btn-primary btn-sm" value="save">
                                                    <button class="btn btn-warning btn-sm" id="mobile_cancel">cancel</button>
                                                </div>
                                            </div>
                                        </form>
                                    </div>

                                    <div class="tab-pane fade" id="employment" role="tabpanel" aria-labelledby="employment-tab" style="padding: 0px;">
                                        <div class="row mt25">
                                            <div class="col-md-5">
                                                <label>Program</label>
                                            </div>
                                            <div class="col-md-7">
                                                <span><?php echo e($employee_detail->program_name); ?></span>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-md-5">
                                                <label>Level</label>
                                            </div>
                                            <div class="col-md-7">
                                                <span><?php echo e($employee_detail->level); ?></span>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-md-5">
                                                <label>Designation</label>
                                            </div>
                                            <div class="col-md-7">
                                                <span><?php echo e($employee_detail->designation_name); ?></span>
                                            </div>
                                        </div>
                                        <?php if(in_array($employee_detail->level_id, array(2,3,4))): ?>
                                            <div class="row">
                                                <div class="col-md-5">
                                                    <label>District</label>
                                                </div>
                                                <div class="col-md-7">
                                                    <span><?php echo e($employee_detail->employee_district_name); ?></span>
                                                </div>
                                            </div>
                                        <?php endif; ?>
                                        <?php if(in_array($employee_detail->level_id, array(3,4))): ?>
                                            <div class="row">
                                                <div class="col-md-5">
                                                    <label>Block</label>
                                                </div>
                                                <div class="col-md-7">
                                                    <span><?php echo e($employee_detail->employee_block_name); ?></span>
                                                </div>
                                            </div>
                                        <?php endif; ?>
                                        <?php if($employee_detail->level_id==4): ?>
                                            <div class="row">
                                                <div class="col-md-5">
                                                    <label>Gram Panchayat</label>
                                                </div>
                                                <div class="col-md-7">
                                                    <span><?php echo e($employee_detail->gram_panchyat_name); ?></span>
                                                </div>
                                            </div>
                                        <?php endif; ?>
                                        <div class="row">
                                            <div class="col-md-5">
                                                <label>Date Of Joining</label>
                                            </div>
                                            <div class="col-md-7">
                                                <span><?php echo e($employee_detail->date_of_joining); ?></span>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-md-5">
                                                <label>Salary</label>
                                            </div>
                                            <div class="col-md-7">
                                                <span><?php echo e($employee_detail->salary); ?>/-</span>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-md-5">
                                                <label>Service Status</label>
                                            </div>
                                            <div class="col-md-7">
                                                <span><?php echo e($employee_detail->status_name); ?></span>
                                            </div>
                                        </div>
                                        <hr class="mb0">
                                        <?php
                                                 $contract_start_date='';
                                                 $contract_exp_days=0;
                                                 if($employee_detail->contract_end){
                                                     $contract_end_date=\Carbon\Carbon::parse($employee_detail->contract_end);
                                                     $contract_start_date=$contract_end_date->addDays(2)->format('Y-m-d');

                                                     $now = \Carbon\Carbon::now();
                                                     if($contract_end_date>$now){

                                                         $contract_exp_days = $contract_end_date->diffInDays($now);
                                                     }
                                                 }


                                        ?>


                                        <div id="contract" style="padding: 5px;">
                                            <div class="row mt0" style="margin-top: 0px;">
                                                <div class="col-md-10">
                                                 <?php if($contract_exp_days!=0): ?>
                                                  <span class="orange-text f-18"><b>Your current contract will expire in <?php echo e($contract_exp_days); ?> days.</b></span>
                                                 <?php else: ?>
                                                   <span class="red-text f-18">Your contract is expired. Please upload your new contract</span>
                                                 <?php endif; ?>
                                                </div>

                                                <div class="col-md-2">
                                                  <?php if(30>$contract_exp_days || $global_data['config']->contract_upload_option==1): ?>
                                                     <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('user_edit_employment_details')): ?>
                                                       <a href="#" id="change_contract" class="float-right" title="edit "><i class="fa fa-edit fa-2x"></i></a>
                                                     <?php endif; ?>
                                                  <?php endif; ?>
                                                </div>
                                            </div>
                                            <div class="row">
                                                <div class="col-md-5">
                                                    <label>Contract Start</label>
                                                </div>
                                                <div class="col-md-7">
                                                    <span><?php echo e($employee_detail->contract_start); ?></span>
                                                </div>
                                            </div>
                                            <div class="row">
                                                <div class="col-md-5">
                                                    <label>Contract End</label>
                                                </div>
                                                <div class="col-md-7">
                                                    <span><?php echo e($employee_detail->contract_end); ?></span>
                                                </div>
                                            </div>
                                             <div class="row">
                                                <div class="col-md-5">
                                                    <label>Contract Sign With</label>
                                                </div>
                                                <div class="col-md-7">
                                                    <span><?php echo e($employee_detail->contract_sign_with); ?></span>
                                                </div>
                                            </div>
                                            <div class="row">
                                                <div class="col-md-5">
                                                    <label>Contract File</label>
                                                </div>
                                                <div class="col-md-7">
                                                     <?php if(!empty($employee_detail->recent_aggrement)): ?>
                                                       <?php if($employee_detail->contract_upload==1): ?>
                                                            <span><a href="<?php echo e($global_data['config']->image_url.'old_contract/'.$employee_detail->recent_aggrement); ?>" style="margin-top: -17px;" class=""  target="_blank">
                                                                <i class="fa fa-eye fa-2x" aria-hidden="true"></i>
                                                                </a>
                                                            </span>
                                                       <?php else: ?>
                                                            <span ><a href="<?php echo e($global_data['config']->image_url.$employee_detail->recent_aggrement); ?>" style="margin-top: -17px;" class=""  target="_blank">
                                                                <i class="fa fa-eye fa-2x" aria-hidden="true"></i>
                                                                </a>
                                                            </span>
                                                       <?php endif; ?>

                                                    <?php endif; ?>
                                                </div>
                                            </div>
<!--                                                <div class="col-md-2">
                                                    <a href="#" id="change_contract" class="float-right" title="edit "><i class="fa fa-edit fa-2x"></i></a>
                                                </div>-->

                                        </div>
                                        <div id="contract_form" style="padding: 5px;">
                                            <form method="post" id="contract_upload">
                                                <div id="error_contract">

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



                                                <div class="row">
                                                    <div class="col-md-5">
                                                        <label>Contract From</label>
                                                    </div>
                                                    <div class="col-md-7">
                                                        <div class="form-group">
                                                            <input type="text" class="form-control" name="from_date" id="from_date" value="<?php echo e($contract_start_date); ?>" placeholder="YYYY-MM-DD" required>
                                                        </div>

                                                    </div>

                                                </div>
                                                <div class="row">
                                                    <div class="col-md-5">
                                                        <label>Contract To</label>
                                                    </div>
                                                    <div class="col-md-7">
                                                        <div class="form-group">
                                                            <input type="text" class="form-control" name="to_date" id="to_date" placeholder="YYYY-MM-DD" required>
                                                        </div>

                                                    </div>

                                                </div>


                                                <div class="row">
                                                    <div class="col-md-5">
                                                        <label>Contract Sign With</label>
                                                    </div>
                                                    <div class="col-md-7">
                                                        <div class="form-group">
                                                            <!--<input type="text" class="form-control" name="contract_sign" required>-->
                                                     <select class="form-control form-control-sm" id="contract_sign"
                                                            name="contract_sign" required>
                                                        <option value="" selected disabled>======= Select =======</option>
                                                        <option value="Director SIPRD">Director SIPRD</option>
                                                        <option value="Commissioner PNRD">Commissioner PNRD</option>
                                                        <?php if($employee_detail->level_id!=1): ?>
                                                               <option value="CEO">CEO</option>
                                                               <option value="PD">PD</option>
                                                           <?php if($employee_detail->level_id==3): ?>
                                                               <option value="BDO">BDO</option>
                                                           <?php endif; ?>
                                                           <?php if($employee_detail->level_id==4): ?>
                                                               <option value="GP Secretary">GP Secretary</option>
                                                           <?php endif; ?>
                                                         <?php endif; ?>
                                                    </select>
                                                        </div>

                                                    </div>
                                                </div>
                                                <div class="row">
                                                    <div class="col-md-5">
                                                        <label>Upload Contract</label>
                                                    </div>
                                                    <div class="col-md-7" style="margin-top: -18px;">

                                                        <div class="file btn btn-sm btn-primary" style="padding:5px;font-size:12px;background-color:rgba(66,65,167,0.55)!important;top:1px;">
                                                            Upload file
                                                            <input type="file" name="contract_file" required>
                                                        </div>

                                                    </div>
                                                </div>


                                                <input type="submit" class="btn btn-info btn-sm" name="submit" value="save">
                                                <a href="#" id="cancel_contract" class="btn btn-warning btn-sm" >Cancel</a>


                                            </form>
                                        </div>
                                        <div id="change_contract_form" style="padding: 5px;">
                                            <div class="row">
                                                <div class="col-md-12">

                                                    <p style="color: #00bfa5">Your contract information update request is in under process.</p>
                                                    <hr>

                                                </div>

                                            </div>

                                            <div class="row">
                                                <div class="col-md-5">
                                                    <label>Contract From</label>
                                                </div>
                                                <div class="col-md-7">
                                                    <?php if(!empty($con_change_req->contract_from)): ?>
                                                        <span id="contract_from_req"><?php echo e($con_change_req->contract_from); ?></span>
                                                    <?php else: ?>
                                                        <span id="contract_from_req"></span>
                                                    <?php endif; ?>
                                                </div>
                                            </div>
                                            <div class="row">
                                                <div class="col-md-5">
                                                    <label>Contract To</label>
                                                </div>
                                                <div class="col-md-7">
                                                    <?php if(!empty($con_change_req->contract_to)): ?>
                                                        <span id="contract_to_req"><?php echo e($con_change_req->contract_to); ?></span>
                                                    <?php else: ?>
                                                        <span id="contract_to_req"></span>
                                                    <?php endif; ?>
                                                </div>
                                            </div>
                                            <div class="row">
                                                <div class="col-md-5">
                                                    <label>Contract Sign With</label>
                                                </div>
                                                <div class="col-md-7">
                                                    <?php if(!empty($con_change_req->contract_sign_with)): ?>
                                                        <span id="contract_sign_req"><?php echo e($con_change_req->contract_sign_with); ?></span>
                                                    <?php else: ?>
                                                        <span id="contract_sign_req"></span>
                                                    <?php endif; ?>
                                                </div>
                                            </div>
                                            <div class="row">
                                                <div class="col-md-5">
                                                    <label>Contract File</label>
                                                </div>
                                                <div class="col-md-7">
                                                    <?php if(!empty($con_change_req->contract_url)): ?>
                                                        <span id="contract_url_req"><a href="<?php echo e($global_data['config']->image_url.$con_change_req->contract_url); ?>" style="margin-top: -17px;" class=""  target="_blank"><i class="fa fa-eye fa-2x" aria-hidden="true"></i></a></span>
                                                    <?php else: ?>
                                                        <span id="contract_url_req"></span>
                                                    <?php endif; ?>

                                                </div>
                                            </div>
                                            <div class="row" style="margin-left: -2px;">

                                                <button class="btn btn-warning btn-sm" id="contract_back">cancel</button>

                                            </div>

                                        </div>

                                    </div>

                                    <div class="tab-pane fade" id="bank" role="tabpanel" aria-labelledby="bank-tab" style="padding: 0">
                                        <div id="bank_form" style="padding: 5px;">
                                            <div class="row mt0" style="margin-top: 0px;">
                                                <div class="col-md-12">
                                                   <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('user_edit_bank_details')): ?>
                                                    <a href="#" id="change_bank" class="float-right" title="edit "><i class="fa fa-edit fa-2x"></i></a>
                                                   <?php endif; ?>
                                                </div>
                                            </div>
                                            <div class="row">
                                                <div class="col-md-5">
                                                    <label>Bank Name</label>
                                                </div>
                                                <div class="col-md-7">
                                                    <span><?php echo e($employee_detail->bank_name); ?></span>
                                                </div>
                                            </div>
                                            <div class="row">
                                                <div class="col-md-5">
                                                    <label>Ifsc</label>
                                                </div>
                                                <div class="col-md-7">
                                                    <span><?php echo e($employee_detail->ifsc_code); ?></span>
                                                </div>
                                            </div>
                                            <div class="row">
                                                <div class="col-md-5">
                                                    <label>Account Number</label>
                                                </div>
                                                <div class="col-md-7">
                                                    <span><?php echo e($employee_detail->account_no); ?></span>
                                                </div>
                                            </div>
                                            <div class="row">
                                                <div class="col-md-5">
                                                    <label>Passbook</label>
                                                </div>
                                                <?php if(!empty($employee_detail->pass_book)): ?>
                                                <div class="col-md-7">
                                                    <a href="<?php echo e($global_data['config']->image_url.$employee_detail->pass_book); ?>" target="blank"><i class="fa fa-eye fa-2x"></i></a>
                                                </div>
                                                <?php else: ?>

                                                <a href=""  target="blank"><i class="fa fa-eye fa-2x"></i></a>

                                                <?php endif; ?>

                                            </div>

                                        </div>
                                        <div id="change_bank_form" style="padding: 5px;">
                                            <div class="row">
                                                <div class="col-md-12">
                                                    <hr>
                                                    <p style="color: #00bfa5">Your bank information update request is in under process.</p>
                                                    <hr>
                                                </div>

                                            </div>
                                            <div class="row">
                                                <div class="col-md-5">
                                                    <label>Bank Name</label>
                                                </div>
                                                <div class="col-md-5">
                                                    <?php if(!empty($mob_change_req->bank_name)): ?>
                                                        <span id="bank_name_req"><?php echo e($mob_change_req->bank_name); ?></span>
                                                    <?php else: ?>
                                                        <span id="bank_name_req"></span>

                                                    <?php endif; ?>


                                                </div>

                                            </div>
                                            <div class="row">
                                                <div class="col-md-5">
                                                    <label>Ifsc</label>

                                                </div>
                                                <div class="col-md-7">
                                                    <?php if(!empty($mob_change_req->ifsc_code)): ?>
                                                        <span id="ifsc_req"><?php echo e($mob_change_req->ifsc_code); ?></span>
                                                    <?php else: ?>
                                                        <span id="ifsc_req"></span>
                                                    <?php endif; ?>
                                                </div>
                                            </div>
                                            <div class="row">
                                                <div class="col-md-5">
                                                    <label>Account Number</label>
                                                </div>
                                                <div class="col-md-7">
                                                    <?php if(!empty($mob_change_req->account_no)): ?>
                                                        <span id="account_req"><?php echo e($mob_change_req->account_no); ?></span>
                                                    <?php else: ?>
                                                        <span id="account_req"></span>
                                                    <?php endif; ?>
                                                </div>
                                            </div>

                                            <div class="row">
                                                <div class="col-md-5">
                                                    <label>Pass Book</label>
                                                </div>
                                                <div class="col-md-7">
                                                    <?php if(!empty($mob_change_req->pass_book)): ?>

                                                        <a href="<?php echo e($global_data['config']->image_url.$mob_change_req->pass_book); ?>" id="passbook" target="blank"><i class="fa fa-eye fa-2x"></i></a>
                                                    <?php else: ?>
                                                    <a href="" id="passbook" target="blank"><i class="fa fa-eye fa-2x"></i></a>
                                                    <?php endif; ?>
                                                </div>
                                            </div>

                                            <div class="row" style="margin-left: -2px;">

                                                <button class="btn btn-warning btn-sm" id="bank_back" >cancel</button>

                                            </div>

                                        </div>
                                        <form id="bank_edit" method="post">
                                            <?php echo e(csrf_field()); ?>

                                            <div id="edit_bank_form" style="padding: 5px;">
                                                <div id="error">

                                                </div>
                                                <div class="row">
                                                    <div class="col-md-5">
                                                        <label>Bank Name*</label>
                                                    </div>
                                                    <div class="col-md-5">
                                                        <div class="form-group">
                                                            <input type="text" class="form-control" value="<?php echo e($employee_detail->bank_name); ?>" name="bank_name" required>

                                                        </div>
                                                    </div>

                                                </div>
                                                <div class="row">
                                                    <div class="col-md-5">
                                                        <label>IfsFDDDFDSc*</label>
                                                    </div>
                                                    <div class="col-md-5">
                                                        <div class="form-group">
                                                            <input type="text" class="form-control" name="ifsc" value="<?php echo e($employee_detail->ifsc_code); ?>" required>

                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="row">
                                                    <div class="col-md-5">
                                                        <label>Account Number*</label>
                                                    </div>
                                                    <div class="col-md-5">
                                                        <div class="form-group">
                                                            <input type="text" class="form-control" value="<?php echo e($employee_detail->account_no); ?>" name="account_number" required>

                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="row">
                                                    <div class="col-md-5">
                                                        <label>Upload Passbook* <span style="font-size: 8px;
                                                            color: red;">(Only pdf jpg docs are allowed)</span></label>
                                                    </div>
                                                    <div class="col-md-5">
                                                        <div class="form-group">
                                                            <input type="file" class="form-control" name="passbook" required>

                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="row" style="margin-left: -2px;">
                                                    <input type="submit" class="btn btn-primary btn-sm" value="save">
                                                    <button class="btn btn-warning btn-sm" id="bank_cancel">cancel</button>

                                                </div>

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

                                    <div class="tab-pane fade" id="qualification" role="tabpanel" aria-labelledby="bank-tab" style="padding: 0">
                                        <div id="qualification_view" style="padding: 5px;">
                                            <div class="row mt0" style="margin-top: 0px;">
                                                <div class="col-md-12">
                                                  <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('user_edit_qualification_details')): ?>
                                                    <a href="#" id="qualification_edit_btn" class="float-right" title="edit "><i class="fa fa-edit fa-2x"></i></a>
                                                  <?php endif; ?>
                                                </div>
                                            </div>
                                            <div class="row mt0">
                                                    <div class="col-sm-2">
                                                        <label for="hslc_board"><b style="color: red;">*</b>
                                                            <span style="color:#349ac1">HSLC</span>
                                                        </label>
                                                    </div>

                                                    <div class="col-sm-3 offset-md-3">
                                                        <div class="form-group">
                                                            <label for="hslc_board">Board/University</label>
                                                            <p id="hslc_board_v"></p>

                                                        </div>
                                                    </div>
                                                    <div class="col-sm-2">
                                                        <div class="form-group">
                                                            <label for="hslc_pass_year">Year</label>
                                                            <p id="hslc_pass_year_v"></p>

                                                        </div>
                                                    </div>
                                                    <div class="col-sm-2">
                                                        <div class="form-group">
                                                            <label for="hslc_per">Percentage</label>
                                                            <p id="hslc_per_v"></p>
                                                        </div>
                                                    </div>
                                            </div>

                                            <div class="row mt0">
                                                <div class="col-sm-2">
                                                    <label><b style="color: red;">*</b><span style="color:#349ac1">HS</span></label>
                                                </div>
                                                <div class="col-sm-3">
                                                    <div class="form-group">
                                                        <label for="hs_stream">Stream</label>
                                                        <p id="hs_stream_v"></p>
                                                    </div>
                                                </div>
                                                <div class="col-sm-3">
                                                    <div class="form-group">
                                                        <label for="hs_board">Board/University</label>
                                                        <p id="hs_board_v"></p>

                                                    </div>
                                                </div>

                                                <div class="col-sm-2">
                                                    <div class="form-group">
                                                        <label for="hsslc_pass_year">Year</label>
                                                        <p id="hs_pass_year_v"></p>

                                                    </div>
                                                </div>
                                                <div class="col-sm-2">
                                                    <div class="form-group">
                                                        <label for="hs_per">Percentage</label>
                                                        <p id="hs_per_v"></p>
                                                    </div>
                                                </div>
                                            </div>

                                            <div class="row mt0">
                                                <div class="col-sm-2">
                                                    <label><b style="color: red;">*</b><span style="color:#349ac1">Graduation</span></label>
                                                </div>
                                                <div class="col-sm-3">
                                                    <div class="form-group">
                                                        <label for="ug_course">Course</label>
                                                        <p id="ug_course_v"></p>
                                                    </div>
                                                </div>
                                                <div class="col-sm-3">
                                                    <div class="form-group">
                                                        <label for="ug_board">Board/University</label>
                                                        <p id="ug_board_v"></p>

                                                    </div>
                                                </div>

                                                <div class="col-sm-2">
                                                    <div class="form-group">
                                                        <label for="ug_pass_year">Year</label>
                                                        <p id="ug_pass_year_v"></p>

                                                    </div>
                                                </div>
                                                <div class="col-sm-2">
                                                    <div class="form-group">
                                                        <label for="ug_per">Percentage</label>
                                                        <p id="ug_per_v"></p>
                                                    </div>
                                                </div>
                                            </div>

                                            <div class="row mt0">
                                                <div class="col-sm-2">
                                                    <label><span style="color:#349ac1">Post Graduation</span></label>
                                                </div>
                                                <div class="col-sm-3">
                                                    <div class="form-group">
                                                        <label for="pg_course">Course</label>
                                                        <p id="pg_course_v"></p>
                                                    </div>
                                                </div>
                                                <div class="col-sm-3">
                                                    <div class="form-group">
                                                        <label for="pg_board">Board/University</label>
                                                        <p id="pg_board_v"></p>

                                                    </div>
                                                </div>

                                                <div class="col-sm-2">
                                                    <div class="form-group">
                                                        <label for="pg_pass_year">Year</label>
                                                        <p id="pg_pass_year_v"></p>

                                                    </div>
                                                </div>
                                                <div class="col-sm-2">
                                                    <div class="form-group">
                                                        <label for="pg_per">Percentage</label>
                                                        <p id="pg_per_v"></p>
                                                    </div>
                                                </div>
                                            </div>

                                            <div class="row mt0">
                                                <div class="col-sm-2">
                                                    <label><span style="color:#349ac1">Others</span></label>
                                                </div>
                                                <div class="col-sm-3">
                                                    <div class="form-group">
                                                        <label for="ot_course">Course</label>
                                                        <p id="ot_course_v"></p>
                                                    </div>
                                                </div>
                                                <div class="col-sm-3">
                                                    <div class="form-group">
                                                        <label for="ot_board">Board/University</label>
                                                        <p id="ot_board_v"></p>

                                                    </div>
                                                </div>

                                                <div class="col-sm-2">
                                                    <div class="form-group">
                                                        <label for="ot_pass_year">Year</label>
                                                        <p id="ot_pass_year_v"></p>

                                                    </div>
                                                </div>
                                                <div class="col-sm-2">
                                                    <div class="form-group">
                                                        <label for="ot_per">Percentage</label>
                                                        <p id="ot_per_v"></p>
                                                    </div>
                                                </div>
                                            </div>

                                        </div>
                                        <div id="qualification_edit" style="padding: 5px;">
                                                <form  method="post" id="qualification_edit_form">
                                                    <?php echo e(csrf_field()); ?>

                                                    <div  style="padding: 5px;">
                                                        <div id="error">

                                                        </div>
                                                        <div class="row mt0">
                                                                <div class="col-sm-2">
                                                                    <label for="hslc_board"><b style="color: red;">*</b><span style="color:#349ac1"> HSLC</span></label>
                                                                </div>

                                                                <div class="col-sm-3 offset-md-3">
                                                                    <div class="form-group">
                                                                        <label for="hslc_board">Board/University</label>
                                                                        <input name="hslc_board" type="text" id="hslc_board" class="form-control" placeholder="" />

                                                                    </div>
                                                                </div>
                                                                <div class="col-sm-2">
                                                                    <div class="form-group">
                                                                        <label for="hslc_pass_year">Year</label>
                                                                        <select name="hslc_pass_year" id="hslc_pass_year" class="form-control">
                                                                            <option value="">---Year---</option>
                                                                            <?php for ($i = 1950; $i <= 2018; $i++) { ?>
                                                                                <option value="<?php echo $i; ?>"> <?php echo $i; ?> </option>
                                                                            <?php } ?>
                                                                        </select>

                                                                    </div>
                                                                </div>
                                                                <div class="col-sm-2">
                                                                    <div class="form-group">
                                                                        <label for="hslc_per">Percentage</label>
                                                                        <input name="hslc_per" type="text" id="hslc_per" class="form-control" placeholder="" />
                                                                    </div>
                                                                </div>
                                                        </div>

                                                        <div class="row mt0">
                                                            <div class="col-sm-2">
                                                                <label><b style="color: red;">*</b><span style="color:#349ac1">HS</span></label>
                                                            </div>
                                                            <div class="col-sm-3">
                                                                <div class="form-group">
                                                                    <label for="hs_stream">Stream</label>
                                                                    <select name="hs_stream" id="hs_stream" class="form-control">
                                                                        <option value="" style="display:none">--Stream--</option>
                                                                        <option value="ARTS">Arts</option>
                                                                        <option value="SCIENCE">Science</option>
                                                                        <option value="COMMERCE">Commerce</option>
                                                                    </select>
                                                                </div>
                                                            </div>
                                                            <div class="col-sm-3">
                                                                <div class="form-group">
                                                                    <label for="hs_board">Board/University</label>
                                                                    <input name="hs_board" type="text" id="hs_board" class="form-control" placeholder="" />

                                                                </div>
                                                            </div>

                                                            <div class="col-sm-2">
                                                                <div class="form-group">
                                                                    <label for="hsslc_pass_year">Year</label>
                                                                    <select name="hs_pass_year" id="hs_pass_year" class="form-control">
                                                                        <option value="">---Year---</option>
                                                                        <?php for ($i = 1950; $i <= 2019; $i++) { ?>
                                                                            <option value="<?php echo $i; ?>"> <?php echo $i; ?> </option>
                                                                        <?php } ?>
                                                                    </select>

                                                                </div>
                                                            </div>
                                                            <div class="col-sm-2">
                                                                <div class="form-group">
                                                                    <label for="hs_per">Percentage</label>
                                                                    <input name="hs_per" type="text" id="hs_per" class="form-control" placeholder="" />
                                                                </div>
                                                            </div>
                                                        </div>

                                                        <div class="row mt0">
                                                            <div class="col-sm-2">
                                                                <label><b style="color: red;">*</b><span style="color:#349ac1">Graduation</span></label>
                                                            </div>
                                                            <div class="col-sm-3">
                                                                <div class="form-group">
                                                                    <label for="ug_course">Course</label>
                                                                    <input name="ug_course" type="text" id="ug_course" class="form-control" placeholder="" />
                                                                </div>
                                                            </div>
                                                            <div class="col-sm-3">
                                                                <div class="form-group">
                                                                    <label for="ug_board">Board/University</label>
                                                                    <input name="ug_board" type="text" id="ug_board" class="form-control" placeholder="" />

                                                                </div>
                                                            </div>

                                                            <div class="col-sm-2">
                                                                <div class="form-group">
                                                                    <label for="ug_pass_year">Year</label>
                                                                    <select name="ug_pass_year" id="ug_pass_year" class="form-control">
                                                                        <option value="">---Year---</option>
                                                                        <?php for ($i = 1950; $i <= 2019; $i++) { ?>
                                                                            <option value="<?php echo $i; ?>"> <?php echo $i; ?> </option>
                                                                        <?php } ?>
                                                                    </select>

                                                                </div>
                                                            </div>
                                                            <div class="col-sm-2">
                                                                <div class="form-group">
                                                                    <label for="ug_per">Percentage</label>
                                                                    <input name="ug_per" type="text" id="ug_per" class="form-control" placeholder="" />
                                                                </div>
                                                            </div>
                                                        </div>

                                                        <div class="row mt0">
                                                            <div class="col-sm-2">
                                                                <label><b style="color: red;"></b><span style="color:#349ac1">Post Graduation</span></label>
                                                            </div>
                                                            <div class="col-sm-3">
                                                                <div class="form-group">
                                                                    <label for="pg_course">Course</label>
                                                                    <input name="pg_course" type="text" id="pg_course" class="form-control" placeholder="" />
                                                                </div>
                                                            </div>
                                                            <div class="col-sm-3">
                                                                <div class="form-group">
                                                                    <label for="pg_board">Board/University</label>
                                                                    <input name="pg_board" type="text" id="pg_board" class="form-control" placeholder="" />

                                                                </div>
                                                            </div>

                                                            <div class="col-sm-2">
                                                                <div class="form-group">
                                                                    <label for="pg_pass_year">Year</label>
                                                                    <select name="pg_pass_year" id="pg_pass_year" class="form-control">
                                                                        <option value="">---Year---</option>
                                                                        <?php for ($i = 1950; $i <= 2019; $i++) { ?>
                                                                            <option value="<?php echo $i; ?>"> <?php echo $i; ?> </option>
                                                                        <?php } ?>
                                                                    </select>

                                                                </div>
                                                            </div>
                                                            <div class="col-sm-2">
                                                                <div class="form-group">
                                                                    <label for="pg_per">Percentage</label>
                                                                    <input name="pg_per" type="text" id="pg_per" class="form-control" placeholder="" />
                                                                </div>
                                                            </div>
                                                        </div>

                                                        <div class="row mt0">
                                                            <div class="col-sm-2">
                                                                <label><b style="color: red;"></b><span style="color:#349ac1">Others</span></label>
                                                            </div>
                                                            <div class="col-sm-3">
                                                                <div class="form-group">
                                                                    <label for="ot_course">Course</label>
                                                                    <input name="ot_course" type="text" id="ot_course" class="form-control" placeholder="" />
                                                                </div>
                                                            </div>
                                                            <div class="col-sm-3">
                                                                <div class="form-group">
                                                                    <label for="ot_board">Board/University</label>
                                                                    <input name="ot_board" type="text" id="ot_board" class="form-control" placeholder="" />

                                                                </div>
                                                            </div>

                                                            <div class="col-sm-2">
                                                                <div class="form-group">
                                                                    <label for="ot_pass_year">Year</label>
                                                                    <select name="ot_pass_year" id="ot_pass_year" class="form-control">
                                                                        <option value="">---Year---</option>
                                                                        <?php for ($i = 1950; $i <= 2019; $i++) { ?>
                                                                            <option value="<?php echo $i; ?>"> <?php echo $i; ?> </option>
                                                                        <?php } ?>
                                                                    </select>

                                                                </div>
                                                            </div>
                                                            <div class="col-sm-2">
                                                                <div class="form-group">
                                                                    <label for="ot_per">Percentage</label>
                                                                    <input name="ot_per" type="text" id="ot_per" class="form-control" placeholder="" />
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <div class="row" style="margin-left: -2px;">
                                                            <input type="submit" class="btn btn-primary btn-sm" value="save">
                                                            <button class="btn btn-warning btn-sm" id="qualification_edit_btn_cancel">cancel</button>

                                                        </div>

                                                    </div>
                                                </form>

                                        </div>

                                    </div>


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



                    </div>

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

    </div>


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




<?php $__env->startSection('dynamic_js'); ?>

    <!-- script for image -->
<script src="<?php echo e(asset('js/lib/moment.min.js')); ?>"></script>
<script src="<?php echo e(asset('plugins/bootstrap-material-datetimepicker/js/bootstrap-material-datetimepicker.js')); ?>"></script>

    <script>


      var form_date=moment(new Date()).subtract(362, 'day').format();
      var to_date=moment(new Date()).add(1, 'day').format();
      if($('#from_date').val()){
          form_date=$('#from_date').val();
          to_date=moment(new Date(form_date)).add(1, 'day').format();
      }


        $('#to_date').bootstrapMaterialDatePicker({
            weekStart: 0,
            format: 'YYYY-MM-DD',
            clearButton: true,
            time: false,
            minDate:new Date(to_date)
        }).on('change', function (e, date) {
            var newminDate=new Date(moment(date).subtract(363, 'day').format());
            console.log(newminDate);
            $('#from_date').bootstrapMaterialDatePicker('setMaxDate',date );
            $('#from_date').bootstrapMaterialDatePicker('setMinDate', newminDate);
        });



        $('#from_date').bootstrapMaterialDatePicker({
            weekStart: 0,
            format: 'YYYY-MM-DD',
            clearButton: true,
            time: false,
            minDate:new Date(form_date)
        }).on('change', function (e, date) {
            var newmaxDate=new Date(moment(date).add(364, 'day').format());
            $('#to_date').bootstrapMaterialDatePicker('setMaxDate',newmaxDate );
            $('#to_date').bootstrapMaterialDatePicker('setMinDate', new Date(moment(new Date()).add(1, 'day').format()));
        });









        function readURL(input) {
            if (input.files && input.files[0]) {
                var reader = new FileReader();

                reader.onload = function(e) {
                    $('#img_source').attr('src', e.target.result);
                }

                reader.readAsDataURL(input.files[0]);
            }
        }

        $("#image_file").change(function() {

            var file = this.files[0];
            var image_size=(file.size);
            var fileType = file["type"];
            var validImageTypes = ["image/jpg", "image/jpeg", "image/png"];

            if(image_size <= 1000000 && $.inArray (fileType, validImageTypes) > 0) {
                readURL(this);
                $('#upload').show();
            }else{
                Swal.fire({
                    type: 'error',
                    title: 'Oops...',
                    text: 'Uploaded file is not a valid image. Only JPG, PNG and JPEG files are allowed and max size 1mb !',

                })

            }
        });

        //script for image end



        $(document).ready(function(){
            $('#upload').hide();

            $('#upload_form').on('submit', function(e){
                e.preventDefault();
                if($('#image_file').val() == '')
                {
                    Swal.fire({
                        type: 'error',
                        title: 'Oops...',
                        text: 'Please select an image file!',

                    })
                }
                else
                {
                    $.ajax({
                        url:"<?php echo e(route('UploadImage')); ?>",

                        method:"POST",
                        data:new FormData(this),
                        contentType: false,
                        cache: false,
                        processData:false,
                        dataType: "json",
                        success:function(data)
                        {
                            if(data.msg=="failed"){
                                Swal.fire({
                                    type: 'error',
                                    title: 'Oops...',
                                    text: 'Please select an image file!',

                                })
                            }else{
                                $('#upload').hide();
                                $('#image_file').val('');
                                Swal.fire({
                                    position: 'top-end',
                                    type: 'success',
                                    title: 'Image updated successfully',
                                    showConfirmButton: false,
                                    timer: 1500
                                })
                            }
                        }
                    });
                }
            });
        });
        $(document).ready(function () {
      
            $('#edit_bank_form').hide();
            $('#change_bank_form').hide();
            $('#edit_mobile_form').hide();
            $('#change_mobile_form').hide();
            $('#contract_form').hide();
            $('#change_contract_form').hide();


            $('#change_bank').on('click',function () {
                var employee=$('#employee_id').val();

                $.ajax({
                    headers: {
                        'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                    },
                    type: "POST",
                    url: "<?php echo e(route('checkBank')); ?>",
                    dataType: 'json',
                    data:{ 'employee':employee},
                    success: function (data) {

                        $('.page-loader-wrapper').fadeOut();
                        if(data.msg=="exist"){
                            $('#bank_form').hide();
                            $('#change_bank_form').show(500);

                        }
                        if(data.msg=="NotExist"){
                            $('#bank_form').hide();
                            $('#edit_bank_form').show(500);

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


                    }
                })

            });

        });



  /*********************** update /cancel btn ********************************/

        $('#bank_cancel').on('click',function (e) {
                e.preventDefault();
                $('#bank_form').show(500);
                $('#edit_bank_form').hide();
        });


        $('#bank_back').on('click',function (e) {

                e.preventDefault();
                $('#bank_form').show(500);
                $('#change_bank_form').hide();
        })

        $('#cancel_contract').on('click',function () {
            $('#contract').show(500);
            $('#contract_form').hide();
        });

        $('#contract_back').on('click',function () {
            $('#contract').show(500);
            $('#change_contract_form').hide();
        });

        $('#mobile_cancel').on('click',function (e) {

            e.preventDefault();
            $('#edit_mobile_form').hide();
            $('#mobile_details').show('slide', {direction: 'right'}, 1000);
        });

        $('#mobile_back').on('click',function (e) {

            e.preventDefault();
            $('#mobile_details').show('slide', {direction: 'right'}, 1000);
            $('#change_mobile_form').hide();
        });

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




        $('#bank_edit').on('submit',function (e) {
            e.preventDefault();


            $('.page-loader-wrapper').fadeIn();
            $('#error').empty();
            $('#passbook').attr("href", "");
            $.ajax({
                type: "POST",
                url: "<?php echo e(route('changeBank')); ?>",
                dataType: 'json',
                data: new FormData(this),
                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"){
                        $('#ifsc_req').empty();
                        $('#account_req').empty();
                        $('#bank_name_req').empty();
                        $('#bank_form').show(500);
                        $('#edit_bank_form').hide();
                        $('#ifsc_req').append(data.data.ifsc_code);
                        $('#account_req').append(data.data.account_no);
                        $('#bank_name_req').append(data.data.bank_name);
                        $('#passbook').attr("href",image_url()+data.data.pass_book);


                        swal("Success!", "Bank details changes successfully!", "success");
                    }

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


                }
            });
        });

        $('#change_mobile').on('click',function (e) {
            e.preventDefault();


            var employee=$('#employee_id').val();

            $.ajax({
                headers: {
                    'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                },
                type: "POST",
                url: "<?php echo e(route('checkMobile')); ?>",
                dataType: 'json',
                data:{ 'employee':employee},
                success: function (data) {

                    $('.page-loader-wrapper').fadeOut();
                    if(data.msg=="exist"){
                        $('#mobile_details').hide();
                        $('#change_mobile_form').show('slide', {direction: 'right'}, 1000);
                    }
                    if(data.msg=="NotExist"){
                        $('#mobile_details').hide();
                        $('#edit_mobile_form').show('slide', {direction: 'right'}, 1000);

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


                }
            })


        });

        $('#mobile_edit').on('submit',function (e) {
            e.preventDefault();
            $('.page-loader-wrapper').fadeIn();
            $('#error_mobile').empty();
            $.ajax({
                type: "POST",
                url: "<?php echo e(route('changeMobile')); ?>",
                dataType: 'json',
                data: new FormData(this),
                contentType: false,
                cache: false,
                processData: false,
                success: function (data) {

                    $('.page-loader-wrapper').fadeOut();

                    if(data.msgType==true){
                        $('#mobile_req').empty();
                        $('#alt_mobile_req').empty();
                        $('#mobile_details').show('slide', {direction: 'right'}, 1000);
                        $('#edit_mobile_form').hide();
                        $('#mobile_req').append(data.data.mobile);
                        $('#alt_mobile_req').append(data.data.alter_mobile);


                        swal("Success!", "Contact details changes successfully!", "success");

                    }else{

                          if(data.data){
                            $.each(data.data, function (index, value) {
                                $('#error_mobile').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>');
                            });
                          }else{

                             Swal.fire({
                                type: 'error',
                                title: 'Oops...',
                                text: data.msg,

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






        $('#change_contract').on('click',function (e) {
            e.preventDefault();
            var employee=$('#employee_id').val();
            $.ajax({
                headers: {
                    'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                },
                type: "POST",
                url: "<?php echo e(route('checkContract')); ?>",
                dataType: 'json',
                data:{ 'employee':employee},
                success: function (data) {

                    $('.page-loader-wrapper').fadeOut();
                    if(data.msg=="exist"){
                        $('#contract').hide();
                        $('#change_contract_form').show(500);
                    }
                    if(data.msg=="notexist"){
                        $('#contract').hide();
                        $('#contract_form').show(500);

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


                }
            })


        });


        $('#contract_upload').on('submit',function (e) {
            e.preventDefault();

            $('.page-loader-wrapper').fadeIn();
            var url=$('#image_url').val();

            $('#error').empty();

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

                    $('.page-loader-wrapper').fadeOut();
                    if(data.msg=="validationFails"){
                        $.each(data.data, function (index, value) {
                            $('#error_contract').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"){
                        $('#contract_from_req').empty();
                        $('#contract_to_req').empty();
                        $('#contract_sign_req').empty();
                        $('#contract_url_req').empty();
                        $('#contract').hide();
                        $('#contract_form').hide();
                        $('#contract_from_req').append(data.data.contract_from);
                        $('#contract_to_req').append(data.data.contract_to);
                        $('#contract_sign_req').append(data.data.contract_sign_with);
                        $('#contract_url_req').append('<a href="'+image_url()+data.data.contract_url+'" style="margin-top: -17px;" class=""  target="_blank"><i class="fa fa-eye fa-2x" aria-hidden="true"></i></a>');


                        swal("Success!", "Contract details changes successfully!", "success");
                        $('#change_contract_form').show(500);
                    }

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


                }
            });


        })


       $('#qualification_view').show();
       $('#qualification_edit').hide();

       $(document).on('click','#qualification_edit_btn',function(e){
           e.preventDefault();
           $('#qualification_view').hide(500);
           $('#qualification_edit').show(500);
       })

       $(document).on('click','#qualification_edit_btn_cancel',function(e){
           e.preventDefault();
           $('#qualification_view').show(500);
           $('#qualification_edit').hide(500);
       })




     function get_qualification_data(){

          $('.page-loader-wrapper').fadeIn();
            var url=$('#image_url').val();

            $('#error').empty();

            $.ajax({
                type: "GET",
                url: "<?php echo e(route('getQualification')); ?>",
                dataType: 'json',
                success: function (data) {
                    if(data.msgType==true){

                        $('#hslc_board').val();
                        $('#hslc_pass_year').val();
                        $('#hslc_per').val();
                        $('#hs_stream').val();
                        $('#hs_board').val();
                        $('#hs_pass_year').val();
                        $('#hs_per').val();
                        $('#ug_course').val();
                        $('#ug_board').val();
                        $('#ug_pass_year').val();
                        $('#ug_per').val();
                        $('#pg_course').val();
                        $('#pg_board').val();
                        $('#pg_pass_year').val();
                        $('#pg_per').val();
                        $('#ot_course').val();
                        $('#ot_board').val();
                        $('#ot_pass_year').val();
                        $('#ot_per').val();
                        $('#pg_course_v').empty();
                        $('#pg_board_v').empty();
                        $('#pg_pass_year_v').empty();
                        $('#pg_per_v').empty();
                        $('#ot_course_v').empty();
                        $('#ot_board_v').empty();
                        $('#ot_pass_year_v').empty();
                        $('#ot_per_v').empty();
                        $('#hslc_board').val(data.data.hslc_board);
                        $('#hslc_pass_year').val(data.data.hslc_year);
                        $('#hslc_per').val(data.data.hslc_percentage);
                        $('#hs_stream').val(data.data.hs_stream);
                        $('#hs_board').val(data.data.hs_board);
                        $('#hs_pass_year').val(data.data.hs_year);
                        $('#hs_per').val(data.data.hs_percentage);
                        $('#ug_course').val(data.data.ug_course);
                        $('#ug_board').val(data.data.ug_board);
                        $('#ug_pass_year').val(data.data.ug_year);
                        $('#ug_per').val(data.data.ug_percentage);



                        if(data.data.pg_course){
                             $('#pg_course').val(data.data.pg_course);
                             $('#pg_course_v').append(data.data.pg_course);
                        }

                        if(data.data.pg_board){
                            $('#pg_board').val(data.data.pg_board);
                            $('#pg_board_v').append(data.data.pg_board);
                        }

                        if(data.data.pg_year){
                            $('#pg_pass_year').val(data.data.pg_year);
                            $('#pg_pass_year_v').append(data.data.pg_year);
                        }

                        if(data.data.pg_percentage){
                            $('#pg_per').val(data.data.pg_percentage);
                            $('#pg_per_v').append(data.data.pg_percentage);
                        }

                        if(data.data.ot_course){
                            $('#ot_course').val(data.data.ot_course);
                            $('#ot_course_v').append(data.data.ot_course);
                        }

                        if(data.data.ot_board){
                           $('#ot_board').val(data.data.ot_board);
                           $('#ot_board_v').append(data.data.ot_board);
                        }

                        if(data.data.ot_year){
                            $('#ot_pass_year').val(data.data.ot_year);
                            $('#ot_pass_year_v').append(data.data.ot_year);
                        }

                        if(data.data.ot_percentage){
                            $('#ot_per').val(data.data.ot_percentage);
                            $('#ot_per_v').append(data.data.ot_percentage);
                        }
                        $('#hslc_board_v').empty();
                        $('#hslc_pass_year_v').empty();
                        $('#hslc_per_v').empty();
                        $('#hs_stream_v').empty();
                        $('#hs_board_v').empty();
                        $('#hs_pass_year_v').empty();
                        $('#hs_per_v').empty();
                        $('#ug_course_v').empty();
                        $('#ug_board_v').empty();
                        $('#ug_pass_year_v').empty();
                        $('#ug_per_v').empty();
                        $('#hslc_board_v').append(data.data.hslc_board);
                        $('#hslc_pass_year_v').append(data.data.hslc_year);
                        $('#hslc_per_v').append(data.data.hslc_percentage);
                        $('#hs_stream_v').append(data.data.hs_stream);
                        $('#hs_board_v').append(data.data.hs_board);
                        $('#hs_pass_year_v').append(data.data.hs_year);
                        $('#hs_per_v').append(data.data.hs_percentage);
                        $('#ug_course_v').append(data.data.ug_course);
                        $('#ug_board_v').append(data.data.ug_board);
                        $('#ug_pass_year_v').append(data.data.ug_year);
                        $('#ug_per_v').append(data.data.ug_percentage);
                    }else{
                       $('#qualification_view').hide(500);
                       $('#qualification_edit').show(500);
                    }
                },
                error: function (jqXHR, textStatus, errorThrown) {
                },
                complete: function (data) {
                        $('.page-loader-wrapper').fadeOut();
                }

            })
     }
    get_qualification_data();


     $('#qualification_edit_form').on('submit',function (e) {
            e.preventDefault();

            $('.page-loader-wrapper').fadeIn();
            var url=$('#image_url').val();

            $.ajax({
                type: "POST",
                url: "<?php echo e(route('updateQualification')); ?>",
                dataType: 'json',
                data: new FormData(this),
                contentType: false,
                cache: false,
                processData: false,
                success: function (data) {
                    $("label[class*=error]").remove();
                    if(data.msgType==false){
                        if(data.Vmsg){

                            $.each(data.Vmsg, function( index, value ) {


                                $("#"+index).after('<label id="'+index+'-error" class="error" style="color:red !important; font-size:10px;font-weight: 100;" for="'+index+'">'+value+'</label>');

                            });

                        }else{
                             swal("Error!", data.msg, "error");
                        }
                    }else{
                        get_qualification_data();
                        toastr.success(data.msg);
                        $('#qualification_view').show(500);
                        $('#qualification_edit').hide(500);
                    }
                },
                error: function (jqXHR, textStatus, errorThrown) {
                },
                complete: function (data) {
                        $('.page-loader-wrapper').fadeOut();
                }
            });


        })

        function image_url(){
            var url=$('#image_url').val();
            return url;
        }






    </script>

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

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