@extends('Layout.employees_master')

@section('title', 'Employees')

@section('header-include')
<link rel="stylesheet" href="/js/select3/bootstrapselect.min.css" type="text/css"/>
<link rel="stylesheet" href="/js/select3/bootstrap.min.css" type="text/css"/>
<style>
form {
    border-radius: 5px; 
    width:100%;   
    background-color: #FFFFFF;
    overflow: hidden;
  }

  p span {
    color: #F00;
  }

  p {
    margin: 0px;
    font-weight: 500;
    line-height: 2;
    color:#333;
  }

  a {
    text-decoration:inherit
  }


  .form-group {
    overflow: hidden;
    clear: both;
  }
  .form-control {
      
      position:relative;
      clear: both;    
      margin-top: 2px;
      display:inline-inline;    
      margin-right: 10px;
  }
  .accordion {
    background-color: #eee;
    color: #444;
    cursor: pointer;
    padding: 18px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 15px;
    transition: 0.4s;
  }
  .panel-row {
    padding: 0 18px;
    background-color: white;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s ease-out;
  }
  ul {
    list-style-type: none;
  }
</style>
@endsection
@section('content')
<section id="content">    
      <section class="scrollable padder">
        <ul class="breadcrumb no-border no-radius b-b b-light pull-in">
        <li><a href="/kinetic"><i class="fa fa-home"></i> Home</a></li>
          <li><a href="{{route('employees.index')}}">Employees</a></li>
          <li><a href="{{route('employees.edit',$employee->employee_id)}}">Edit Employees</a></li>
          <li><a href="{{route('salary',$employee->employee_id)}}">Salary</a></li>          
          <li class="active">Edit Salary</li>
        </ul>   
        @include('Layout.errors')
        @include('Layout.messages')  
            <div class="container-fluid"  style="margin-bottom:0px;">  
                <div class=col-md-3 id=tabLinks style="width:13.5%">
                  <ul class="list-group">
                    <li class="list-group-item " ><a href="{{ route('employees.edit',$employee->employee_id) }}">Employee Info</a></li> 
                    <li class="list-group-item "><a href="{{route('personal',$employee->employee_id)}}">Personal</a></li>               
                    <li class="list-group-item active"><a href="{{route('salary',$employee->employee_id)}}">Salary</a></li>  
                    <li class="list-group-item "><a href="{{route('contact',$employee->employee_id)}}">Contact</a></li>                                                                                                                                         
                  </ul>
                </div> 
                <div class=col-md-6  style="width:86.5%;"> 
                <form method="post" action="{{ route('update_salary',$employee->employee_id) }}" enctype="multipart/form-data" class="form-inline" style="padding-top:10px;">
                {{ csrf_field() }}  
                <div class=row style="padding:0px 5px 5px 10px">                
                    <div class=col-md-4 style="width:20%">
                        <p>Pay Frequency<span>*</span></p>	
                        <select name="pay_frequency" id="payfrequency" class="form-control selectpicker" data-live-search="true" data-size="2"  title="Select Pay Frequency" style="width:15em;" onfocus='this.size=5;' onblur='this.size=1;' onchange='this.size=1; this.blur();'>
                            <option value="monthly" @if($selected_pay_frequency=$employee->pay_frequency) {{'selected'}} @endif>Monthly</option>
                            <option value="weekly"  @if($selected_pay_frequency=$employee->pay_frequency) {{'selected'}} @endif>Weekly</option>
                            <option value="daily"  @if($selected_pay_frequency=$employee->pay_frequency) {{'selected'}} @endif>Daily</option>                    
                        </select>   
                        <div style="float:left; margin-top: 2px;text-align: left;font-family: 'Roboto Regular',sans-serif;color: #208BBD;font-size: 12px;cursor: pointer;"> 
                            <a href=""  data-toggle="modal" data-target="#createPayfrequency"><span>Add Pay Frequency</span></a>
                        </div>        
                    </div>                
                    <div class=col-md-4 style="width:20%">
                        <p>Salary Amount<span>*</span> </p>	
                        <div class="input-group-btn">
                              <button class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown">
                              <span class="dropdown-label">USD</span>  
                              <span class="caret"></span>
                              </button>
                              <ul class="dropdown-menu dropdown-select pull-right">
                                <li class="active">
                                  <a href="#"><input type="radio" value="USD" name="pay_unit" @if($selected_pay_unit=$employee->pay_unit){{'checked'}}@endif>USD</a>
                                  </li>
                                <li>
                                  <a href="#"><input type="radio" value="GBP" name="pay_unit" @if($selected_pay_unit=$employee->pay_unit){{'checked'}}@endif>GBP</a>
                                </li>
                              </ul>
                              <input type="number" name="salary_amount" id="appendedInput" class="input-sm form-control" value="{{$employee->salary_amount}}">
                        </div>
                    </div> 
                    <div class=col-md-4 id="Middlename" style="width:20%;">
                        <p>Bank Branch Name </p>	
                        <input name="bank_branch_name" type="text" value="{{$employee->bank_branch_name}}" class="form-control" id="bankBranch" style="border-radius: 0px 5px 5px 0px;border: 1px solid #eee;margin-bottom: 15px;width: 15em;height: 40px;float: left;padding: 0px 15px;">
                    </div> 
                    <div class=col-md-4 id="Middlename" style="width:20%;">
                        <p>Account No. </p>	
                        <input name="bank_account_no" type="text" value="{{$employee->bank_account_no}}" class="form-control" id="bank_account_no" style="border-radius: 0px 5px 5px 0px;border: 1px solid #eee;margin-bottom: 15px;width: 15em;height: 40px;float: left;padding: 0px 15px;">
                    </div>  

                </div><!-- End of first row -->   

                <div class=row style="padding:0px 5px 5px 10px">           
                    <div class=col-md-4 id="sacco_name" style="width:20%;">
                        <p>Sacco Name </p>	
                        <input name="sacco_name" type="text"  value="{{$employee->sacco_name}}"class="form-control" id="sacco_name" style="border-radius: 0px 5px 5px 0px;border: 1px solid #eee;margin-bottom: 15px;width: 15em;height: 40px;float: left;padding: 0px 15px;">
                    </div> 
                    <div class=col-md-4 id="sacco_account_no" style="width:20%;">
                        <p>Sacco Account No. </p>	
                        <input name="sacco_account_no" type="text" value="{{$employee->sacco_account_no}}" class="form-control" id="sacco_account_no" style="border-radius: 0px 5px 5px 0px;border: 1px solid #eee;margin-bottom: 15px;width: 15em;height: 40px;float: left;padding: 0px 15px;">
                    </div>   

                </div> <!-- End of second row -->

                <div class=row style="padding:0px 5px 15px 10px">
                    <div class=col-md-4 style="width:20%;  padding-top:15px">
                        <button class="btn btn-info" style="padding: 5px 25px 5px 25px">Save</button>
                    </div>
                    <div class=col-md-4 style="width:20%; padding-top:15px">
                    <a href="{{route('contact',$employee->id)}}"><button class=btn style="padding: 5px 25px 5px 25px">Cancel</button></a>
                    </div>

                </div> <!-- End of button row -->

                </form> 
            </div>
          </div>
      </section>
</section>              
@endsection
@section('footer-include')
<script src="/js/select3/bootstrapselect.min.js"></script>
<script src="/js/select3/bootstrap.min.js"></script>
@endsection

@section('j-script')
<!-- Jquery -->
<script>
$("input").click(function(){
        $(this).next().show();
        $(this).next().hide();
    });
    $(document).on('ready', function(){
  });
       
</script>
@endsection



