Fixed washing machine reservation, creation, edit and deletion
This commit is contained in:
@@ -6,21 +6,21 @@
|
||||
@endsection
|
||||
|
||||
@section("path")
|
||||
<a href="{{ route('washing-reservations.create') }}" class="text-white">Opret Vaske Reservationer</a> /
|
||||
<a href="{{ route('washing-reservations.create') }}" class="text-white">Opret Vaskemaskine Reservation</a> /
|
||||
@endsection
|
||||
|
||||
@section("content")
|
||||
<h1>Opret Booking:</h1>
|
||||
<h1>Opret Reservation:</h1>
|
||||
<form method="post" action="{{ route("washing-reservations.store") }}">
|
||||
@csrf
|
||||
<label for="name_first">Fornavn:</label>
|
||||
<input type="text" name="name_first" id="name_first" required>
|
||||
<label for="name_last">Efternavn:</label>
|
||||
<input type="text" name="name_last" id="name_last" required>
|
||||
<label for="tel">Telefon nr:</label>
|
||||
<input type="tel" name="phone" id="tel" required>
|
||||
<select name="machine_choice">
|
||||
<option>Vaskemaskine 1</option>
|
||||
<label for="time">Tidspunkt:</label>
|
||||
<input type="datetime-local" name="time" id="time" required>
|
||||
<label for="machine">Vaskemaskine:</label>
|
||||
<select name="machine" id="machine" required>
|
||||
<option disabled selected value> -- Vælg Vaskemaskine -- </option>
|
||||
@foreach($machines as $machine)
|
||||
<option value="{{ $machine->id }}">{{ $machine->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<input type="submit" class="btn btn-dark text-white" value="Opret">
|
||||
</form>
|
||||
|
||||
@@ -6,22 +6,26 @@
|
||||
@endsection
|
||||
|
||||
@section("path")
|
||||
<a href="{{ route('washing-reservations.edit', ['id' => $reservations->id]) }}" class="text-white">Rediger Vaske Reservationer</a> /
|
||||
<a href="{{ route('washing-reservations.edit', ['washing_reservation' => $washing_reservation]) }}" class="text-white">Rediger Vaske Reservationer</a> /
|
||||
@endsection
|
||||
|
||||
@section("content")
|
||||
<h1>Rediger Booking:</h1>
|
||||
<form method="post" action="">
|
||||
<form method="post" action="{{ route('washing-reservations.update', ['washing_reservation' => $washing_reservation ]) }}">
|
||||
@csrf
|
||||
<label for="name_first">Fornavn:</label>
|
||||
<input type="text" name="name_first" id="name_first" value="{Fornavn}" required>
|
||||
<label for="name_last">Efternavn:</label>
|
||||
<input type="text" name="name_last" id="name_last" value="{Efternavn}" required>
|
||||
<input type="password" id="password2" value="{Password}" required>
|
||||
<label for="tel">Telefon nr:</label>
|
||||
<input type="tel" name="phone" id="tel" value="{Telefon}" required>
|
||||
<select>
|
||||
<option>Vaskemaskine 1</option>
|
||||
@method("put")
|
||||
<label for="time">Tidspunkt:</label>
|
||||
<input type="datetime-local" name="time" id="time" value="{{ $washing_reservation->time }}" required>
|
||||
<label for="machine">Vaskemaskine:</label>
|
||||
<select name="machine" id="machine" required>
|
||||
<option disabled value> -- Vælg Vaskemaskine -- </option>
|
||||
@foreach($machines as $machine)
|
||||
@if($machine->id == $washing_reservation->machine)
|
||||
<option selected value="{{ $machine->id }}">{{ $machine->name }}</option>
|
||||
@else
|
||||
<option value="{{ $machine->id }}">{{ $machine->name }}</option>
|
||||
@endif
|
||||
@endforeach
|
||||
</select>
|
||||
<input type="submit" class="btn btn-dark text-white" value="Rediger">
|
||||
</form>
|
||||
|
||||
@@ -15,21 +15,17 @@
|
||||
</div>
|
||||
<table class="tbl mt-2">
|
||||
<tr>
|
||||
<th>Fornavn</th>
|
||||
<th>Efternavn</th>
|
||||
<th>Tlf nr</th>
|
||||
<th>Vaskemaskine</th>
|
||||
<th>Time</th>
|
||||
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/pencil.svg') }}" alt="Update"></th>
|
||||
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/trashcan.svg') }}" alt="Delete"></th>
|
||||
</tr>
|
||||
@foreach($reservations as $reservation)
|
||||
<tr>
|
||||
<td>{Fornavn}</td>
|
||||
<td>{Efternavn}</td>
|
||||
<td>{Tlf Nr}</td>
|
||||
<td>{Vaskemaskine Nr.}</td>
|
||||
<td><a href=""><img class="w-100" src="{{ asset('/images/icons/pencil-dark.svg') }}" alt="Update"></a></td>
|
||||
<td><form method="post" action="" class="w-100 nostyle">
|
||||
<td>{{ \App\WashingMachine::query()->find($reservation->machine)->name }}</td>
|
||||
<td>{{ $reservation->time }}</td>
|
||||
<td><a href="{{ route('washing-reservations.edit', ['washing_reservation' => $reservation]) }}"><img class="w-100" src="{{ asset('/images/icons/pencil-dark.svg') }}" alt="Update"></a></td>
|
||||
<td><form method="post" action="{{ route('washing-reservations.destroy', ['washing_reservation' => $reservation]) }}" class="w-100 nostyle">
|
||||
@csrf
|
||||
@method("delete")
|
||||
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
@extends("admin.layout.header")
|
||||
|
||||
@section("title")
|
||||
Vaske Reservationer - Rediger
|
||||
Vaskemaskine Reservationer - Rediger
|
||||
@endsection
|
||||
|
||||
@section("path")
|
||||
<a href="{{ route('washing-reservations.edit') }}" class="text-white">Rediger Vaske Reservationer</a> /
|
||||
<a href="{{ route('washing-reservations.edit', ['washing_reservation' => $washing_reservation]) }}" class="text-white">Rediger Vaskemaskine Reservationer</a> /
|
||||
@endsection
|
||||
|
||||
@section("content")
|
||||
Din Vaske Reservationer blev (ikke) redigeret.
|
||||
Din Vaskemaskine Reservationer blev (ikke) redigeret.
|
||||
@endsection
|
||||
|
||||
Reference in New Issue
Block a user