Fixed TourBearbeiten, fixed Cancelled Checkbox in tour.show and tour.edit

This commit is contained in:
tschneider 2020-11-30 11:01:05 +01:00
parent bb640eb7a5
commit 9526e2f744
3 changed files with 20 additions and 7 deletions

View file

@ -151,6 +151,7 @@ class TourController extends Controller
*/
public function update(Request $request, Tour $tour)
{
error_log("Tour:update");
$tour=Tour::find($request->input('tour_id'));
@ -185,14 +186,17 @@ class TourController extends Controller
}
$tour->name=$request->input('name');
if ($request->beschreibung) $request->input('beschreibung');
if ($request->beschreibung) $tour->beschreibung=$request->input('beschreibung');
if ($request->start) $tour->start=$request->input('start');
if ($request->deadline) $tour->deadline=$request->input('deadline');
if ($request->max_participants) $tour->max_participants=$request->input('max_participants');
if ($request->is_cancelled) $tour->is_cancelled=$request->input('is_cancelled',false);
$tour->is_cancelled= ($request->has('is_cancelled'));
if ($request->bericht) $tour->bericht=$request->bericht;
$tour->save();
error_log("Is cancelled:". $tour->is_cancelled);
return redirect('/tour');
}

View file

@ -54,10 +54,14 @@
<input type="file" class="mt-3 mr-2 form-control" id="bild" style="font-size:20px;" name="bild" value="" >
</div>
@if($tour->)
<div class="form-group" style="display:flex;">
<label class="ml-2 mt-3" style="width:140px; text-align:left;font-size:18px;" for="name">Storniert:</label>
<input class="mt-3 mr-2 form-control" type="checkbox" id="anmeldeschluss" style="font-size:10px;width:20px;" name="anmeldeschluss" value="{{ old('anmeldeschluss') ?? $tour->deadline }}" >
<label class="ml-2 mt-3" style="width:140px; text-align:left;font-size:18px;" for="is_cancelled">Storniert:</label>
<input class="mt-3 mr-2 form-control" type="checkbox" id="is_cancelled" style="font-size:10px;width:20px;" name="is_cancelled"
@if($tour->is_cancelled)
checked
@endif
>
</div>

View file

@ -55,8 +55,13 @@
@endif
<div class="mt-1" style="display:flex;">
<label class="ml-2" style="width:140px; text-align:left;font-size:18px;" for="name">Storniert:</label>
<input class="mr-1 form-control" type="checkbox" id="anmeldeschluss" style="font-size:10px;width:20px;" name="anmeldeschluss" value="{{ old('anmeldeschluss') ?? $tour->deadline }}" onclick="return false;" >
<label class="ml-2" style="width:140px; text-align:left;font-size:18px;" for="is_cancelled">Storniert:</label>
<input class="mr-1 form-control" type="checkbox" id="is_cancelled" style="font-size:10px;width:20px;" name="is_cancelled"
@if($tour->is_cancelled)
checked
@endif
onclick="return false;"
>
</div>
<div class="mt-1">