Files
pollux/resources/views/people/show.blade.php
T

135 lines
4.2 KiB
PHP

@extends('layout.master')
@section('title')
{{ $person->fullName() }}
@endsection
@section('subnav')
<li class="nav-item">
<a href='/people' class="btn btn-outline-secondary">Zurück</a>
<a href='/people/{{ $person->id }}/edit' class="btn btn-outline-primary">Bearbeiten</a>
</li>
@endsection
@section('content')
<h2>@yield('title')</h2>
<h2>Stammdaten</h2>
<table class='table table-bordered table-striped'>
<tr>
<td>ID</td>
<td>{{ $person->id }}</td>
</tr>
<tr>
<td>Anrede</td>
<td>{{ $person->title }}</td>
</tr>
<tr>
<td>Name / Firma</td>
<td>{{ $person->name_or_company }}</td>
</tr>
<tr>
<td>Vorname</td>
<td>{{ $person->surname }}</td>
</tr>
<tr>
<td>Straße</td>
<td>{{ $person->street }}</td>
</tr>
<tr>
<td>Postleitzahl</td>
<td>{{ $person->postal_code }}</td>
</tr>
<tr>
<td>Ort</td>
<td>{{ $person->city }}</td>
</tr>
<tr>
<td>E-Mail</td>
<td>{{ $person->email }}</td>
</tr>
<tr>
<td>Telefon</td>
<td>{{ $person->phone }}</td>
</tr>
<tr>
<td>Mobil</td>
<td>{{ $person->mobile }}</td>
</tr>
<tr>
<td>Geburtstag</td>
<td>{{ formatDate($person->date_of_birth) }}</td>
</tr>
</table>
@if ($person->title != 'Firma')
<h2>Mitgliederdaten</h2>
@if ($person->wasMember())
<table class='table table-bordered table-striped'>
<tr>
<th>Eintrittsdatum</th>
<th>Austrittsdatum</th>
</tr>
@foreach ($person->memberStates as $memberState)
<tr>
<td>{{ formatDate($memberState->joining_date) }}</td>
<td>{{ formatDate($memberState->leaving_date) }}</td>
</tr>
@endforeach
</table>
@if ($person->isMember())
<p>{{ $person->fullName() }} ist aktives Mitglied.</p>
@endif
<p>Gesamtmitgliedszeit: {{ formatAmount($person->activeTime(),
false, true) }} Jahre.</p>
@else
<p>{{ $person->fullName() }} war nie Mitglied.</p>
@endif
@endif
<h2>Konto<h2>
<table class='table table-bordered table-striped'>
<tr>
<th>&nbsp;</th>
<th>Datum</th>
<th>Zweck</th>
<th>Soll</th>
<th>Ist</th>
<th>Differenz</th>
<th>Aktionen</th>
</tr>
@foreach ($person->targets as $target)
<tr class="table-secondary">
<td></td>
<th>{{ formatDate($target->date) }}</th>
<th>{{ $target->reference }}</th>
<th align='right'>{!! formatAmount($target->signedAmount()) !!}</th>
<th align='right'>{!! formatAmount($target->actualsSum()) !!}</th>
<th align='right'>{!! formatAmount($target->difference()) !!}</th>
<td>
<div class='btn-group' role='group' aria-label='Basic example'>
<a href='/targets/{{ $target->id }}/edit' class='btn btn-primary'>
<i class='fas fa-edit'></i>
</a>
<a href='/targets/{{ $target->id }}/delete' class='btn btn-danger'>
<i class="fas fa-trash"></i>
</a>
</div>
</td>
<tr>
@foreach ($target->actuals as $actual)
<tr>
<td></td>
<td>{{ formatDate($actual->date()) }}</td>
<td>{{ $actual->reference }}</td>
<td></td>
<td align='right'>{!! formatAmount($actual->signedAmount()) !!}</td>
<td></td>
</tr>
@endforeach
@endforeach
</table>
@endsection