



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

<?php $__env->stopSection(); ?>
<?php $__env->startSection('dynamic_css'); ?>
    <style>
        .f-600 {
            font-weight: 600;
        }

        .f-13 {
            font-size: 13px !important;
        }

        .v-errors {
            background-color: #eee;
            list-style: disc;
            border: 2px solid red;
            padding: 5px 20px;
            color: darkred;
        }

        /* The switch - the box around the slider */
        .switch {
            position: relative;
            display: inline-block;
            width: 60px;
            height: 31px;
            margin-top: 6px;
        }

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

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

        .slider:before {
            position: absolute;
            content: "";
            height: 23px;
            width: 26px;
            left: 4px;
            bottom: 4px;
            background-color: white;
            -webkit-transition: .4s;
            transition: .4s;
        }

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

        input:focus + .slider {
            box-shadow: 0 0 1px #2196F3;
        }

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

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

        .slider.round:before {
            border-radius: 50%;
        }
    </style>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>
    <div class="container">
        <div class="row justify-content-center">

            <div class="col-md-12 col-md-push-0 mt10">
                <ul class="nav  nav-justified nav-custom row" id="sub_menue_hold">
                    <li class="col-md-6 nav-item"><a data-toggle="tab" href="#t5" class="nav-link text-upper active">Current
                            Task</a></li>
                    <li class="col-md-6 nav-item "><a data-toggle="tab" href="#t6" class="nav-link text-upper">Task
                            History</a></li>
                </ul>
                <div class="tab-content">
                    <div id="t5" class=" nav-custom-div row tab-pane fade active show pt0">
                        <div class="col-md-12">

                            <div class="col-md-12 text-right" id="programs_div">
                                <?php $__currentLoopData = $programs; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $li): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <?php
                                        if($li->program_code==1){
                                            $progam_style="orange";
                                        }elseif ($li->program_code==2){
                                            $progam_style="blue";
                                        }elseif($li->program_code==3){
                                            $progam_style="red";
                                        }elseif ($li->program_code==4){
                                            $progam_style="green";
                                        }elseif ($li->program_code==5){
                                            $progam_style="brown";
                                        }else{
                                            $progam_style="teal";
                                        }
                                    ?>
                                    <span style="font-size: 13px"><i class="fa fa-circle" style="color: <?php echo e($progam_style); ?>;"></i> <?php echo e($li->program_name); ?></span>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </div>

                            <div class="row " style="height: 37rem;overflow: auto;" id="tasks_div">
                                <div class="col-md-12">
                                 <?php if(!empty($tasks)): ?>
                        
                                    <?php $__currentLoopData = $tasks; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$task): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>

                                        <h6><?php echo e($key); ?> (Total: <?php echo e($task['T']); ?> tasks)</h6>
                                        <div class="row mb20">
                                            <?php $__currentLoopData = $task['list']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $li): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <?php
                                                    if($li['program_code']==1){
                                                        $progam_style="orange";
                                                    }elseif ($li['program_code']==2){
                                                        $progam_style="blue";
                                                    }elseif($li['program_code']==3){
                                                        $progam_style="red";
                                                    }elseif ($li['program_code']==4){
                                                        $progam_style="green";
                                                    }elseif ($li['program_code']==5){
                                                        $progam_style="brown";
                                                    }else{
                                                         $progam_style="teal";
                                                    }
                                                ?>

                                                <div class="col-md-6">
                                                    <div class="card" style="border-top:5px solid <?php echo e($progam_style); ?>;margin-top: 5px">
                                                        <div class="card-header">
                                                            <h6 class="f-13 f-600"><?php echo e($li['task_code']); ?></h6>
                                                        </div>
                                                        <!--<div class="card-body">-->
                                                        <div class="accordion md-accordion" id="accordionEx<?php echo e($li['id']); ?>" role="tablist" aria-multiselectable="true">
                                                            <div class="card">
                                                                <div class="card-header" role="tab" id="headingOne<?php echo e($li['id']); ?>">
                                                                    <a data-toggle="collapse" data-parent="#accordionEx"
                                                                       href="#collapseOne<?php echo e($li['id']); ?>"
                                                                       aria-expanded="true"
                                                                       aria-controls="collapseOne<?php echo e($li['id']); ?>">
                                                                        <h5 class="mb-0">
                                                                            <span class="f-13">Task Title</span> <i class="fa fa-angle-down rotate-icon pull-right"></i>
                                                                        </h5>
                                                                    </a>
                                                                </div>

                                                                <div id="collapseOne<?php echo e($li['id']); ?>" class="collapse"
                                                                     role="tabpanel"
                                                                     aria-labelledby="headingOne<?php echo e($li['id']); ?>"
                                                                     data-parent="#accordionEx<?php echo e($li['id']); ?>">
                                                                    <div class="card-body">
                                                                        <?php echo e($li['task_title']); ?>

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

                                                            <div class="card">
                                                                <div class="card-header" role="tab" id="headingTwo<?php echo e($li['id']); ?>">
                                                                    <a class="collapsed" data-toggle="collapse"
                                                                       data-parent="#accordionEx<?php echo e($li['id']); ?>"
                                                                       href="#collapseTwo<?php echo e($li['id']); ?>"
                                                                       aria-expanded="false"
                                                                       aria-controls="collapseTwo<?php echo e($li['id']); ?>">
                                                                        <h5 class="mb-0">
                                                                            <span class="f-13">Task Description</span>
                                                                            <i class="fa fa-angle-down rotate-icon pull-right"></i>
                                                                        </h5>
                                                                    </a>
                                                                </div>

                                                                <div id="collapseTwo<?php echo e($li['id']); ?>" class="collapse"
                                                                     role="tabpanel"
                                                                     aria-labelledby="headingTwo<?php echo e($li['id']); ?>"
                                                                     data-parent="#accordionEx<?php echo e($li['id']); ?>">
                                                                    <div class="card-body">
                                                                        <?php echo e($li['task_description']); ?>

                                                                    </div>
                                                                </div>

                                                            </div>

                                                            <div class="card">
                                                                <div class="card-header" role="tab"
                                                                     id="headingFour<?php echo e($li['id']); ?>">
                                                                    <a class="collapsed" data-toggle="collapse" data-parent="#accordionEx<?php echo e($li['id']); ?>" href="#collapseFour<?php echo e($li['id']); ?>" aria-expanded="false" aria-controls="collapseFour<?php echo e($li['id']); ?>">
                                                                        <h5 class="mb-0"> <span class="f-13">Target Description</span> <i class="fa fa-angle-down rotate-icon pull-right"></i>
                                                                        </h5>
                                                                    </a>
                                                                </div>
                                                                <div id="collapseFour<?php echo e($li['id']); ?>" class="collapse"
                                                                     role="tabpanel"
                                                                     aria-labelledby="headingFour<?php echo e($li['id']); ?>"
                                                                     data-parent="#accordionEx<?php echo e($li['id']); ?>">
                                                                    <div class="card-body">
                                                                        <?php echo e($li['task_district_description']); ?>

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

                                                            <div class="card">
                                                                <div class="card-header" role="tab"
                                                                     id="headingFive<?php echo e($li['id']); ?>">
                                                                    <a class="collapsed" data-toggle="collapse" data-parent="#accordionEx<?php echo e($li['id']); ?>" href="#collapseFive<?php echo e($li['id']); ?>" aria-expanded="false" aria-controls="collapseFive<?php echo e($li['id']); ?>">
                                                                        <h5 class="mb-0">
                                                                            <span class="f-13">District Remarks</span> <i class="fa fa-angle-down rotate-icon pull-right"></i>
                                                                        </h5>
                                                                    </a>
                                                                </div>

                                                                <div id="collapseFive<?php echo e($li['id']); ?>" class="collapse" role="tabpanel" aria-labelledby="headingFive<?php echo e($li['id']); ?>" data-parent="#accordionEx<?php echo e($li['id']); ?>">
                                                                    <div class="card-body">
                                                                        <?php echo e($li['remarks']); ?>

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


                                                            <div class="card">
                                                                <div class="card-header" role="tab"
                                                                     id="headingSix<?php echo e($li['id']); ?>">
                                                                    <a class="collapsed" data-toggle="collapse" data-parent="#accordionEx<?php echo e($li['id']); ?>" href="#collapseSix<?php echo e($li['id']); ?>" aria-expanded="false" aria-controls="collapseSix<?php echo e($li['id']); ?>">
                                                                        <h5 class="mb-0"> <span class="f-13">Employee Target Description</span> <i class="fa fa-angle-down rotate-icon pull-right"></i>
                                                                        </h5>
                                                                    </a>
                                                                </div>

                                                                <div id="collapseSix<?php echo e($li['id']); ?>" class="collapse" role="tabpanel" aria-labelledby="headingSix<?php echo e($li['id']); ?>" data-parent="#accordionEx<?php echo e($li['id']); ?>">
                                                                    <div class="card-body">
                                                                        <?php echo e($li['employee_target_description']); ?>

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

                                                            <div class="card">
                                                                <div class="card-header" role="tab"
                                                                     id="headingSeven<?php echo e($li['id']); ?>">
                                                                    <a class="collapsed" data-toggle="collapse" data-parent="#accordionEx<?php echo e($li['id']); ?>" href="#collapseSeven<?php echo e($li['id']); ?>" aria-expanded="false" aria-controls="collapseSeven<?php echo e($li['id']); ?>">
                                                                        <h5 class="mb-0"> <span class="f-13">Employee Remarks</span> <i class="fa fa-angle-down rotate-icon pull-right"></i>
                                                                        </h5>
                                                                    </a>
                                                                </div>

                                                                <div id="collapseSeven<?php echo e($li['id']); ?>" class="collapse" role="tabpanel" aria-labelledby="headingSeven<?php echo e($li['id']); ?>" data-parent="#accordionEx<?php echo e($li['id']); ?>">
                                                                    <div class="card-body">
                                                                        <?php echo e($li['employee_remarks']); ?>

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

                                                            <div class="card">
                                                                <div class="card-header <?php if($li['remaining_target']==0): ?> <?php echo e('border border-success'); ?> <?php else: ?> <?php echo e('border border-danger'); ?> <?php endif; ?>"
                                                                     role="tab" id="headingThree<?php echo e($li['id']); ?>">
                                                                    <a class="collapsed" data-toggle="collapse"
                                                                       data-parent="#accordionEx"
                                                                       href="#collapseThree<?php echo e($li['id']); ?>"
                                                                       aria-expanded="false"
                                                                       aria-controls="collapseThree<?php echo e($li['id']); ?>">
                                                                        <h5 class="mb-0">
                                                                            <span class="f-13">Employee Target: </span>
                                                                            <i class="fa fa-angle-down rotate-icon pull-right"></i>
                                                                        </h5>
                                                                    </a>
                                                                </div>

                                                                <div id="collapseThree<?php echo e($li['id']); ?>" class="collapse" role="tabpanel" aria-labelledby="headingThree<?php echo e($li['id']); ?>" data-parent="#accordionEx<?php echo e($li['id']); ?>">
                                                                    <div class="card-body">
                                                                        <p><span class="f-13">Total Target: <?php echo e($li['district_target']); ?></span></p>
                                                                        <p><span class="f-13">Remaining Target To Assign: <?php echo e($li['remaining_target']); ?></span></p>
                                                                        <form action="#" method="POST" id="assignEmpForm<?php echo e($li['emp_task_target_id']); ?>">
                                                                            <div class="form-group">
                                                                                <label>Employee Target</label>
                                                                                <input type="number" class="form-control" name="emp_assign<?php echo e($li['emp_task_target_id']); ?>" id="emp_assign<?php echo e($li['emp_task_target_id']); ?>" value="<?php echo e($li['employee_target']); ?>"/>
                                                                            </div>
                                                                            <div class="form-group">
                                                                                <label>Employee Task Description</label>
                                                                                <textarea name="employee_target_description<?php echo e($li['emp_task_target_id']); ?>" id="employee_target_description<?php echo e($li['emp_task_target_id']); ?>" class="form-control"><?php echo e($li['employee_target_description']); ?></textarea>
                                                                            </div>
                                                                            <div class="form-group">
                                                                                <label>Employee Remarks</label>
                                                                                <textarea name="employee_remarks<?php echo e($li['emp_task_target_id']); ?>" id="employee_remarks<?php echo e($li['emp_task_target_id']); ?>" class="form-control"><?php echo e($li['employee_remarks']); ?></textarea>
                                                                            </div>
                                                                            <div class="form-group">
                                                                                <button type="submit" data-emp_id="<?php echo e($li['emp_task_target_id']); ?>" data-emp_code="<?php echo e($li['employee_code']); ?>" class="btn btn-primary btn-sm update-Btn">Update</button>
                                                                            </div>
                                                                        </form>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <!--</div>-->
                                                    </div>
                                                </div>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                        </div>

                                        <hr>

                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                 <?php else: ?>
                                    <div class="text-center label-text" style="    margin-top: 100px;"><h1>No History Found</h1></div>
                                 <?php endif; ?>
                                </div>
                            </div>

                        </div>
                    </div>
                    <div id="t6" class=" nav-custom-div row tab-pane fade pt0">
                        <div class="col-md-12">
                            <?php if(!empty($month_year_data)): ?>
                                <div class="row justify-content-center mb20">
                                    <div class="col-md-4 mt15">
                                        <select class="form-control" id="year_month">
                                            <option value="" selected disabled>========== Select Month ==========
                                            </option>
                                            <?php $__currentLoopData = $month_year_data; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $my): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <option value="<?php echo e($my['month']); ?>,<?php echo e($my['year']); ?>"><?php echo e($my['month_name']); ?>

                                                    ,<?php echo e($my['year']); ?></option>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                        </select>
                                    </div>
                                </div>
                            <?php endif; ?>
                            <div class="col-md-12 text-right" id="programs_div">
                                <?php $__currentLoopData = $programs; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $li): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <?php
                                        if($li->program_code==1){
                                            $progam_style="orange";
                                        }elseif ($li->program_code==2){
                                            $progam_style="blue";
                                        }elseif($li->program_code==3){
                                            $progam_style="red";
                                        }elseif ($li->program_code==4){
                                            $progam_style="green";
                                        }elseif ($li->program_code==5){
                                            $progam_style="brown";
                                        }else{
                                            $progam_style="teal";
                                        }
                                    ?>
                                    <span style="font-size: 13px"><i class="fa fa-circle" style="color: <?php echo e($progam_style); ?>;"></i> <?php echo e($li->program_name); ?></span>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </div>
                            <div class="row " style="height: 30rem;overflow: auto;" id="tasks_div">
                                <div class="col-md-12 ">
                                    <?php if(empty($month_year_data)): ?>
                                        <div class="text-center" style="    margin-top: 100px;"><h1>No History Found</h1></div>
                                    <?php else: ?>
                                        <div id="task_data">


                                        </div>
                                    <?php endif; ?>

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

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



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



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

        $('#year_month').on('change', function (e) {
            e.preventDefault();
            var month_year = $(this).val();
            var result = month_year.split(',');

            var employee_code = '<?php echo e($employee_code); ?>';


            $('.page-loader-wrapper').fadeIn();
            $.ajax({
                type: "GET",
                url: "<?php echo e(url('performance/employee_task/get_employee_task')); ?>",
                data: {month: result[0], year: result[1], employee_code: employee_code},
                dataType: "json",
                success: function (data) {
                    if (data.msgType == true) {


                        /*********** ADDING TASKS ************/
                        var progam_style = '';
                        $('#task_data').empty();
                        var sub = 1;
                        $.each(data.data.tasks, function (key, item) {

                            $('#task_data').append('<div class="col-md-12"><h6 style="margin-top:4px">' + key + ' (Total:' + item.T + 'tasks)' + '</h6></div>' +
                                '<div class="col-md-12"><div class="row mb20" id="tasks_sub' + sub + '"></div></div>');

                            $.each(item.list, function (index1, value1) {

                                if (value1.program_code ==1) {
                                    progam_style = "orange";
                                } else if (value1.program_code ==2) {
                                    progam_style = "blue";
                                } else if (value1.program_code ==3) {
                                    progam_style = "red";
                                } else if (value1.program_code ==4) {
                                    progam_style = "green";
                                } else if (value1.program_code ==5) {
                                    progam_style = "brown";
                                }else{
                                    progam_style="teal";
                                }

                                $('#tasks_sub' + sub).append('<div class="col-md-6">' +
                                    '<div class="card" style="border-top:5px solid ' + progam_style + ';margin-top: 5px">' +
                                    '<div class="card-header">' +
                                    '<h6 class="f-13 f-600">' + value1.task_code + '</h6>' +
                                    '</div>' +
                                    '<div class="accordion md-accordion" id="accordionEx1' + value1.id + '" role="tablist" aria-multiselectable="true">' +
                                    '<div class="card">' +
                                    '<div class="card-header" role="tab" id="headingOne1' + value1.id + '">' +
                                    '<a data-toggle="collapse" data-parent="#accordionEx1" href="#collapseOne1' + value1.id + '" aria-expanded="true" aria-controls="collapseOne1' + value1.id + '">' +
                                    '<h5 class="mb-0">' +
                                    '<span class="f-13">Task Title</span><i class="fa fa-angle-down rotate-icon pull-right"></i>' +
                                    '</h5>' +
                                    '</a>' +
                                    '</div>' +

                                    '<div id="collapseOne1' + value1.id + '" class="collapse" role="tabpanel" aria-labelledby="headingOne1' + value1.id + '" data-parent="#accordionEx1' + value1.id + '">' +
                                    '<div class="card-body">' +
                                    value1.task_title +
                                    '</div>' +
                                    '</div>' +
                                    '</div>' +
                                    '<div class="card">' +
                                    '<div class="card-header" role="tab" id="headingTwo1' + value1.id + '">' +
                                    '<a class="collapsed" data-toggle="collapse" data-parent="#accordionEx1' + value1.id + '" href="#collapseTwo1' + value1.id + '" aria-expanded="false" aria-controls="collapseTwo1' + value1.id + '">' +
                                    '<h5 class="mb-0">' +
                                    '<span class="f-13">Task Description</span><i class="fa fa-angle-down rotate-icon pull-right"></i>' +
                                    '</h5>' +
                                    '</a>' +
                                    '</div>' +

                                    '<div id="collapseTwo1' + value1.id + '" class="collapse" role="tabpanel" aria-labelledby="headingTwo1' + value1.id + '" data-parent="#accordionEx1' + value1.id + '">' +
                                    '<div class="card-body">' +
                                    value1.task_description +
                                    '</div>' +
                                    '</div>' +

                                    '</div>' +
                                    '<div class="card">' +
                                    '<div class="card-header" role="tab" id="headingFour1' + value1.id + '">' +
                                    '<a class="collapsed" data-toggle="collapse" data-parent="#accordionEx1' + value1.id + '" href="#collapseFour1' + value1.id + '" aria-expanded="false" aria-controls="collapseFour1' + value1.id + '">' +
                                    '<h5 class="mb-0">' +
                                    '<span class="f-13">Target Description</span><i class="fa fa-angle-down rotate-icon pull-right"></i>' +
                                    '</h5>' +
                                    '</a>' +
                                    '</div>' +

                                    '<div id="collapseFour1' + value1.id + '" class="collapse" role="tabpanel" aria-labelledby="headingFour1' + value1.id + '" data-parent="#accordionEx1' + value1.id + '">' +
                                    '<div class="card-body">' +
                                    value1.task_district_description +
                                    '</div>' +
                                    '</div>' +
                                    '</div>' +

                                    '<div class="card">' +
                                    '<div class="card-header" role="tab" id="headingFive1' + value1.id + '">' +
                                    '<a class="collapsed" data-toggle="collapse" data-parent="#accordionEx1' + value1.id + '" href="#collapseFive1' + value1.id + '" aria-expanded="false" aria-controls="collapseFive1' + value1.id + '">' +
                                    '<h5 class="mb-0">' +
                                    '<span class="f-13">Remarks</span><i class="fa fa-angle-down rotate-icon pull-right"></i>' +
                                    '</h5>' +
                                    '</a>' +
                                    '</div>' +

                                    '<div id="collapseFive1' + value1.id + '" class="collapse" role="tabpanel" aria-labelledby="headingFive1' + value1.id + '" data-parent="#accordionEx1' + value1.id + '">' +
                                    '<div class="card-body">' +
                                        value1.remarks +
                                    '</div>' +
                                    '</div>' +
                                    '</div>' +

                                    '<div class="card">'+
                                    '<div class="card-header" role="tab" id="headingSix1' + value1.id + '">'+
                                    '<a class="collapsed" data-toggle="collapse" data-parent="#accordionEx1' + value1.id + '" href="#collapseSix1' + value1.id + '" aria-expanded="false" aria-controls="collapseSix1' + value1.id + '">'+
                                    '<h5 class="mb-0"> <span class="f-13">Employee Target Description</span> <i class="fa fa-angle-down rotate-icon pull-right"></i>'+
                                    '</h5>'+
                                    '</a>'+
                                    '</div>'+

                                    '<div id="collapseSix1' + value1.id + '" class="collapse" role="tabpanel" aria-labelledby="headingSix1' + value1.id + '" data-parent="#accordionEx1' + value1.id + '">'+
                                    '<div class="card-body">'+
                                        value1.employee_target_description +
                                    '</div>'+
                                    '</div>'+
                                    '</div>'+

                                    '<div class="card">'+
                                    '<div class="card-header" role="tab" id="headingSeven1' + value1.id + '">'+
                                    '<a class="collapsed" data-toggle="collapse" data-parent="#accordionEx1' + value1.id + '" href="#collapseSeven1' + value1.id + '" aria-expanded="false" aria-controls="collapseSeven1' + value1.id + '">'+
                                    '<h5 class="mb-0"> <span class="f-13">Employee Remarks</span> <i class="fa fa-angle-down rotate-icon pull-right"></i>'+
                                    '</h5>'+
                                    '</a>'+
                                    '</div>'+

                                    '<div id="collapseSeven1' + value1.id + '" class="collapse" role="tabpanel" aria-labelledby="headingSeven1' + value1.id + '" data-parent="#accordionEx1' + value1.id + '">'+
                                    '<div class="card-body">'+
                                        value1.employee_remarks +
                                    '</div>'+
                                    '</div>'+
                                    '</div>'+

                                    '<div class="card">' +
                                    '<div class="card-header" role="tab" id="headingThree1' + value1.id + '">' +
                                    '<a class="collapsed" data-toggle="collapse" data-parent="#accordionEx" href="#collapseThree1' + value1.id + '" aria-expanded="false" aria-controls="collapseThree1' + value1.id + '">' +
                                    '<h5 class="mb-0">' +
                                    '<span class="f-13">Employee Target Details</span> <i class="fa fa-angle-down rotate-icon pull-right"></i>' +
                                    '</h5>' +
                                    '</a>' +
                                    '</div>' +
                                    '<div id="collapseThree1' + value1.id + '" class="collapse" role="tabpanel" aria-labelledby="headingThree1' + value1.id + '" data-parent="#accordionEx1' + value1.id + '">' +
                                    '<div class="card-body">' +
                                    '<p><span class="f-13">Total Target: ' + value1.district_target + ' </span></p>' +
                                    '<p> <span class="f-13">Remaining Target To Assign: ' + value1.remaining_target + '</span></p>' +
                                    '<p> <span class="f-13">Employee Target Assigned: ' + value1.employee_target + '</span></p>' +
                                    '</div>' +
                                    '</div>' +
                                    '</div>' +
                                    '</div>' +
                                    '</div>' +
                                    '</div>');
                            });

                            sub++;

                        });
                        /*********** ADDING TASKS ENDED *********/


                    } else {
                    }

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

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



        $('.update-Btn').on('click', function (e){
            e.preventDefault();

            var emp_target_id= $(this).data('emp_id');
            var employee_code= $(this).data('emp_code');
            var id=emp_target_id; 
            var employee_target_description= $('#employee_target_description'+emp_target_id).val();
            var employee_remarks= $('#employee_remarks'+emp_target_id).val();
            var emp_assign= $('#emp_assign'+emp_target_id).val();


            $.ajax({
                headers: {
                    'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                },
                type: "POST",
                url: 'updateEmployeeTarget',
                dataType: "json",
                data: {emp_target_id: emp_target_id, employee_target_description: employee_target_description, employee_remarks: employee_remarks, emp_assign: emp_assign, employee_code},
                cache: false,
                success: function (data) {
                    if (data.msgType == true) {
                        /*$('#assignEmpForm'+id)[0].reset();*/
                        
                        swal({
                          title: "Success",
                          text: data.msg,
                          icon: "success",
                          buttons: true,
                          dangerMode: true,
                        })
                        .then((willDelete) => {
                          if (willDelete) {
                            location.reload();
                          }
                        });
                        
                        
                        
                      /*  toastr.success(data.msg);*/
                    } else {
                        if (data.msg == "VE") {
                            $.each(data.data, function (index, value) {
                                var custom_index=index+id;
                                $('#'+custom_index).after('<p class="text-danger ve_errors">' + value + '</p>');
                            });
                        } else {
                            toastr.error(data.msg);
                        }
                    }
                },
                error: function (jqXHR, textStatus, errorThrown) {
                    callAjaxErrorFunction(jqXHR, textStatus, errorThrown);
                },
                complete: function (data) {
                    $('.page-loader-wrapper').fadeOut();
                }
            });

        });

    </script>

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