@extends('layouts.default')

@section('title')
	@parent
	Зарплата
@stop

@section('js')
	<script src="{{ asset('js/salary.js') }}"></script>
@stop

@section('modals')
	@include('salary/modals')
@stop

@section('content')
	@if($currentUser->projects()->whereUsepayroll(1)->count())
	<div class="well well-sm">
		@foreach ($currentUser->projects()->whereUsepayroll(1)->get() as $project)
			<a href="/{{ Request::path() }}?projectId={{ $project->id }}" class="btn btn-sm btn-default @if ($workProject->id == $project->id) active @endif">{{ $project->name }}</a>
		@endforeach
	</div>
	@endif

	@if($workProject->users()->wherePayroll(1)->count())
	<div class="well well-sm">
		@foreach ($workProject->users()->wherePayroll(1)->get() as $item)
			<a href="/{{ Request::path() }}?projectId={{ $workProject->id }}&userId={{ $item->id }}" class="btn btn-sm btn-default @if ($user->id == $item->id) active @endif">{{ $item->first_name }} {{ $item->last_name }}</a>
		@endforeach
	</div>
	@endif

	@include('salary/table')
@stop