
<?php $__env->startSection('content'); ?>
    <!-- begin::main content -->
    <style>
        textarea{
    min-height: 30px !important;
}

.form-control, .swal-modal input.swal-content__input{
    height: 43px !important;
}

.btn.btn-add, .btn.btn-add-payment {
    padding-left: 2.8571428571em;
    background-repeat: no-repeat;
    background-position: 1.4285714286em center;
}




input{
    border: 1px solid #c6d9e0 !important;
}

.search-btn {
    position: relative;
    right: 31px;
    top: 1px;
    color: #bdbdbd;
}

label {
    display: block;
    font-size: 13px;
    line-height: 1.3846153846em;
    color: #526069;
    margin-bottom: 0.7692307692em;
    user-select: none;
    cursor: pointer;
    font-weight: 500;
    width: 10.7692307692em;
}

.search-card{
    width:100%;
    border:none;
}
.tab {
    display: inline-block;
    padding: 16px 12px;
    cursor: pointer;
    
    background-color: #E6EAED;
    margin-right: -4px; /* Remove spacing between tabs */
  }

  /* Style for highlighted tab */
  .tab.active {
    background-color: white;
  }

  /* Content area style */
  .tab-content {
    
    padding: 20px;
    border-radius: 0 0 5px 5px;
    display: none; /* Hide all content areas by default */
  }

  /* Show active content area */
  .tab-content.active {
    display: block;
  }
    </style>

    <main class="main-content">

        <div class="container">

            <!-- begin::page header -->
            <div class="page-header">
                <h3><?php echo e(__('message.add')); ?> Termination Details</h3>
                <nav aria-label="breadcrumb">
                    <ol class="breadcrumb">
                        <li class="breadcrumb-item"><a href="<?php echo e(asset('dashboard')); ?>"><?php echo e(__('message.dashboard')); ?></a></li>
                        <li class="breadcrumb-item" aria-current="page"><a href="<?php echo e(asset('hrms/terminate')); ?>">Termination</a></li>
                        <li class="breadcrumb-item active" aria-current="page"><?php echo e(__('message.add')); ?></li>
                    </ol>
                </nav>
            </div>
            <!-- end::page header -->

            <div class="row">
                <div class="col-md-12">

                    <?php if (isset($component)) { $__componentOriginal8a5ba9c90b64d384232e9948b1023e746ba08e74 = $component; } ?>
<?php $component = $__env->getContainer()->make(App\View\Components\FlashMessage::class, []); ?>
<?php $component->withName('flashMessage'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php $component->withAttributes([]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal8a5ba9c90b64d384232e9948b1023e746ba08e74)): ?>
<?php $component = $__componentOriginal8a5ba9c90b64d384232e9948b1023e746ba08e74; ?>
<?php unset($__componentOriginal8a5ba9c90b64d384232e9948b1023e746ba08e74); ?>
<?php endif; ?>
                   
                    
                    <div class="card">
                    
                        <div class="card-body py-0">
                        
                            <div class="bg-white ">
                                   
                                <div class="row pb-5">
                                    <div class="col-md-6" style="border-right: 1px solid #e5e5e5;">
                                              
                                            <div class="card-body">
                                                 
                                                <form action="<?php echo e(asset('hrms/add-terminate')); ?>"  method="post" enctype="multipart/form-data">
                                                    <?php echo csrf_field(); ?>    
                                                      
                                                    <div class="form-group d-flex align-items-center">
                                                        <label for="name">Employee</label>
                                                        
                                                        <select name="user_unique_id" class="form-control select2 text-capitalize employee_change" >
                                                            <option disabled selected>SELECT</option>
                                                            <?php $__currentLoopData = $employees; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $emp): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                                <option value="<?php echo e($emp->user_unique_id); ?>" ><?php echo e($emp->name); ?></option>
                                                            
                                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                       </select>

                                                    </div>
                                                    <div class="d-flex justify-content-end px-3">
                                                        <?php if($errors->has('user_unique_id')): ?>
                                                            <div class="text-danger">
                                                                <p>Please Choose Employee Name !</p>
                                                            </div>
                                                        <?php endif; ?>
                                                    </div>
                                                   
                                                  
                                                   

                                                    <div class="form-group d-flex align-items-center">
                                                        <label for="terminate_type">Terminate Type</label>
                                                        <input type="text" class="form-control" id="terminate_type" name="terminate_type">
                                                       
                                                    </div> 
                                                    <div class="d-flex justify-content-end px-3">
                                                        <?php if($errors->has('terminate_type')): ?>
                                                            <div class="text-danger">
                                                                <p><?php echo e($errors->first('terminate_type')); ?></p>
                                                            </div>
                                                        <?php endif; ?>
                                                    </div>                      
                                                    
                                                    <div class="form-group d-flex align-items-center">
                                                        <label for="notice_date">Notice Date</label>
                                                        <input type="date" name="notice_date" class="form-control">
                                                       
                                                    </div>
                                                    <div class="d-flex justify-content-end px-3">
                                                        <?php if($errors->has('notice_date')): ?>
                                                            <div class="text-danger">
                                                                <p><?php echo e($errors->first('notice_date')); ?></p>
                                                            </div>
                                                        <?php endif; ?>
                                                    </div>  

                                                    <div class="form-group d-flex align-items-center">
                                                        <label for="terminate_date">Terminate Date</label>
                                                        <input type="date" name="terminate_date" class="form-control">
                                                       
                                                    </div>
                                                    <div class="d-flex justify-content-end px-3">
                                                        <?php if($errors->has('terminate_date')): ?>
                                                            <div class="text-danger">
                                                                <p><?php echo e($errors->first('terminate_date')); ?></p>
                                                            </div>
                                                        <?php endif; ?>
                                                    </div>  

                                                    <div class="form-group d-flex align-items-center">
                                                        <label for="note">Note</label>
                                                        <textarea rows="3" name="note"class="w-100 border px-2"></textarea>
                                                       
                                                    </div>
                         
                                               
                                            </div>
                                    </div>
                                    <div class="col-md-6 py-4">
                                       
                                       
                                          
                                        <div class="row bg-white py-4 w-100"  style="position:fixed;bottom:0;left:266px">
                                            <div class="col-12 py-2 px-4">
                                                <button class="btn btn-success text-white mx-4" type="submit">
                                                <i class="fa fa-check fa-lg"></i>&nbsp SAVE
                                                </button>
                                                <button class="btn btn-primary" type="button">CANCEL</button>
                                            </div>
                                        </div>
                                    </form>
                                    </div>
                                </div>
                        
                                
                                       
                                   
                                
                            </div>
                            
                        </div>
                    </div>



                </div>

            </div>

                     
        </div>

    </main>
    <!-- end::main content -->
<?php $__env->stopSection(); ?>
<?php $__env->startPush('footer-script'); ?>
    <!-- begin::select2 -->
    <link rel="stylesheet" href="<?php echo e(asset('public/admin/vendors/select2/css/select2.min.css')); ?>" type="text/css">
    <script src="<?php echo e(asset('public/admin/vendors/select2/js/select2.min.js')); ?>"></script>
    <!-- end::select2 -->
    <script>
       
        $(document).ready(function() {
            
            $('#js-example-basic-roles').select2({});

            $(".employee_change").on('change',function(){
                    var user_unique_id = $(this).val(); 
                   
                    $.ajaxSetup({
                                headers: {
                                    'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                                }
                            });

                    $.ajax({
                        type: "post",
                        url: "<?php echo e(asset('hrms/fetch-emp-salary')); ?>",
                        data:{
                            user_unique_id:user_unique_id
                        },
                        dataType: "html",
                        success: function(result) 
                        {
                            var res = JSON.parse(result);
                            var allData = JSON.parse(result).data;
                         
                            if(res.message === "not_salary")
                            {
                                $("#gross_salary").val("");
                                $("#net_salary").val("");
                                $("#designation").val(allData.designation);
                                return false;
                            }
                            if(res.message === "success")
                            {
                                var gross_salary = allData.gross_salary;
                                var net_salary = allData.net_salary;
                                var salary_details = allData.salary_details;
                                salary_details = JSON.parse(salary_details);

                                $("#gross_salary").val(gross_salary);
                                $("#net_salary").val(net_salary);
                                $("#designation").val(allData.designation);
                                $.each(salary_details, function(key, value) {
                                    $("."+key).val(value);
                                });
                            }
                            
                                                       
                        },
                        error:function(xhr,status,error)
                        {
                            console.log(xhr);
                            $("#gross_salary").val();
                            $("#net_salary").val();
                            $("#designation").val();
                        }
                    });

            });      
        });    

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

<?php echo $__env->make('layout', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\blurb_erp\resources\views/hrms/terminate/add.blade.php ENDPATH**/ ?>