@extends('layouts.base-refonte', ["fixedHeader" => true]) @section('title', 'Notifications') @section('css') @endsection @section('content')
{{-- breadcrump --}}

Toutes les notifications

{{$allNotifs['unread']}} notification(s) non lue(s) / {{$allNotifs['total']}}
@if (count($allNotifs['latest']) == 0 || !in_array(getNormalLayout(),["prof","student"]))
@if(session()->has('success') && !session('success')) @include('partials.alert') @else Aucune notification n'a été trouvé @endif
@else
@php $ecs = $allNotifs['data']['ecus']; $i = 1; @endphp @foreach ($ecs as $ec) @php $ec = $ec[0]; $occurs = array_count_values(array_column($allNotifs['latest'],'ecu_id'))[$ec['id_EC']]; @endphp
{{ $occurs }} notification(s) sur les {{ count($allNotifs['latest']) }} affichée(s)
@php $i ++; @endphp @endforeach
@foreach ($allNotifs['latest'] as $n) @php $custumEl = $allNotifs['custom'][$n['type']]; $ecu = $allNotifs['data']['ecus'][$n['ecu_id']][0]; $msg = $allNotifs['custom'][$n['type']]['msg']; $url = $allNotifs['custom'][$n['type']]["url"]; $url = str_replace(":p1",$n['ecu_id'],$url); $nUrl = route('updateNotification', ':p1'); $nDate = explode(" ",$n['created_at']); if ($n['id_media'] != null) { $media = $allNotifs['data']['medias'][$n['id_media']][0]; $msg = $msg." ".''.$media['titre'].''; $url = $url.'#item='.$n['id_media'].'.'.$n['type']; } if ($n['statut'] === "UNREAD") { $url = str_replace(":p1",$n['notification_id'],$nUrl).'?callback='.$url; $nCls = "unread"; } else { $nCls = ""; } @endphp
{{ $ecu['intituleEcu']}}
{{ $n['created_at'] }}
@endforeach
@endif {{-- Pagination stuff --}}
{{--
--}} @if ($totalPage) @endif
{{-- End Pagination stuff --}}
@endsection @section('script') @endsection