@extends('Layout.Employeesmaster')

@section('title', 'Employees')

@section('content')
<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;
}
</style>
    <section id="content">    
            <section class="scrollable padder">
                <ul class="breadcrumb no-border no-radius b-b b-light pull-in">
                    <li><a href="."><i class="fa fa-home"></i> Home</a></li>                    
                    <li class="active">Pay Frequency</li>
                </ul>              
               
        @if ( session('success') )
        <div class="alert alert-success alert-dismissible" role="alert">
          <button type="button" class="close" data-dismiss="alert" aria-label="Close">
            <span aria-hidden="true">×</span>
            <span class="sr-only">Close</span>
        </button>
        <strong>{{ session('success') }}</strong>
    </div>
    @endif
 
    @if (session('error'))
    <div class="alert alert-danger alert-dismissible" role="alert">
        <button type="button" class="close" data-dismiss="alert" aria-label="Close">
            <span aria-hidden="true">×</span>
            <span class="sr-only">Close</span>
        </button>
        <strong>{{ session('error') }}</strong>
    </div>
    @endif
 
    @if (count($errors) > 0)
    <div class="alert alert-danger">
      <a href="#" class="close" data-dismiss="alert" aria-label="close">×</a>
      <div>
        @foreach ($errors->all() as $error)
        <p>{{ $error }}</p>
        @endforeach
    </div>
</div>
@endif
<div class=container-fluid>
<div class=row>
    <legend style="padding:25px 5px 5px 10px">Pay Frequency</legend>
    <div class="pull-right" style="margin:5px 20px 5px 10px;">
                <a href="" class="btn btn-info btn-sm" data-toggle="modal" data-target="#createPayfrequency"><i class="fa fa-plus"></i>Add Pay frequency</a>
    </div>
</div>
    <div class=row style="padding:0px 5px 5px 10px">
        <div class="table-responsive" style="padding:0px 5px 5px 10px">
            <table class="table table-striped m-b-sm datagrid">
                @if(count($payFrequency) > 0)
                   <tr>
                    <th>Action</th>
                    <th>Pay Frequency</th>
                    <th>Short Code</th>
                    <th>Description</th>
                   </tr>
                </thead>
                <tbody>
                @foreach($payFrequency as $payfrequency)
                    <tr id="payfrequency-row-{{ $payfrequency->id }}">
                    <td>
                    <form action="{{ route('payfrequency.destroy', $payfrequency->id)}}" method="post" style=position:relative;float:right>
                     @csrf
                     @method('DELETE')
                     <a href="{{ route('payfrequency.edit',$payfrequency->id)}}" ><span class="btn btn-default"><i class="fa fa-edit no-margin"></i></span></a>  
                    <button data-toggle="tooltip" data-placement="top" title="Delete" type="submit" class="btn btn-danger" onclick="return confirm('Are you sure you want to delete this item?');"><i class="fa fa-trash no-margin"></i></button>
                    </form>
                    </td>
                    <td>{{ $payfrequency->pay_frequency }}</td>
                    <td>{{ $payfrequency->short_code}}</td>
                    <td>{{ $payfrequency->description}}</td>
                </tr> 
                @endforeach
                @else            
                <tr>
                   <td colspan="2" class="text-center">Nothing to display</td>
                </tr>  
                @endif                          
                </tbody>
                
            </table>
        </div>                
    </div>
</div>
</section>
</section>

<!-- Modal -->
@include('Modals/payFrequency')


 @endsection
 @section('footer-include')
    <!-- fuelux -->
    <script src="/js/libs/underscore-min.js"></script>
    <script src="/js/fuelux/fuelux.js"></script>
    {{--<script src="js/fuelux/demo.datagrid.js"></script>--}}
    <!-- select2 -->
@endsection

@section('j-script')
    <!-- Jquery -->
    <script>
        $(document).on('ready', function(){

        });
       
    </script>

@endsection