

<?php $__env->startSection('pageTitle', 'Vega Soft'); ?>
<?php $__env->startSection('page-content'); ?>



<style>
#dynamic_ajax_table_length ,.dt-buttons ,#dynamic_ajax_table_filter{
    //float: left;
}
.custom-design-modal{
max-width:70%;
}
.dt-buttons{
    height: 34px;
}
</style>


<div class="page-header">
<div class="row">
<div class="col-sm-12">
<h3 class="page-title">Employee View</h3>

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

<div class="card mb-0">
<div class="card-body">
<div class="row">
<div class="col-md-12">
<div class="profile-view">
<div class="profile-img-wrap">
<div class="profile-img">
<a href="javascript:void(0);"><img alt="" src="<?php echo e(asset('new_theme/img/profiles/nouser.png')); ?>"></a>
</div>
</div>
<div class="profile-basic">
<div class="row">
<div class="col-md-5">
<div class="profile-info-left">
<h3 class="user-name m-t-0 mb-0" id="emp_name"> &nbsp; </h3>
<h6 class="text-muted"><!-- UI/UX Design Team --></h6>
<small class="text-muted"><!-- Web Designer --></small>
<div class="staff-id">Employee Code :<span id="emp_code"></span></div>
<div class="staff-id">Serial No : <span id="serial_no"></span></div>
<div class="staff-id">Machine Code : <span id="mach_code"></span></div>
<div class="small doj text-muted">Date of Join :  <span id="doj"></span></div>

</div>
</div>
<div class="col-md-7">
<ul class="personal-info">
<li>
<div class="title">Phone:</div>
<div class="text"><a href="javascript:void(0)" id="phone"></a></div>
</li>
<li>
<div class="title">Birthday:</div>
<div class="text" id="dob"></div>
</li>
<li>
<li>
<div class="title">Guardian:</div>
<div class="text" id="guardian"></div>
</li>
<li>
<div class="title">Branch Name:</div>
<div class="text" id="branch_id" branch_id="branch_id"> &nbsp;</div>
</li>
<li>
 <div class="title">Gender:</div>
<div class="text" id="gender" gender='0'>

</div>
</li>

</ul>
</div>
</div>
</div>
<div class="pro-edit"><a data-bs-target="#profile_info" data-bs-toggle="modal" class="edit-icon text-primary" href="javascript:void(0);"><i class="fa fa-pencil"></i></a></div>
</div>
</div>
</div>
</div>
</div>
<div class="card tab-box">
<div class="row user-tabs">
<div class="col-lg-12 col-md-12 col-sm-12 line-tabs">
<ul class="nav nav-tabs nav-tabs-bottom">
<li class="nav-item"><a href="#emp_profile" data-bs-toggle="tab" class="nav-link active">Profile</a></li>
<li class="nav-item"><a href="#bank_statutory" data-bs-toggle="tab" class="nav-link">Bank & Statutory </a></li>
   <?php if(!is_null($leave)): ?>
<li class="nav-item"><a href="#leave" data-bs-toggle="tab" class="nav-link">leave </a></li>
<?php endif; ?>
</ul>
</div>
</div>
</div>

<?php if(is_null($details)): ?>
<input type="hidden" id="row_id" value="0">

    <?php endif; ?>
<?php if(!is_null($details)): ?>
<input type="hidden" id="row_id" value="<?php echo e($details->id); ?>">
    <?php endif; ?>
<div class="tab-content">
<div id="emp_profile" class="pro-overview tab-pane fade show active">
<div class="row">
<div class="col-md-6 d-flex">
<div class="card profile-box flex-fill">
<div class="card-body">
<h3 class="card-title">Personal Informations <a href="javascript:void(0);" class="edit-icon text-primary" data-bs-toggle="modal" data-bs-target="#personal_info_modal"><i class="fa fa-pencil"></i></a>

</h3>
<ul class="personal-info">
<li>
<div class="title">Address</div>
<div class="text" id="addres">
    
</div>
</li>
<li>
<div class="title">District</div>
<div class="text" id="district" district='0'>
    
</div>
</li>
<li>
<div class="title">State</div>
<div class="text" id="state">
    
</div>
</li>
<li>
<div class="title">
Country </div>
<div class="text" id="country" country='0'> 

</div>
</li>
<li>
<div class="title">Pincode</div>
<div class="text" id="pin">
    
</div>
</li>
<li>
<div class="title">Phone2</div>
<div class="text" id="phone2">
    
</div>
</li>
<li>
<div class="title">BloodGroup</div>
<div class="text" id="blood">
    
</div>
</li>
<li>
<div class="title">Religion</div>
<div class="text" id="religion">
    

</div>
</li>
</ul>
</div>
</div>
</div>
<div class="col-md-6 d-flex">
<div class="card profile-box flex-fill">
<div class="card-body">
<h3 class="card-title">Bank information
<a href="javascript:void(0);" class="edit-icon text-primary" onclick="bank_modal(0);"><i class="fa fa-pencil"></i></a>
<a href="javascript:void(0);" class="edit-icon text-danger" style="margin-right:8px;" onclick="bank_modal(1);"><i class="fa fa-plus"></i></a>
</h3>
<ul class="personal-info common_space">
<li>
<div class="title">Bank Name</div>
<div class="text" id="bank_name"> </div>
</li>
<li>
<div class="title">Bank account No.</div>
<div class="text" id="bank_ac_name"></div>
</li>
<li>
<div class="title">Bank A/C Name </div>
<div class="text" id="bank_ac_no"> </div>
</li>
<li>
<div class="title">Bank IFSC</div>
<div class="text" id="bank_ifsc"> </div>
</li>
</ul>
<hr>
<h5 class="section-title">Other <a href="javascript:void(0);" class="edit-icon text-primary" data-bs-toggle="modal" data-bs-target="#account_modal"><i class="fa fa-pencil"></i></a></h5>
<ul class="personal-info common_space">
<li>
<div class="title">PF A/C No</div>
<div class="text" id="pf_ac_no"> </div>
</li>
<li>
<div class="title">ESI A/C No</div>
<div class="text" id="esi_ac_no"></div>
</li>
<li>
<div class="title" >LWF A/C No </div>
<div class="text" id="lwf_ac_no"></div>
</li>
</ul>
</div>
</div>
</div>
</div>
<div class="row"></div>
<div class="row"></div>
</div>





<div class="tab-pane fade" id="bank_statutory">
<div class="card">
<div class="card-body">
<h3 class="card-title"> Basic Salary Information 

<a href="javascript:void(0);" class="edit-icon text-danger" style="margin-right:8px;" onclick="set_save();"><i class="fa fa-plus"></i></a> 

</h3>

<div class="row">
<div class="col-sm-2">
<div class="form-group">
<label class="col-form-label">Designation <span class="text-danger">*</span></label>
<select id="desg_id" class="form-control dsb focusable "> 
         <option value="0">Select</option>
          <?php $__currentLoopData = $des; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $z=>$det): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> 
           <option value="<?php echo e($det->desg_id); ?>"><?php echo e($det->desg_name); ?></option>
           <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </select>
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
<label class="col-form-label">Department</label>
<select id="dep_id" class="form-control dsb focusable "> 
         <option value="0">Select</option>
          <?php $__currentLoopData = $dept; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $z=>$det): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> 
           <option value="<?php echo e($det->dep_id); ?>"><?php echo e($det->dep_name); ?></option>
           <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </select>
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
<label class="col-form-label">Section</label>
<select id="sec_id" class="form-control dsb focusable "> 
 <option value="0">Select</option>
          <?php $__currentLoopData = $sec; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $z=>$det): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> 
           <option value="<?php echo e($det->dep_id); ?>"><?php echo e($det->dep_name); ?></option>
           <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </select>
</div>
</div>
<div class="col-sm-2">
<div class="form-group">
<label class="col-form-label">
Working Hour</label>
<input class="form-control dsb focusable mtime" autocomplete="off" type="text" id="w_hr">
</div>
</div>
<div class="col-sm-2">
<div class="form-group">
<label class="col-form-label">Payment type</label>
<select class="form-control dsb focusable" id="pay_type">
     <option value="0">Select</option>
<option value="Bank">Bank</option>
<option value="Cash">Cash</option>
</select>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-2">
<div class="form-group">
<label class="col-form-label">Salary amount </label>
<div class="input-group">
<span class="input-group-text"><i class="la la-rupee-sign"></i></span>
<input type="text" class="form-control dsb input_text" id="salary"  value="0.00">
</div>
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
<label class="col-form-label">HRA </label>
<div class="input-group">
<span class="input-group-text"><i class="la la-rupee-sign"></i></span>
<input type="text" class="form-control dsb focusable input_text"  value="0.00" id="hra">
</div>
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
<label class="col-form-label">Additional Earning  </label>
<div class="input-group">
<span class="input-group-text"><i class="la la-rupee-sign"></i></span>
<input type="text" class="form-control dsb focusable input_text"  value="0.00" id="add_erning">
</div>
</div>
</div>
<div class="col-sm-2">
    <div class="form-group">

<label class="col-form-label col-md-9" for="invalidCheck3">
DA From DA Point
<input checked="" name="da_mark" type="checkbox" id="invalidCheck3" onchange="da_R_only();" style="float: right;">
</label>
<div class="input-group">
<span class="input-group-text"><i class="la la-rupee-sign"></i></span>
<input type="text" class="form-control dsb focusable input_text" id="da_amount" value="0.00">
</div>

</div></div>


<div class="col-sm-2">
    <div class="form-group">
<label class="col-form-label">Start Date <span class="text-danger">*</span></label>
<input type="text" class="form-control dsb focusable input_text mdate"  id="start_date">
</div>
</div>



</div>


<div class="row">
<div class="col-sm-2">
<div class="form-group">
<label class="col-form-label">PF Amount </label>
<div class="input-group">
<span class="input-group-text"><i class="la la-rupee-sign"></i></span>
<input type="text" class="form-control dsb input_text" id="pf_amt"  value="0.00">
</div>
</div>
</div>
<div class="col-sm-2">
<div class="form-group">
<label class="col-form-label">ESI Amount </label>
<div class="input-group">
<span class="input-group-text"><i class="la la-rupee-sign"></i></span>
<input type="text" class="form-control dsb focusable input_text"  value="0.00" id="esi_amt">
</div>
</div>
</div>
<div class="col-sm-2">
<div class="form-group">
<label class="col-form-label">Pension Amount </label>
<div class="input-group">
<span class="input-group-text"><i class="la la-rupee-sign"></i></span>
<input type="text" class="form-control dsb focusable input_text"  value="0.00" id="pnsn_amt">
</div>
</div>
</div>



</div>








<hr>
<h3 class="card-title">Category Settings</h3>
<div class="row">
    <div class="form-group row">
<label class="col-form-label col-md-2">Category</label>
<div class="col-md-4">
<select class="form-control dsb form-select focusable" onchange="set_category();" id="cat_id">
<option value="0">-- Select --</option>
  <?php $__currentLoopData = $cat; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $z=>$catdata): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>  
           <option dp="<?php echo e($catdata->DAFromPoint); ?>"  md="<?php echo e($catdata->MaxWDays); ?>"  mon="<?php echo e($catdata->Monthly); ?>"  pfon="<?php echo e($catdata->PFOn); ?>"  esion="<?php echo e($catdata->ESIOn); ?>"  penon="<?php echo e($catdata->PensionFOn); ?>"  value="<?php echo e($catdata->emp_cat_id); ?>"  ><?php echo e($catdata->CategoryCode); ?></option>
           <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</select>
</div>
<label class="col-form-label col-md-3">Max. Working Days</label>
<div class="col-md-3">
<input class="form-control dsb focusable  input_text" autocomplete="off" type="text" id="MaxWDays">
</div>
</div>
</div>
<div class="col-lg-12" style="padding-top: 10px;">
<div class="row" >
    

<div class="col-lg-3">
<div class="card mb-0" style="height: 100%;">
<div class="card-header">
<h4 class="card-title mb-0" >Salary Calculated</h4>
</div>
<div class="card-body">
  
<div class="col-md-10">

<div class="radio">
<label>
<input type="radio" name="dm_check" value="0" class="dsb">Daily</label>
</div>
<div class="radio">
<label>
<input type="radio" name="dm_check" class="dsb" value="1">Monthly
</label>
</div>
</div>
</div>
</div>


</div>

<div class="col-lg-3">

<div class="card mb-0" style="height: 100%;">
<div class="card-header">
<h4 class="card-title mb-0">PF Deduction On</h4>
</div>
<div class="card-body">
  
<div class="col-md-10">
<div class="checkbox">
<label>
<input type="checkbox" name="pf_dedc" class="pf_check dsb" value="1"> Basic
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" name="pf_dedc" class="pf_check dsb" value="2"> DA
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" name="pf_dedc" class="pf_check dsb" value="3"> HRA
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" name="pf_dedc" class="pf_check dsb" value="3"> Additional Earning
</label>
</div>
</div>
</div>
</div>
</div>

<div class="col-lg-3">

<div class="card mb-0" style="height: 100%;">
<div class="card-header">
<h4 class="card-title mb-0">ESI Deduction On</h4>
</div>
<div class="card-body">
<div class="col-md-10">
<div class="checkbox">
<label>
<input type="checkbox" name="esi_dedc" class="esi_check dsb" value="1"> Basic
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" name="esi_dedc" class="esi_check dsb" value="2"> DA
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" name="esi_dedc" class="esi_check dsb" value="3"> HRA
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" name="esi_dedc" class="esi_check dsb" value="4"> Additional Earning
</label>
</div>
</div>
</div>
</div>
</div>
<div class="col-lg-3">

<div class="card mb-0" style="height: 100%;">
<div class="card-header">
<h4 class="card-title mb-0">PensionF Deduction On</h4>
</div>
<div class="card-body">
<div class="col-md-10">
<div class="checkbox">
<label>
<input type="checkbox" name="pen_dedc" class="pen_dedc dsb" value="1"> Basic
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" name="pen_dedc" class="pen_dedc dsb" value="2"> DA
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" name="pen_dedc" class="pen_dedc dsb" value="3"> HRA
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" name="pen_dedc" class="pen_dedc dsb" value="4"> Additional Earning
</label>
</div>
</div>
</div>
</div>
</div>

</div>


</div>

<hr>
<h3 class="card-title"> L.W.F Setting</h3>
<div class="row">
    <div class="form-group row">

<label class="col-form-label col-md-3">L.W.F</label>
<div class="col-md-3">
<div class="input-group">
<span class="input-group-text"><i class="la la-rupee-sign"></i></span>
<input type="text" class="form-control dsb focusable input_text" id="LWF" value="<?php echo e($set_allownce->LWF); ?>">
</div>
</div>
</div>
</div>
<hr>
<h3 class="card-title"> Allowence</h3>
<div class="row">
    
<div class="form-group row">
<label class="col-lg-3 col-form-label">Allowence Per Day</label>
<div class="col-lg-4">
<input type="text" id="Allowance" class="form-control dsb focusable input_text form-control-sm" value="<?php echo e($set_allownce->Allowance); ?>">
</div>
</div>


<div class="form-group row">
<label class="col-lg-3 col-form-label">Monthly Allowance </label>
<div class="col-lg-4">
<input type="text" id="Allowance_month" class="form-control dsb focusable input_text form-control-sm" value="<?php echo e($set_allownce->Allowance_month); ?>">
</div>
</div>

<div class="form-group row">
<label class="col-lg-3 col-form-label">OverTime Weightage </label>
<div class="col-lg-4">
<input type="text" id="OTWage" class="form-control dsb focusable input_text form-control-sm"  value="<?php echo e($set_allownce->OTWage); ?>">
</div>
</div>
<div class="form-group row">
<label class="col-lg-3 col-form-label">City Allowance</label>
<div class="col-lg-4">
<input type="text" id="city_allowance" class="form-control dsb focusable input_text form-control-sm"  value="<?php echo e($set_allownce->city_allowance); ?>">
</div>
</div>
<?php $__currentLoopData = $allownce; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $al): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<div class="form-group row">
<label class="col-lg-3 col-form-label"><?php echo e($al->allowance); ?></label>
<div class="col-lg-4">
<input type="text" id="<?php echo e($al->id); ?>" value="<?php echo e($al->allowance_amount); ?>" class="form-control dsb focusable input_text form-control-sm allowance_amount">
</div>



</div>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

</div>
<div class="row"></div>
<div class="submit-section" id="save_pd">
<button class="btn btn-primary submit-btn" type="submit" onclick="save_prl_details();">Save</button>
</div>

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


<div id="leave" class="tab-pane fade">
<div class="row">
<div class="col-md-12 d-flex">
<div class="card profile-box flex-fill">
<div class="card-body">
<h3 class="card-title">Leave Information</h3>
<ul class="personal-info common_space">
    <?php if(!is_null($leave)): ?>
     <?php $__currentLoopData = $leave; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $il=> $lday): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> 
        

<li>
<div class="checkbox" for="checkbox<?php echo e($lday->LeaveID); ?>">
<label>
<input type="checkbox" name="leave_emp"  id="checkbox<?php echo e($lday->LeaveID); ?>" LeaveID="<?php echo e($lday->LeaveID); ?>" LeaveName="<?php echo e($lday->LeaveName); ?>" Monthly="<?php echo e($lday->Monthly); ?>" max_leave_day="<?php echo e($lday->max_leave_day); ?>" cal_bal_leave="<?php echo e($lday->cal_bal_leave); ?>" <?php echo e(($lday->ld_id) ? "checked" : ""); ?> > <?php echo e($lday->LeaveName); ?></label>
</div>
</li>
           <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
           <?php endif; ?>
</ul>
</div>
<div class="submit-section" id="save_leave" style="">
<button class="btn btn-primary submit-btn" type="submit" onclick="save_leave_details();">Save</button>
</div>
</div>
</div>
</div>

</div>
</div>
<!-- modal-first -->
<div id="profile_info" class="modal custom-modal fade edit_modal_option" role="dialog">
<div class="modal-dialog modal-dialog-centered modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Profile Information</h5>
<button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-12">
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label>Name</label>
<input type="text" id="memp_name" class="form-control focusable input_text " >
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Husband / Father's Name</label>
<input type="text" id="mguardian" class="form-control focusable input_text ">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Birth Date</label>
<div class="cal-icon">
<input type="text" id="mdob" class="form-control  mdate">
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Gender</label>
<select class="form-control focusable " id="mgender">
<option value="0">-select-</option>
<option value="1">Male</option>
<option value="2">Female</option>
<option value="3">Transgender</option>
</select>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Join Date</label>
<div class="cal-icon">
<input type="text" id="mdoj" class="form-control input_text mdate">
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Phone</label>
<input type="text" id="mphone" class="form-control focusable input_text ">
</div>
</div>
</div>
</div>
</div>
<div class="row">

<div class="col-md-6">
<div class="form-group">
<label>Branch Name</label>
<select class="form-control focusable " id="mbranch_id"> 
         <option value="0">Select Branch</option>
           <?php $__currentLoopData = $brn; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $z=>$det): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> 
           <option value="<?php echo e($det->BranchID); ?>"><?php echo e($det->BranchName); ?></option>
           <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </select>
</div>
</div>
<div class="col-md-6">
 <div class="form-group">
<label>Employee Code</label>
<input type="text" class="form-control focusable input_text "  id="memp_code">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Serial No</label>
<input type="text" class="form-control focusable input_text " id="mserial_no">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Machine Code</label>
<input type="text" class="form-control focusable input_text "  id="mmach_code">
</div>
</div>

</div>
<div class="submit-section">
<button class="btn btn-primary" onclick="update_field(1);">Submit</button>
</div>

</div>
</div>
</div>
</div>
<!-- modal-first-end -->
<!-- modal-second -->
<div id="personal_info_modal" class="modal custom-modal fade edit_modal_option" role="dialog">
<div class="modal-dialog modal-dialog-centered modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Personal Information</h5>
<button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label>Address </label>
<textarea rows="2" cols="5" class="form-control focusable input_text " id="maddres"></textarea>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label>District</label>
<select id="mdistrict" class="form-control focusable " onchange="get_district();"></select>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label>State</label>
<select id="mstate" class="form-control focusable " onchange="get_district();"></select>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Country <!-- <span class="text-danger">*</span> --></label>
<select id="mcountry" class="form-control focusable " onchange="get_state();"></select>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Pincode</label>
<input type="text" id="mpin" class="form-control focusable input_text">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Phone2<!-- <span class="text-danger">*</span> --></label>
<input type="text" id="mphone2" class="form-control focusable input_text  ">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label>BloodGroup</label>
<select id="mblood" name="blood" class="form-control focusable "> 
         <option value="">Select</option>
         <option value="A+">A+</option>
         <option value="A-">A-</option>
         <option value="B+">B+</option>
         <option value="B-">B-</option>
         <option value="AB+">AB+</option>
         <option value="AB-">AB-</option>
         <option value="O+">O+</option>
         <option value="O-">O-</option>
        </select>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Religion</label>
<select id="mreligion" name="" class="form-control focusable "> 
           <option value="">Select</option>
         <option value="Hindu">Hindu</option>
         <option value="Muslim">Muslim</option>
         <option value="Christian">Christian</option>
         <option value="Sikh">Sikh</option>
         <option value="Buddhist">Buddhist</option>
         <option value="Others">Others</option>
        </select>
</div>
</div>
</div>
<div class="submit-section">
<button class="btn btn-primary "  onclick="update_field(2);">Submit</button>
</div>

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

<!-- modal-second-end -->
<!-- modal-third -->
<div id="bank_modal" class="modal custom-modal fade" role="dialog">
<div class="modal-dialog modal-dialog-centered modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="bank_modal_head"></h5>
<button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">

<div class="row">
<div class="col-md-6">
<div class="form-group">
<label>Bank Name</label>
<input type="text" id="mbank_name" class="form-control focusable input_text">
</div>
</div>
<div class="col-md-6"></div>
<div class="col-md-6">
<div class="form-group">
<label>Bank Account Name </label>
<input type="text" id="mbank_ac_name" class="form-control focusable input_text">
</div>
</div>
<div class="col-md-6"></div>
<div class="col-md-6">
<div class="form-group">
<label>Bank account No. </label>
<input type="text" id="mbank_ac_no" class="form-control focusable input_text">
</div>
</div>
<div class="col-md-6"></div>
<div class="col-md-6">
<div class="form-group">
<label>Bank IFSC </label>
<input type="text" id="mbank_ifsc" class="form-control focusable input_text">
</div>
</div>
<div class="col-md-6"></div>

</div>
<div class="submit-section">
    <input type="hidden" value="0" id="bnk_flag">
<button class="btn btn-primary submit-btn" onclick="update_field(3);">Submit</button>
</div>

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

<!-- modal-third-end -->
<!-- modal-fourth -->
<div id="account_modal" class="modal custom-modal fade edit_modal_option" role="dialog">
<div class="modal-dialog modal-dialog-centered modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Other Information</h5>
<button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">

<div class="row">
<div class="col-md-6">
<div class="form-group">
<label>PF A/C No</label>
<input type="text" id="mpf_ac_no" class="form-control focusable input_text">
</div>
</div>
<div class="col-md-6"></div>
<div class="col-md-6">
<div class="form-group">
<label>ESI A/C No</label>
<input type="text" id="mesi_ac_no" class="form-control focusable input_text">
</div>
</div>
<div class="col-md-6"></div>
<div class="col-md-6">
<div class="form-group">
<label>LWF A/C No </label>
<input type="text" id="mlwf_ac_no" class="form-control focusable input_text">
</div>
</div>
<div class="col-md-6"></div>

</div>
<div class="submit-section">
<button class="btn btn-primary submit-btn"  onclick="update_field(4);">Submit</button>
</div>

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


<!-- modal-fourth-end -->
 <?php $__env->stopSection(); ?>




<?php $__env->startSection('page-script'); ?>
<script src="<?php echo e(asset('project-js\vega-front-scripts.js')); ?>"></script>
<script type="text/javascript">
         $( document ).ready(function() {
   $('.dsb').prop('readonly',true);

   $('.dsb').prop('disabled',true);
   $('#save_pd,#save_leave').hide();
});
 

/*set_mn();

fetch_view_table();*/

function set_save() {
    $('#save_pd').show();
    $('.dsb').prop('readonly',false);

   $('.dsb').prop('disabled',false);
}
function submit_form() {
 status=0;
 if($.trim($('#country').val())==0){
    alert('Select Country');
    $('#country').focus();
    status==1;
    return;
 }
 if($.trim($('#state_name').val())==""){
    alert('Enter State Name');
    $('#state_name').focus();
    status==1;
    return;
 }
 if($.trim($('#state_code').val())==0){
    alert('Enter State Code');
    $('#state_code').focus();
    status==1;
    return;
 }
 if($.trim($('#state_code_number').val())==0){
    alert('Enter State Code No');
    $('#state_code_number').focus();
    status==1;
    return;
 }



 if (status==0) {
Save_form();
 }
}
//http://192.168.18.128/prl_api/ij/prl_branch_edit.php

function call_edit_modal(row_id) {
$('#add_btn').hide();
$('#edit_btn').show();

    $('#row_id').val(row_id);
    $('#hidden_status').val(1);
        $.ajax({
              type: 'POST',
               async: false,
                url: '/get_data',
                data: {
                     '_token': "<?php echo e(csrf_token()); ?>",
                    'cid':"<?php echo e(Session::get('cid')); ?>",
                    'CID': "<?php echo e(Session::get('CID')); ?>",
                    'b_id': "<?php echo e(Session::get('b_id')); ?>",
                     row_id: row_id,
              url1:'prl_state_edit.php'
                },
                error: function (request, error) {
                    alert("Please Wait, Loading...");
                },
                success: function (response) {
 datas=response.edit;

          
              $('.add_main_modal').modal('show');
            $('#country').val(datas[0]['country']); 
            $('#state_name').val(datas[0]['state_name']); 
            $('#state_code').val(datas[0]['state_code']); 
            $('#state_code_number').val(datas[0]['state_code_number']); 
   
            
       // start_focus();   
        }
          
     });  
}

  function update_field(flag) {
    hidden_status=0;
        if (flag==1) {
             if($.trim($('#memp_name').val())==''){
    alert('Enter Employee Name');
    $('#memp_name').focus();
    status==1;
    return;
 }
 if($.trim($('#memp_code').val())==''){
    alert('Enter Employee Code');
    $('#memp_code').focus();
    status==1;
    return;
 }
 if($.trim($('#mbranch_id').val())=='0'){
    alert('Enter Employee Branch');
    $('#mbranch_id').focus();
    status==1;
    return;
 }
 if($.trim($('#mphone').val())==''){
    alert('Enter Employee Phone');
    $('#mphone').focus();
    status==1;
    return;
 }


        }

         if (flag==3) {
            if($.trim($('#mbank_ifsc').val())==''){
                alert('Enter Bank IFSC');
                $('#mbank_ifsc').focus();
                status==1;
                return;
            }
            if($.trim($('#mbank_name').val())==''){
                alert('Enter Bank Name');
                $('#mbank_name').focus();
                status==1;
                return;
            }
            if($.trim($('#mbank_ac_no').val())==''){
                alert('Enter Bank A/C No');
                $('#mbank_ac_no').focus();
                status==1;
                return;
            }
            if($.trim($('#mbank_ac_name').val())==''){
                alert('Enter Bank A/C Name');
                $('#mbank_ac_name').focus();
                status==1;
                return;
            }
         }


          if(status==0) {
update_field_save(flag);
 }



  }
  function update_field_save(flag) {
    if (flag==1) {
  arr={
               'emp_id':  "<?php echo e($epl_id); ?>",
               'cid':"<?php echo e(Session::get('cid')); ?>",
                    'CID': "<?php echo e(Session::get('CID')); ?>",
                    'b_id': "<?php echo e(Session::get('b_id')); ?>",
              'emp_name':$.trim($('#memp_name').val()),
              'guardian':$.trim($('#mguardian').val()),
              'emp_code':$.trim($('#memp_code').val()),
              'serial_no':$.trim($('#mserial_no').val()),
              'mach_code':$.trim($('#mmach_code').val()),
              'phone':$.trim($('#mphone').val()),
              'dob':$.trim($('#mdob').val()),
              'doj':$.trim($('#mdoj').val()),
              'branch_id':$.trim($('#mbranch_id').val()),
              'gender':$.trim($('#mgender').val()),
              'company_id':"<?php echo e(Session::get('CID')); ?>",
              'added_by':"<?php echo e(Session::get('user_id')); ?>",
              'flag':flag
};
}else  if (flag==2) {
  arr={
               'emp_id':  "<?php echo e($epl_id); ?>",
               'cid':"<?php echo e(Session::get('cid')); ?>",
                    'CID': "<?php echo e(Session::get('CID')); ?>",
                    'b_id': "<?php echo e(Session::get('b_id')); ?>",
              'addres':$.trim($('#maddres').val()),
              'country':$.trim($('#mcountry').val()),
              'district':$.trim($('#mdistrict').val()),
              'state':$.trim($('#mstate').val()),
              'pin':$.trim($('#mpin').val()),
              'phone2':$.trim($('#mphone2').val()),
              'religion':$.trim($('#mreligion').val()),
              'blood':$.trim($('#mblood').val()),
              'company_id':"<?php echo e(Session::get('CID')); ?>",
              'added_by':"<?php echo e(Session::get('user_id')); ?>",
              'flag':flag
};
}else  if (flag==3) {
  arr={
               'emp_id':  "<?php echo e($epl_id); ?>",
               'cid':"<?php echo e(Session::get('cid')); ?>",
                    'CID': "<?php echo e(Session::get('CID')); ?>",
                    'b_id': "<?php echo e(Session::get('b_id')); ?>",
              'bnk_flag':$.trim($('#mbnk_flag').val()),
              'bank_ifsc':$.trim($('#mbank_ifsc').val()),
              'bank_name':$.trim($('#mbank_name').val()),
              'bank_ac_no':$.trim($('#mbank_ac_no').val()),
              'bank_ac_name':$.trim($('#mbank_ac_name').val()),
              'company_id':"<?php echo e(Session::get('CID')); ?>",
              'added_by':"<?php echo e(Session::get('user_id')); ?>",
              'flag':flag
};
}else  if (flag==4) {
  arr={
               'emp_id':  "<?php echo e($epl_id); ?>",
               'cid':"<?php echo e(Session::get('cid')); ?>",
                    'CID': "<?php echo e(Session::get('CID')); ?>",
                    'b_id': "<?php echo e(Session::get('b_id')); ?>",
              'pf_ac_no':$.trim($('#mpf_ac_no').val()),
              'esi_ac_no':$.trim($('#mesi_ac_no').val()),
              'lwf_ac_no':$.trim($('#mlwf_ac_no').val()),
              'company_id':"<?php echo e(Session::get('CID')); ?>",
              'added_by':"<?php echo e(Session::get('user_id')); ?>",
              'flag':flag
};
}
           $.ajax({
          url: "/store_data",
          type: "POST",
          data:{
             '_token': "<?php echo e(csrf_token()); ?>",
              json_data: JSON.stringify(arr),
              url1:'prl_update_emp_view.php'
             
          },
          success:function(response){
            
            console.log(response);
            if (response) {
              alert(response['msg']);
            
               $('.modal').modal('hide');
               fetch_view_table();
            }else{

            }
          },
          error: function(response) {
          }
         });
  }

  $( ".add_main_modal" ).on('hidden.bs.modal', function(){ $('#add_btn').show();
$('#edit_btn').hide();
 $('#hidden_status').val(0);
 $('.add_main_modal .form-control').val('');
});

  $( ".edit_modal_option" ).on('shown.bs.modal', function(){ 
   emp_name= $('#emp_name').html();
   guardian=$('#guardian').html();
   gender=$('#gender').attr('gender');
   branch_id=$('#branch_id').attr('branch_id');
   emp_code=$('#emp_code').html();
serial_no=$('#serial_no').html();
mach_code=$('#mach_code').html();
dob=$('#dob').html();
doj=$('#doj').html();
phone=$('#phone').html();
$('#memp_name').val(emp_name);
$('#mguardian').val(guardian);
$('#mgender').val(gender);
$('#mbranch_id').val(branch_id);
$('#memp_code').val(emp_code);
$('#mserial_no').val(serial_no);
$('#mmach_code').val(mach_code);
$('#mdob').val(dob);
$('#mdoj').val(doj);
$('#mphone').val(phone);
   district=$('#district').attr('district');
   state=$('#state').attr('state');
   country=$('#country').attr('country');
addres=$('#addres').html();
pin=$('#pin').html();
phone2=$('#phone2').html();
religion=$('#religion').html();
blood=$('#blood').html();
pin=$('#pin').html();
pf_ac_no=$('#pf_ac_no').html();
esi_ac_no=$('#esi_ac_no').html();
lwf_ac_no=$('#lwf_ac_no').html();
$('#mdistrict').val(district);
$('#mstate').val(state);
$('#mcountry').val(country);
$('#maddres').val(addres);
$('#mpin').val(pin);
$('#mphone2').val(phone2);
$('#mreligion').val(religion);
$('#mblood').val(blood);
$('#mpin').val(pin);
pf_ac_no=$('#pf_ac_no').html();
esi_ac_no=$('#esi_ac_no').html();
lwf_ac_no=$('#lwf_ac_no').html();
$('#mpf_ac_no').val(pf_ac_no);
$('#mesi_ac_no').val(esi_ac_no);
$('#mlwf_ac_no').val(lwf_ac_no);
});

 set_view_menu();
function set_view_menu() {
      $.ajax({
              type: 'POST',
               async: false,
                url: '/get_data',
                data: {
                     '_token': "<?php echo e(csrf_token()); ?>",
                    'cid':"<?php echo e(Session::get('cid')); ?>",
                    'CID': "<?php echo e(Session::get('CID')); ?>",
                    'b_id': "<?php echo e(Session::get('b_id')); ?>",
                    'branch_id': "<?php echo e(Session::get('b_id')); ?>",
                     row_id:  "<?php echo e($epl_id); ?>",
              url1:'prl_view_employee.php'
                },
                error: function (request, error) {
                    alert("Please Wait, Loading...");
                },
                success: function (response) {
                     data=response.edit;
                     bank=response.bank;
                     detail=response.detail;
$('#emp_name').html(data[0]['emp_name']);
$('#guardian').html(data[0]['guardian']);
$('#gender').html(data[0]['gender_lb']);
$('#gender').attr('gender',data[0]['gender']);
$('#addres').html(data[0]['addres']);
$('#country').html(data[0]['country_name']);
$('#country').attr('country',data[0]['country']);
$('#state').html(data[0]['state_name']);
$('#state').attr('state',data[0]['state']);
$('#district').html(data[0]['district_name']);
$('#district').attr('district',data[0]['district']);
$('#emp_code').html(data[0]['emp_code']);
$('#serial_no').html(data[0]['serial_no']);
$('#mach_code').html(data[0]['mach_code']);
$('#phone').html(data[0]['phone']);
$('#blood').html(data[0]['blood']);
$('#dob').html(data[0]['dob']);
$('#religion').html(data[0]['religion']);
$('#doj').html(data[0]['doj']);
$('#pin').html(data[0]['pin']);
$('#phone2').html(data[0]['phone2']);
$('#pf_ac_no').html(data[0]['pf_ac_no']);
$('#esi_ac_no').html(data[0]['esi_ac_no']);
$('#lwf_ac_no').html(data[0]['lwf_ac_no']);

$('#branch_id').html(data[0]['BranchName']); 
$('#branch_id').attr('branch_id',data[0]['branch_id']); 
if(bank.length>0){
$('#bank_ifsc').html(bank[0]['bank_ifsc']); 
$('#bank_ac_no').html(bank[0]['bank_ac_name']); 
$('#bank_ac_name').html(bank[0]['bank_ac_no']); 
$('#bank_name').html(bank[0]['bank_name']); 
}

$('#cat_id').val(detail[0]['emp_cat_id']);
$('#desg_id').val(detail[0]['desg_id']);
$('#dep_id').val(detail[0]['dep_id']);
$('#sec_id').val(detail[0]['sec_id']);
$('#w_hr').val(detail[0]['w_hr']);
$('#pay_type').val(detail[0]['pay_type']);
$('#pf_amt').val(detail[0]['pf_amt']);
$('#esi_amt').val(detail[0]['esi_amt']);
$('#pnsn_amt').val(detail[0]['pnsn_amt']);
$('#salary').val(detail[0]['salary']);
$('#hra').val(detail[0]['hra']);
$('#add_erning').val(detail[0]['add_erning']);
$('#da_amount').val(detail[0]['DAFromPoint']);
$('#MaxWDays').val(detail[0]['MaxWDays']);
//$('#Monthly').val(detail[0]['Monthly']);
$('input[name="dm_check"][value="'+detail[0]['Monthly']+'"]').prop('checked',true);

esion=$.trim(detail[0]['ESIOn']).split(',');
pfon=$.trim(detail[0]['PFOn']).split(',');
penon=$.trim(detail[0]['PensionFOn']).split(',');
$('#Allowance_id').val(detail[0]['Allowance_id']);
$('#Allowance').val(detail[0]['Allowance']);
$('#Allowance_month').val(detail[0]['Allowance_month']);
$('#LWF').val(detail[0]['LWF']);
$('#OTWage').val(detail[0]['OTWage']);
$('#city_allowance').val(detail[0]['city_allowance']);
$('#start_date').val(detail[0]['sd']);

   $(esion).each(function function_name(i,val) {
       $('input[name="esi_dedc"][value="'+val+'"]').prop('checked',true);
   });
 $(penon).each(function function_name(i,val) {
       $('input[name="pen_dedc"][value="'+val+'"]').prop('checked',true);
   });
 $(pfon).each(function function_name(i,val) {
       $('input[name="pf_dedc"][value="'+val+'"]').prop('checked',true);
   });
 //$('.personal-info:has(.text:empty)').html('&nbsp');
        }
          
     }); 
}


get_country();
function get_country() {
        $.ajax({
              type: 'POST',
               async: false,
                url: '/get_data',
                data: {
                     '_token': "<?php echo e(csrf_token()); ?>",
                    'cid':"<?php echo e(Session::get('cid')); ?>",
                    'CID': "<?php echo e(Session::get('CID')); ?>",
                    'b_id': "<?php echo e(Session::get('b_id')); ?>",
                     row_id: 'X',
              url1:'prl_get_country.php'
                },
                error: function (request, error) {
                    alert("Please Wait, Loading...");
                },
                success: function (response) { 
$('#mcountry').html("<option val='0'>-Select Country-</option>");
 $(response).each(function (i,val){
$('#mcountry').append("<option value='"+val['country_id']+"'>"+val['country_name']+"</option>");
 });
$('#mcountry').val(103);
get_state();
        }
          
     });  
}


function get_state() {
        $.ajax({
              type: 'POST',
               async: false,
                url: '/get_data',
                data: {
                     '_token': "<?php echo e(csrf_token()); ?>",
                    'cid':"<?php echo e(Session::get('cid')); ?>",
                    'CID': "<?php echo e(Session::get('CID')); ?>",
                    'b_id': "<?php echo e(Session::get('b_id')); ?>",
                     row_id: $('#mcountry').val(),
              url1:'prl_get_state.php'
                },
                error: function (request, error) {
                    alert("Please Wait, Loading...");
                },
                success: function (response) {
$('#mstate').html("<option val='0'>-Select State-</option>");
 $(response).each(function (i,val){
$('#mstate').append("<option value='"+val['state_id']+"'>"+val['state_name']+"</option>");
 });
$('#mstate').val(10);
get_district();
        }
          
     });  
}


function get_district() {
        $.ajax({
              type: 'POST',
               async: false,
                url: '/get_data',
                data: {
                     '_token': "<?php echo e(csrf_token()); ?>",
                    'cid':"<?php echo e(Session::get('cid')); ?>",
                    'CID': "<?php echo e(Session::get('CID')); ?>",
                    'b_id': "<?php echo e(Session::get('b_id')); ?>",
                     row_id: $('#mstate').val(),
              url1:'prl_get_district.php'
                },
                error: function (request, error) {
                    alert("Please Wait, Loading...");
                },
                success: function (response) {
$('#mdistrict').html("<option val='0'>-Select District-</option>");
 $(response).each(function (i,val){
$('#mdistrict').append("<option value='"+val['district_id']+"'>"+val['district_name']+"</option>");
 });

$('#mdistrict').val(4);
        }
          
     });  
}
function bank_modal(argument) {
   $('#bank_modal').modal('show');
   if (argument==1) {
    $('#bank_modal_head').html('Add Bank Information');
    $('#bnk_flag').val(0);
   }else{
    bank_name=$('#bank_name').html();
bank_ac_name=$('#bank_ac_name').html();
bank_ac_no=$('#bank_ac_no').html();
bank_ifsc=$('#bank_ifsc').html();
$('#mbank_name').val(bank_name);
$('#mbank_ac_name').val(bank_ac_name);
$('#mbank_ac_no').val(bank_ac_no);
$('#mbank_ifsc').val(bank_ifsc);
    $('#bank_modal_head').html('Update Bank Information');
     $('#bnk_flag').val(1);
   }
}

function da_R_only() {
    if($('input[name="da_mark"]').prop('checked')){
        $('#da_amount').prop('readonly',false);
    }else{
            $('#da_amount').prop('readonly',true);
    }

}
function set_category() {
   cat_id=$('#cat_id').val();
   md=$('#cat_id option:selected').attr('md');
   mon=$('#cat_id option:selected').attr('mon');
   esion=$.trim($('#cat_id option:selected').attr('esion')).split(',');
   pfon=$.trim($('#cat_id option:selected').attr('pfon')).split(',');
   penon=$.trim($('#cat_id option:selected').attr('penon')).split(',');
   $('#MaxWDays').val(md);
   $('input[name="dm_check"][value="'+mon+'"]').prop('checked',true);
   $(esion).each(function function_name(i,val) {
       $('input[name="esi_dedc"][value="'+val+'"]').prop('checked',true);
   });
 $(penon).each(function function_name(i,val) {
       $('input[name="pen_dedc"][value="'+val+'"]').prop('checked',true);
   });
 $(pfon).each(function function_name(i,val) {
       $('input[name="pf_dedc"][value="'+val+'"]').prop('checked',true);
   });

}

function save_prl_details() {
     var pf_dedc='';
          pf_dedc = $("input[name='pf_dedc']:checked").map(function(){
                      return $(this).val();
                    }).get().join(',');


                    var esi_dedc='';
          esi_dedc = $("input[name='esi_dedc']:checked").map(function(){
                      return $(this).val();
                    }).get().join(',');
                    var pen_dedc='';
          pen_dedc = $("input[name='pen_dedc']:checked").map(function(){
                      return $(this).val();
                    }).get().join(',');
          allo=[];
          $(".allowance_amount").each(function(){
           tarray={
            'Allowance_id':$(this).attr('id'),
            'Allowance':$(this).val(),
          }
          allo.push(tarray);
      });
     arr={
               'emp_id':  "<?php echo e($epl_id); ?>",
               'cid':"<?php echo e(Session::get('cid')); ?>",
              'b_id': "<?php echo e(Session::get('b_id')); ?>",
              'desg_id':$.trim($('#desg_id').val()),
              'dep_id':$.trim($('#dep_id').val()),
              'sec_id':$.trim($('#sec_id').val()),
              'w_hr':$.trim($('#w_hr').val()),
              'pay_type':$.trim($('#pay_type').val()),


              'pf_amt':$.trim($('#pf_amt').val()),
              'esi_amt':$.trim($('#esi_amt').val()),
              'pnsn_amt':$.trim($('#pnsn_amt').val()),

              'salary':$.trim($('#salary').val()),
               'hra':$.trim($('#hra').val()),
              'add_erning':$.trim($('#add_erning').val()),
              'emp_cat_id':$.trim($('#cat_id').val()),
              'DAFromPoint':$.trim($('#da_amount').val()),
              'Allowance':$.trim($('#Allowance').val()),
              'Allowance_month':$.trim($('#Allowance_month').val()),
              'LWF':$.trim($('#LWF').val()),
              'OTWage':$.trim($('#OTWage').val()),
              'MaxWDays':$.trim($('#MaxWDays').val()),
              'city_allowance':$.trim($('#city_allowance').val()),
              'start_date':$.trim($('#start_date').val()),
              'Monthly':$('input[name="dm_check"]:checked').val(),
              'company_id':"<?php echo e(Session::get('CID')); ?>",
              'added_by':"<?php echo e(Session::get('user_id')); ?>",
              'PFOn':pf_dedc,
              'ESIOn':esi_dedc,
              'PensionFOn':pen_dedc,
              'allo':allo
};

       $.ajax({
          url: "/store_data",
          type: "POST",
          data:{
             '_token': "<?php echo e(csrf_token()); ?>",
              json_data: JSON.stringify(arr),
              url1:'prl_save_emp_details.php'
             
          },
          success:function(response){
            
            console.log(response);
            if (response) {
              alert(response['msg']);
            
               $('.modal').modal('hide');
               fetch_view_table();
            }else{

            }
          },
          error: function(response) {
          }
         });
}
$(document).on('change','input[name="leave_emp"]',function(){
if($('input[name="leave_emp"]:checked').length>0){
    $('#save_leave').show();
}else{
 $('#save_leave').hide();
}
});

function save_leave_details(){
leave=[];
          $("input[name='leave_emp']:checked").each(function(){
                tr={           
                    'LeaveID': $(this).attr('LeaveID'),
                      'LeaveName':$(this).attr('LeaveName'),
                      'Monthly':$(this).attr('Monthly'),
                      'max_leave_day':$(this).attr('max_leave_day'),
                      'cal_bal_leave':$(this).attr('cal_bal_leave'),
                      'emp_id':  "<?php echo e($epl_id); ?>",
                      'added_by':"<?php echo e(Session::get('user_id')); ?>",
                         'company_id':"<?php echo e(Session::get('CID')); ?>",
                  }
                  leave.push(tr);
                    });
     arr={
               'emp_id':  "<?php echo e($epl_id); ?>",
               'cid':"<?php echo e(Session::get('cid')); ?>",
                    'CID': "<?php echo e(Session::get('CID')); ?>",
                    'b_id': "<?php echo e(Session::get('b_id')); ?>",
              
              'company_id':"<?php echo e(Session::get('CID')); ?>",
              'added_by':"<?php echo e(Session::get('user_id')); ?>",
              'leave':leave
};
       $.ajax({
          url: "/store_data",
          type: "POST",
         
          data:{
             '_token': "<?php echo e(csrf_token()); ?>",
              json_data: JSON.stringify(arr),
              url1:'save_leave_details.php'
             
          },
          success:function(response){
            
            console.log(response);
            if (response) {
              alert(response['msg']);
            
               $('.modal').modal('hide');
               fetch_view_table();
            }else{

            }
          },
          error: function(response) {
          }
         });
}
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.admin', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH D:\xampp\htdocs\payroll\resources\views/viw_employee.blade.php ENDPATH**/ ?>