@extends('layouts.master') @section('page_title', 'My Dashboard') @section('content') @php $termNames = [1 => 'First Term', 2 => 'Second Term', 3 => 'Third Term']; $me = Auth::user(); $logo = Qs::getSetting('logo'); $cardCount = count($cards); $colClass = $cardCount >= 4 ? 'col-xl-3' : ($cardCount == 3 ? 'col-xl-4' : ($cardCount == 2 ? 'col-xl-6' : 'col-xl-12')); @endphp {{--Welcome banner--}}
@if($logo) @endif
Welcome, {{ $me->name }}
{{ Qs::getSystemName() }} · {{ ucfirst(str_replace('_', ' ', $me->user_type)) }}
Session {{ $session }} {{ $termNames[$term] ?? 'Term '.$term }}
{{ date('l, jS F Y') }}
{{--Result printing switch (admin, super admin)--}} @if(Qs::userIsTeamSA()) @php $printingOpen = Qs::resultPrintingOpen(); @endphp
Result printing: {{ $printingOpen ? 'ON' : 'OFF' }}
@if($printingOpen) Students and parents can view and print results (also with a PIN on the Check Result page). @else Students and parents cannot view or print results. They will see "Result printing is currently unavailable". @endif Teachers, admins and the class broadsheet are not affected.
@csrf
@endif {{--Online payment alerts (admin, super admin, accountant)--}} @if(!empty($pay_alerts) && $pay_alerts->count())
New payments ({{ $pay_alerts_total }})
View all
@csrf
@foreach($pay_alerts as $a)
{{ $a->title }}
{{ $a->body }}
{{ $a->created_at->diffForHumans() }}
@endforeach
@endif {{--Recent announcements — only shown when there's something to show--}} @if($recent_announcements->count())
Announcements
@foreach($recent_announcements as $a)
@if($a->pinned)@endif {{ $a->title }}
{{ \Illuminate\Support\Str::limit($a->body, 120) }}
{{ date('jS M', strtotime($a->publish_date)) }}
@endforeach
@endif {{--Statistic cards--}} @if($cardCount)
@foreach($cards as $card)
@if($card['url'])@endif

{{ $card['value'] }}

{{ $card['label'] }}
@if($card['url'])
@endif
@endforeach
@endif {{--Quick actions--}} @php $actions = []; if (Qs::userIsTeamSA()) { $actions = [ ['Add Student', 'students.create', null, 'icon-user-plus'], ['Take Attendance', 'attendance.index', null, 'icon-calendar3'], ['Enter Marks', 'marks.index', null, 'icon-pencil7'], ['Fees & Payments', 'payments.index', null, 'icon-cash3'], ['Manage Users', 'users.index', null, 'icon-users'], ]; if (Qs::libraryEnabled()) { $actions[] = ['Library', 'books.index', null, 'icon-books']; } } elseif (Qs::userIsTeacher()) { $actions = [ ['Take Attendance', 'attendance.index', null, 'icon-calendar3'], ['Enter Marks', 'marks.index', null, 'icon-pencil7'], ['Attendance Report', 'attendance.report', null, 'icon-stats-bars'], ]; } elseif ($me->user_type == 'accountant') { $actions = [['Fees & Payments', 'payments.index', null, 'icon-cash3']]; } elseif ($me->user_type == 'librarian' && Qs::libraryEnabled()) { $actions = [ ['Books Catalog', 'books.index', null, 'icon-books'], ['Borrow Requests', 'book_requests.index', null, 'icon-book-play'], ]; } elseif ($me->user_type == 'student') { $actions = [ ['My Marksheet', 'marks.year_selector', Qs::hash($me->id), 'icon-book'], ['My Attendance', 'attendance.history', Qs::hash($me->id), 'icon-calendar3'], ['My Fees', 'payments.invoice', Qs::hash($me->id), 'icon-cash3'], ]; } elseif ($me->user_type == 'parent') { $actions = [['My Children', 'my_children', null, 'icon-users4']]; } @endphp @if(count($actions))
Quick actions @foreach($actions as $a) {{ $a[0] }} @endforeach
@endif {{--Role panels--}}
{{--Today's attendance (admin / teacher)--}} @if(isset($attendance_today))
Attendance Today
@if($attendance_today['total'] > 0)

{{ $attendance_today['present'] }}

Present

{{ $attendance_today['absent'] }}

Absent

{{ $attendance_today['late'] }}

Late

{{ $attendance_today['excused'] }}

Excused
@else

Attendance has not been taken today.

Take Attendance @endif
@endif {{--Fees overview (admin / accountant)--}} @if(isset($fees))
Fees — {{ $session }}
@if($fees['invoices'] > 0)
Collected {{ Qs::naira($fees['collected']) }} of {{ Qs::naira($fees['expected']) }}
{{ Qs::naira($fees['outstanding']) }} outstanding ({{ $fees['unpaid'] }} unpaid {{ $fees['unpaid'] == 1 ? 'invoice' : 'invoices' }})
@else

No fee invoices have been raised for this session yet.

@endif
@endif {{--Library workload (library staff)--}} @if(isset($library))
Library

{{ $library['books'] }}

Books

{{ $library['issued'] }}

Issued

{{ $library['pending'] }}

Pending
@if($library['pending'] > 0) Review pending requests @endif
@endif
{{--Parent: children overview--}} @if(isset($children))
My Children
@forelse($children as $c) @php $sr = $c['record']; @endphp @empty @endforelse
Name Class Attendance Fees Outstanding
{{ $sr->user->name }} {{ optional($sr->my_class)->name }} {{ optional($sr->section)->name }} {{ $c['attendance']['rate'] !== null ? $c['attendance']['rate'].'%' : 'N/A' }} {{ Qs::naira($c['fees']['outstanding']) }} Attendance Fees Marksheet
No children are linked to your account yet. Please contact the school.
@endif {{--Calendar: shows the term dates set in Settings--}}
School Calendar
{!! Qs::getPanelOptions() !!}
@endsection @section('scripts') @endsection