<<<<<<< 8c98d41a67e0ec45e1fd64b04b779360352c1dcf
@extends('Layout.Employeesmaster')
=======
@extends('Layout.employees_master')
>>>>>>> Storing employee info

@section('title', 'Employees')
@section('header-include')
<style>
#import_file{
    -webkit-appearance:none; 
    position:absolute;
    top:0;
    left:0;
    opacity:0;
    width: 100%;
    height: 100%;
}
</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 class="active">Employees</li>
        </ul>              
               
       @include('Layout.messages')
       @include('Layout.errors')
  
        <div class=container-fluid>
            <div class=row style="float:right;position:relative">
                <div class=col-md-3 style=width:49.5%>
                    <a href="{{route('export')}}"><button class="btn btn-success">Download Excel xls</button></a>
                </div>
                <div class=col-md-3 style=width:49.5%>
                    <form action="{{ route('import') }}" method="POST" enctype="multipart/form-data" id="importForm">
                        {{ csrf_field() }}            
                        <input type="file" name="file" class="form-control" id="import_file" >        
                        <input type="submit" class="btn btn-success" value="Import File" >
                    </form>
                </div> 
            </div> 
            <div class=row>
            <legend style="padding:25px 5px 5px 10px">Employees</legend>
                <div class="pull-right" style="margin:5px 20px 5px 10px;">
                    <a href="{{ route('employees.create') }}" class="btn btn-info btn-sm"><i class="fa fa-plus"></i>Add Employee</a>
                </div>
            </div>
                <div class=row style="padding:0px 5px 5px 10px">
                <div class="table-responsive" style="padding:0px 5px 5px 10px">
<<<<<<< 8c98d41a67e0ec45e1fd64b04b779360352c1dcf
                    <table class="table table-striped m-b-sm datagrid">
=======
                <table class="table table-striped m-b-sm datagrid">
                @if(count($employees) > 0)
>>>>>>> Storing employee info
                    <thead>
                        <tr>
                            <th>Action</th>
                            <th>First Name</th>
                            <th>Last Name</th>
                            <th>Email</th>
                            <th>Phone No.</th>
                        </tr>
                    </thead>
<<<<<<< 8c98d41a67e0ec45e1fd64b04b779360352c1dcf
                    <tbody>
                        <tr>
                            <td>
                                <a href=""><span class="btn btn-default btn-sm"><i class="fa fa-eye no-margin"></i></span></a>
                                <a href=""><span class="btn btn-default btn-sm"><i class="fa fa-edit no-margin"></i></span></a>                                
                            </td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                        </tr>                               
                        <tr>
                            <td colspan="2" class="text-center">Nothing to display</td>
                        </tr>
                    </tbody>
                    </table>
=======
                    @foreach($employees as $employee)
                    <tbody>
                        <td>
                            <a href="{{ route('employees.edit',$employee->id)}}" ><span class="btn btn-default open-modal"><i class="fa fa-edit no-margin"></i></span></a> 
                        </td>
                        <td>{{ $employee->employee_id }}</td>
                        <td>{{ $employee->first_name}}</td>
                        <td>{{ $employee->last_name}}</td>
                        <td>{{ $employee->email_address}}</td>
                        <td>{{ $employee->personal_phone}}</td>
                        </tr> 
                        @endforeach
                        @else            
                        <tr>
                            <td colspan="2" class="text-center">Nothing to display</td>
                        </tr>  
                        @endif       
                    </tbody>
                </table>
>>>>>>> Storing employee info
            </div>                
            </div>
        </div>
    </section>
</section>
<!-- import button function -->
@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>
var form = document.getElementById('importForm');
var input = document.getElementById('import_file');
var change_running = false;    
input.addEventListener('change', function(){
    if(!change_running){
        setTimeout(function(){
            change_running = true;
            form.submit();
            change_running = false;     
            }, 300);
        }
    });

$(document).on('ready', function(){
    });       
</script>

@endsection