minor fixes

This commit is contained in:
Torsten Schneider 2021-03-06 11:19:57 +01:00
parent af73b49cfa
commit 60d74cc88d
3 changed files with 7 additions and 13 deletions

View file

@ -25,9 +25,11 @@ class TourController extends Controller
error_log("Tour:index"); error_log("Tour:index");
$tours=Tour::where('start','>',Carbon::now())->orderBy('start')->get(); $tours=Tour::where('start','>',Carbon::now())->orderBy('start')->get();
$participantCount=array(); $participantCount=array();
foreach($tours as $tour) { foreach($tours as $key => $tour) {
$result = DB::select('select count(*) as cnt from bookings where tour_id=?', [$tour->id]); $result = DB::select('select count(*) as cnt from bookings where tour_id=?', [$tour->id]);
$participantCount[$tour->id] = $result[0]->cnt; $participantCount[$tour->id] = $result[0]->cnt;
$tours[$key]->start=Tour::toGermanDate($tour->start);
$tours[$key]->deadline=Tour::toGermanDate($tour->deadline);
} }
return view('tour.index')->with('tours',$tours)->with('participantCount',$participantCount); return view('tour.index')->with('tours',$tours)->with('participantCount',$participantCount);
} }
@ -37,9 +39,11 @@ class TourController extends Controller
error_log("Tour:index_old"); error_log("Tour:index_old");
$tours=Tour::where('start','<',Carbon::now())->orderBy('start')->get(); $tours=Tour::where('start','<',Carbon::now())->orderBy('start')->get();
$participantCount=array(); $participantCount=array();
foreach($tours as $tour) { foreach($tours as $key => $tour) {
$result = DB::select('select count(*) as cnt from bookings where tour_id=?', [$tour->id]); $result = DB::select('select count(*) as cnt from bookings where tour_id=?', [$tour->id]);
$participantCount[$tour->id] = $result[0]->cnt; $participantCount[$tour->id] = $result[0]->cnt;
$tours[$key]->start=Tour::toGermanDate($tour->start);
$tours[$key]->deadline=Tour::toGermanDate($tour->deadline);
} }
return view('tour.index_old')->with('tours',$tours)->with('participantCount',$participantCount); return view('tour.index_old')->with('tours',$tours)->with('participantCount',$participantCount);
} }

View file

@ -18,7 +18,7 @@
</div> </div>
@endif @endif
<div style="width:100%; height:100vh;font-family:Nunito;font-size: 1.2rem;" id="sample"> <div style="width:100%; height:100%;font-family:Nunito;font-size: 1.2rem;" id="sample">
{!! $content !!} {!! $content !!}
</div> </div>
</div> </div>

View file

@ -9,15 +9,6 @@
<span class="offset-1"><a href="/img_storage/pdf/Tourenplan.pdf" class="btn btn-success"><h3>Download</h3></a></span> <span class="offset-1"><a href="/img_storage/pdf/Tourenplan.pdf" class="btn btn-success"><h3>Download</h3></a></span>
</div> </div>
<!--
<div class="row mb-2">
<span class="offset-1 col-4 float-left "><a class="btn btn-success" href="/pdf_storage/tourenplan.pdf_storage" class="text-center text-light"><h3>Alte Touren</h3></a></span>
<span class="offset-3 float-right"><a href="/pdf_storage/tourenplan.pdf_storage" class="text-center text-light"><h3>Download</h3></a></span>
</div>
-->
<div class="container text-primary" style="display:flex"> <div class="container text-primary" style="display:flex">
.<ul class="list-group offset-2 col-8"> .<ul class="list-group offset-2 col-8">
@foreach($tours as $tour) @foreach($tours as $tour)
@ -40,7 +31,6 @@
</ul> </ul>
</div> </div>
@if(Auth::user()->role=="ADMIN" or Auth::user()->rolde=="MEMBER") @if(Auth::user()->role=="ADMIN" or Auth::user()->rolde=="MEMBER")
<div class="container text-primary"> <div class="container text-primary">
<a href="/tour/create" class="btn btn-danger col-3 mt-2 "><h3>Neue Tour anlegen</h3></a> <a href="/tour/create" class="btn btn-danger col-3 mt-2 "><h3>Neue Tour anlegen</h3></a>