Permission fixes and washing reservation fixes

This commit is contained in:
frederikpyt
2020-07-29 11:53:37 +02:00
parent fc0f97b04e
commit 569ace008a
11 changed files with 73 additions and 127 deletions
@@ -15,13 +15,20 @@
@csrf
<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>
<label for="machine_id">Vaskemaskine:</label>
<select name="machine_id" id="machine_id" required>
<option disabled selected value> -- Vælg Vaskemaskine -- </option>
@foreach($machines as $machine)
<option value="{{ $machine->id }}">{{ $machine->name }}</option>
@endforeach
</select>
<label for="user_id">Bruger:</label>
<select name="user_id" id="user_id" required>
<option disabled selected value> -- Vælg Bruger -- </option>
@foreach($users as $user)
<option value="{{ $user->id }}">{{ ucfirst($user->name_first) }} {{ ucfirst($user->name_last) }}</option>
@endforeach
</select>
<input type="submit" class="btn btn-dark text-white" value="Opret">
</form>
@endsection
@@ -28,7 +28,7 @@
</tr>
@foreach($reservations as $reservation)
<tr>
<td>{{ \App\WashingMachine::query()->find($reservation->machine)->name }}</td>
<td>{{ \App\WashingMachine::query()->find($reservation->machine_id)->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">