@extends('master')

@section('title')
    Link User
@stop

@section('styles')

@stop

@section('content')

@include('partials.dashboard-menu')

	<h1>Link {{ $user->name }} to companies</h1>

 {{ Form::model($user, array('route' => ['users.link-user', $user->id], 'files' => true)) }}
    <div class="row">
         <div class="col-md-6">
            <label><i class="fa fa-user" aria-hidden="true"></i>Full Name <small class="red">{{ $errors->first('name') }}</small></label>
             {{ $user->name }}
         </div>
         <div class="col-md-6">
            <label><i class="fa fa-envelope" aria-hidden="true"></i> Email <small class="red">{{ $errors->first('email') }}</small></label>
            {{ $user->email }}
         </div>
    </div>

    <hr>

    <div class="row">
        <div class="large-4 columns">
            <p></p>
        </div>
        <div class="large-4 columns">
        <p style="font-size: 1.7rem;">Companies</p>
            @foreach($companies as $company)
            <input id="{{$company->id}}" type="checkbox" name="companies[]" value="{{$company->companyName}}"><label style="font-size: 1.1rem;" class="" for="{{$company->id}}">{{$company->companyName}}</label><br>
            @endforeach
        </div>
        <div class="large-4 columns">
            <p></p>
        </div>
    </div>

    <hr>

   <button style="display:block;margin-left: auto;margin-right:auto;" class="myButton" type="submit">Link User to Selected Companies</button>

{{ Form::close() }}
<hr>

@include('partials.footer')
@stop





