
<?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;
}

.select2-search__field{
    display:none;
}


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')); ?> Policy</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/hrms-policy')); ?>">Policy</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">

                    
                    <div class="card">
                        <?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-body py-0">
                            
                            <div class="bg-white ">
                                <form action="<?php echo e(asset('hrms/add-hrms-policy')); ?>"  method="post" enctype="multipart/form-data">
                                    <?php echo csrf_field(); ?>
                                    <div class="card-body">                 
                                        <div class="row py-3">
                                            <div class="col-md-6" style="border-right: 1px">
                                                
                                                    <div class="form-group d-flex align-items-center">
                                                        <label for="policy_name">Policy Name</label>                                                 
                                                    
                                                        <input type="text" name="policy_name" class="form-control" >
                                                        
                                                    </div> 
                                                    <div class="d-flex justify-content-end px-3">
                                                        <?php if($errors->has('policy_name')): ?>
                                                            <div class="text-danger">
                                                                <p><?php echo e($errors->first('policy_name')); ?></p>
                                                            </div>
                                                        <?php endif; ?>
                                                    </div>                                                                                       
                                                    <div class="form-group d-flex align-items-center">
                                                        <label for="name">Branch</label>
                                                        <select name="branch_id" class="form-control select2" multiple>
                                                            <?php $__currentLoopData = $school; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $sc): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                                <option value="<?php echo e($sc->id); ?>"><?php echo e($sc->school); ?></option>
                                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                        </select>
                                                    
                                                    </div> 
                                                    <div class="d-flex justify-content-end px-3">
                                                        <?php if($errors->has('branch_id')): ?>
                                                            <div class="text-danger">
                                                                <p><?php echo e($errors->first('branch_id')); ?></p>
                                                            </div>
                                                        <?php endif; ?>
                                                    </div>  

                                                    <div class="form-group d-flex align-items-center">
                                                        <label for="start_time"> Office Start Time</label>                                                       
                                                            
                                                        <div class="input-group clockpicker-demo">
                                                            <div class="input-group-prepend">
                                                                <span class="input-group-text">
                                                                    <i class="fa fa-clock-o"></i>
                                                                </span>
                                                            </div>
                                                            <input type="text" name="start_time" class="form-control" value="09:30">
                                                        </div>
                                                    
                                                    
                                                    </div> 
                                                    <div class="d-flex justify-content-end px-3">
                                                        <?php if($errors->has('start_time')): ?>
                                                            <div class="text-danger">
                                                                <p><?php echo e($errors->first('start_time')); ?></p>
                                                            </div>
                                                        <?php endif; ?>
                                                    </div>
                                                    
                                                    <div class="form-group d-flex align-items-center">
                                                        <label for="end_time"> Office End Time</label>
                                                        
                                                        <div class="input-group clockpicker-autoclose-demo">
                                                            <div class="input-group-prepend">
                                                                <span class="input-group-text">
                                                                    <i class="fa fa-clock-o"></i>
                                                                </span>
                                                            </div>
                                                            <input type="text" name="end_time" class="form-control" value="18:30">
                                                        </div>
                                                        
                                                    
                                                    </div> 
                                                    <div class="d-flex justify-content-end px-3">
                                                        <?php if($errors->has('end_time')): ?>
                                                            <div class="text-danger">
                                                                <p><?php echo e($errors->first('end_time')); ?></p>
                                                            </div>
                                                        <?php endif; ?>
                                                    </div>  

                                                
                                            </div>
                                            <div class="col-md-6">
                                                <div class="form-group d-flex align-items-center">
                                                    <label for="late_time"> Late Time</label>
                                                    <input type="number" class="form-control" name="late_time">
                                                    
                                                </div> 
                                                <div class="d-flex justify-content-end px-3">
                                                    <?php if($errors->has('late_time')): ?>
                                                        <div class="text-danger">
                                                            <p><?php echo e($errors->first('late_time')); ?></p>
                                                        </div>
                                                    <?php endif; ?>
                                                </div> 
                                                
                                                <div class="form-group d-flex align-items-center">
                                                    <label for="late_number">Number Of Late</label>
                                                    <input type="number" class="form-control" name="late_number">
                                                    
                                                </div> 
                                                <div class="d-flex justify-content-end px-3">
                                                    <?php if($errors->has('late_number')): ?>
                                                        <div class="text-danger">
                                                            <p><?php echo e($errors->first('late_number')); ?></p>
                                                        </div>
                                                    <?php endif; ?>
                                                </div>

                                                <div class="form-group d-flex align-items-center">
                                                    <label for="late_number"> Deduction Type</label>
                                                    <select class="form-control" name="deduction_type">
                                                        <option disabled selected>SELECT</option>
                                                        <option value="halfday">Halfday</option>
                                                        <option value="fullday">Fullday</option>
                                                        <option value="quarter">Quarter</option>
                                                        <option value="cl">Casual Leave</option>
                                                    </select>
                                                    
                                                </div> 
                                                <div class="d-flex justify-content-end px-3">
                                                    <?php if($errors->has('late_number')): ?>
                                                        <div class="text-danger">
                                                            <p><?php echo e($errors->first('late_number')); ?></p>
                                                        </div>
                                                    <?php endif; ?>
                                                </div>
                                                <div class="form-group d-flex align-items-center">
                                                    <label for="exceeding_late">Exceeding Number Of Late</label>
                                                    <select class="form-control" name="exceeding_late">
                                                        <option disabled selected>SELECT</option>
                                                        <option value="hours">Hourly Deduction</option>
                                                        <option value="halfday">Every Day Halfday</option>
                                                        <option value="quarter">Every Day Quarter</option>
                                                    </select>
                                                    
                                                </div> 
                                                <div class="d-flex justify-content-end px-3">
                                                    <?php if($errors->has('late_number')): ?>
                                                        <div class="text-danger">
                                                            <p><?php echo e($errors->first('late_number')); ?></p>
                                                        </div>
                                                    <?php endif; ?>
                                                </div>
                                            
                                            
                                                
                                                <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>
                                        
                                            </div>
                                        </div>
                                    </div>
                                </form>
                        
                            </div>
                            
                        </div>
                    </div>


                </div>

            </div>

                     
        </div>

    </main>
    <!-- end::main content -->
<?php $__env->stopSection(); ?>
<?php $__env->startPush('footer-script'); ?>
    <!-- begin::select2 -->
    
    <!-- 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/policy/add.blade.php ENDPATH**/ ?>