Files
pollux/resources/views/layout/forms/bookings/edit.blade.php
T
2018-10-16 20:55:52 +02:00

189 lines
6.3 KiB
PHP

@extends('layout.master')
@section('subnav')
<a href='{{ url()->previous() }}' class='btn btn-outline-secondary'>Zurück</a>
@endsection
@section('content')
<h1>@yield('title')</h1>
<form action="/bookings/{{ $booking->id }}" method='post'>
{{ method_field('patch') }}
{{ csrf_field() }}
<h2>Allgemeine Buchungsinformationen</h2>
<div class="form-group row">
{{
Form::label(
'booking[date]',
'Datum',
['class' => 'col-sm-2 col-form-label']
)
}}
<div class='col-sm-10'>
{{
Form::date(
'booking[date]',
$booking->date,
['class' => 'form-control']
)
}}
</div>
</div>
<div class='form-group row'>
{{
Form::label(
'booking[reference]',
'Buchungstext',
['class' => 'col-sm-2 col-form-label']
)
}}
<div class='col-sm-10'>
{{
Form::text(
'booking[reference]',
$booking->reference,
['class' => 'form-control']
)
}}
</div>
</div>
<div class='form-group row'>
{{
Form::label(
'booking[person_or_company]',
'Person / Firma',
['class' => 'col-sm-2 col-form-label']
)
}}
<div class='col-sm-10'>
{{
Form::text(
'booking[person_or_company]',
$booking->person_or_company,
['class' => 'form-control']
)
}}
</div>
</div>
<div class='form-group row'>
{{
Form::label(
'booking[note]',
'Anmerkung',
['class' => 'col-sm-2 col-form-label']
)
}}
<div class='form-group row'>
{{
Form::textarea(
'booking[note]',
$booking->note,
['class' => 'form-control']
)
}}
</div>
</div>
<h2>Teilbuchungen</h2>
<table>
<tr>
<th>Buchungstext</th>
<th>Betrag</th>
<th>Konto</th>
<th>Personenkonto</th>
<th>Projekt</th>
</tr>
@foreach ($booking->subBookings as $subBooking)
<tr>
<td>
{{
Form::text(
"sub_booking[$subBooking->id][reference]",
$subBooking->reference
)
}}
</td>
<td>
{{
Form::text(
"sub_booking[$subBooking->id][amount]",
$subBooking->amount
)
}}
</td>
<td>
{{
Form::select(
"sub_booking[$subBooking->id][account_type_id]",
$accountTypeArray,
$subBooking->account_type_id,
['placeholder' => 'Hier auswählen ...']
)
}}
</td>
<td>
{{
Form::select(
"sub_booking[$subBooking->id][person_target_id]",
$openTargetsArray,
$subBooking->person_target_id,
['placeholder' => 'Hier auswählen ...']
)
}}
</td>
<td>
{{
Form::select(
"sub_booking[$subBooking->id][project_id]",
$projectsArray,
$subBooking->project_id,
['placeholder' => 'Hier auswählen ...']
)
}}
</td>
</tr>
@endforeach
<tr>
<td>{{ Form::text('sub_booking[0][reference]') }}</td>
<td>{{ Form::text('sub_booking[0][amount]') }}</td>
<td>
{{
Form::select(
'sub_booking[0][account_type_id]',
$accountTypeArray,
'placeholder',
['placeholder' => 'Hier auswählen ...']
)
}}
</td>
<td>
{{
Form::select(
'sub_booking[0][person_target_id]',
$openTargetsArray,
'placeholder',
['placeholder' => 'Hier auswählen ...']
)
}}
</td>
<td>
{{
Form::select(
'sub_booking[0][project_id]',
$projectsArray,
'placeholder',
['placeholder' => 'Hier auswählen ...']
)
}}
</td>
</tr>
</table>
<ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
<button type="submit" id="submit" class='btn btn-primary'>Speichern</button>
</form>
@endsection