Ekapp/skolehjem/resources/views/admin/index.blade.php

205 lines
8.5 KiB
PHP

@extends("admin.layout.base")
@extends("admin.layout.header")
@section("title")
Dashboard - Admin Panel
@endsection
@section("path")
<a href="{{ route('root.index') }}" class="text-white">Dashboard</a> /
@endsection
@section("content")
<style>
.card {
min-width: 200px;
width: calc(25% - 16px);
margin: 0 8px 0 8px;
}
.content {
display: flex;
flex-wrap: wrap;
flex-direction: row;
}
.card > .head {
padding: 0 8px;
display: flex;
justify-content: center;
align-items: center;
width: calc(100% - 16px);
min-height: 170px;
}
.mr-2 {
margin-right: 1rem;
}
h3 {
margin-top: 0;
}
.event_card > .header {
padding-top: 1rem;
}
.ql-align-center {
text-align: center;
}
.ql-align-center > strong {
color: lightseagreen;
margin: auto;
}
.letterSpaceTable{
letter-spacing: 1.2px;
}
.letterSpaceNotTable{
letter-spacing: 2px;
}
.dot {
height: 10px;
width: 10px;
background-color: #bbb;
border-radius: 50%;
display: inline-block;
}
</style>
<div class="card fixOverflow">
<div class="head letterSpaceNotTable" style="background-color: #575756;">
<div>
<img style="width: 4rem;" src="{{ asset("/images/icons/users-hvid.svg") }}" alt="">
<h1 class="text-white">Brugere</h1>
</div>
<h1 class="text-white ml-auto mr-2" style="font-size: 3.5rem;">{{ count(\App\User::all()) }}</h1>
</div>
<table class="tbl mt-1 ">
<tr>
<th class="text-white text-center letterSpaceTable" style="background-color: #575756;">Nyeste brugere</th>
</tr>
@for($i = 0; $i < 10 && $i < count(\App\User::query()->orderByDesc("id")->get()); $i++)
<tr class="letterSpaceTable">
<td>{!! (ucfirst(strtolower(\App\User::query()->orderByDesc("id")->get()[$i]->name_first))) . ' ' . \App\Helpers::closetags(substr(ucfirst(strtolower(\App\User::query()->orderByDesc("id")->get()[$i]->name_last)), 0, 23) ) !!}</td>
</tr>
@endfor
</table>
</div>
<div class="card fixOverflow">
<div class="head letterSpaceNotTable" style="background-color: #6796b0;">
<div>
<img style="margin-top: 8px;width: 3rem;" src="{{ asset("/images/icons/Aktiviteter.svg") }}" alt="">
<h1 class="text-white">Aktiviteter</h1>
</div>
<h1 class="text-white ml-auto mr-2" style="font-size: 3.5rem;">{{ count(\App\Event::all()) }}</h1>
</div>
<table class="tbl mt-1">
<tr>
<th class="text-white text-center letterSpaceTable" style="background-color: #6796b0;">Næste aktivitet</th>
</tr>
@if(\App\Event::query()->orderBy("date", "asc")->first() == null)
<tr>
<td class="text-center letterSpaceTable">Der er ingen aktiviteter</td>
</tr>
@endif
</table>
@if(\App\Event::query()->orderBy("date", "asc")->first() !== null)
<div class="event_card">
<div class="header pt-0">
<table class="tbl mt-0 letterSpaceTable">
<tr>
<td><label>Aktivitets navn <span class="dot"></span> {!! (\App\Event::query()->orderBy("date", "asc")->first()->name) !!}</label></td>
</tr>
<tr>
<td><label>Aktivitets ansvarlig <span class="dot"></span> {!! (\App\Event::query()->orderBy("date", "asc")->first()->accountable) !!}</label></td>
</tr>
<tr>
<td><label>Tidspunkt <span class="dot"></span> {{ \Illuminate\Support\Facades\Date::createFromTimeStamp(strtotime(\App\Event::query()->orderBy("date", "asc")->first()->date))->format('d/m/Y \k\l\. H:i') }}</label></td>
</tr>
</table>
</div>
<div class="container letterSpaceTable mt-1">
<table style="border: 1px solid lightgrey; width: 100%;">
<tr>
<td> {!! \App\Helpers::closetags(substr(ucfirst(strtolower(\App\Event::query()->orderBy("date", "asc")->first()->description)), 0, 300) ) !!}</td>
</tr>
</table>
<input type="hidden" name="event_id" value="{{ \App\Event::query()->orderBy("date", "asc")->first()->id }}">
<div class="row justify-content-space mt-1">
<a class="sde-blue text-center m-none p-none bold" href="{{route("events.signups", ["event" => \App\Event::query()->orderBy("date", "asc")->first()->id ])}}">Se deltagere</a>
</div>
</div>
</div>
@endif
</div>
<div class="card fixOverflow">
<div class="head letterSpaceNotTable" style="background-color: #152f4b;">
<div>
<img style="width: 4rem;" src="{{ asset("/images/icons/Vejledninger.svg") }}" alt="">
<h1 class="text-white">Vejledninger</h1>
</div>
<h1 class="text-white ml-auto mr-2" style="font-size: 3.5rem;">{{ count(\App\Guide::all()) }}</h1>
</div>
<table class="tbl mt-1 ">
<tr>
<th class="text-white text-center letterSpaceTable" style="background-color: #152f4b;">Seneste Vejledninger</th>
</tr>
@if(count(\App\Guide::all()) > 0)
@for($i = 0; $i < 10 && $i < count(\App\Guide::query()->orderByDesc("id")->get()); $i++)
<tr class="letterSpaceTable" style="overflow: hidden">
<td>{!! \App\Helpers::closetags(substr(ucfirst(strtolower(\App\Guide::query()->orderByDesc("id")->get()[$i]->name)), 0, 45) ) !!}</td>
</tr>
@endfor
@else
<tr>
<td class="text-center letterSpaceTable">Der er ingen vejledninger</td>
</tr>
@endif
</table>
</div>
<div class="card fixOverflow">
<div class="head" style="background-color: #01788a; letter-spacing: 2px;">
<div>
<img style="width: 4rem;" src="{{ asset("/images/icons/Menuplan.svg") }}" alt="">
<h1 class="text-white">Menuplan</h1>
</div>
<h1 class="text-white ml-auto mr-2" style="font-size: 3.5rem;">{{ count(\App\MenuPlan::all()) }}</h1>
</div>
<table class="tbl mt-1">
<tr>
<th class="text-white text-center" colspan="2" style="background-color: #01788a; letter-spacing: 2px;">Ugens Menuplan</th>
</tr>
@if(\App\MenuPlan::query()->where("week", "=", date('W'))->first() !== null)
{{-- \App\MenuPlan::query()->where("week", "=", date('W'))->first() --}}
<tr>
<td class="letterSpaceTable"><label>Mandag </label></td>
<td class="letterSpaceTable">{!! (\App\MenuPlan::query()->where("week", "=", date('W'))->first()->monday) !!}</td>
</tr>
<td class="letterSpaceTable"><label>Tirsdag</label></td>
<td class="letterSpaceTable">{!! (\App\MenuPlan::query()->where("week", "=", date('W'))->first()->tuesday) !!}</td>
</tr>
<td class="letterSpaceTable"><label>Onsdag</label></td>
<td class="letterSpaceTable">{!! (\App\MenuPlan::query()->where("week", "=", date('W'))->first()->wednesday) !!}</td>
</tr>
<td class="letterSpaceTable"><label>Torsdag</label></td>
<td class="letterSpaceTable">{!! (\App\MenuPlan::query()->where("week", "=", date('W'))->first()->thursday) !!}</td>
</tr>
<!--The code above is retarded, but it is what it is :) BigSmoke -->
@else
<tr>
<td colspan="2" class="text-center letterSpaceTable">Ingen menuplan</td>
</tr>
@endif
</table>
</div>
@endsection