@extends("admin.layouts.app") @section("title", __("admin.calendar.title")) @section("content") @php $now = now(); $month = request("month", $now->month); $year = request("year", $now->year); $current = \Carbon\Carbon::createFromDate($year, $month, 1); $daysInMonth = $current->daysInMonth; $startDow = $current->dayOfWeek; $prev = $current->copy()->subMonth(); $next = $current->copy()->addMonth(); @endphp
{{ __('admin.calendar.previous') }}

{{ $current->format('F Y') }}

{{ __('admin.calendar.next') }}
@foreach(["Sun","Mon","Tue","Wed","Thu","Fri","Sat"] as $d) @endforeach @php $day = 1; $started = false; @endphp @for($row = 0; $row < 6 && $day <= $daysInMonth; $row++) @for($col = 0; $col < 7; $col++) @if(!$started && $col === $startDow) @php $started = true; @endphp @endif @if($started && $day <= $daysInMonth) @php $cellDate = \Carbon\Carbon::createFromDate($year, $month, $day); $dayEvents = $events->filter(function($e) use ($cellDate) { return $e->start && $e->start->isSameDay($cellDate); }); $isToday = $cellDate->isToday(); $dayNumStyle = 'font-size:12px;margin-bottom:2px;'; $dayNumStyle .= $isToday ? 'font-weight:700;color:#1a4d80;' : 'font-weight:500;color:#333;'; $cellStyle = 'border:1px solid #e5e5e5;vertical-align:top;height:90px;width:14.28%;padding:4px;'; $cellStyle .= $isToday ? 'background:#f0f7ff;' : ''; @endphp @php $day++; @endphp @else @endif @endfor @endfor
{{ $d }}
{{ $day }}
@foreach($dayEvents->take(3) as $ev)
{{ $ev->title }}
@endforeach @if($dayEvents->count() > 3)
+{{ $dayEvents->count() - 3 }} more
@endif
{{ __('admin.calendar.events_this_month') }}
@php $monthEvents = $events->filter(fn($e) => $e->start && $e->start->month == $month && $e->start->year == $year)->sortBy('start'); @endphp @if($monthEvents->isEmpty())
{{ __('admin.calendar.no_events') }}
@else @foreach($monthEvents as $ev) @endforeach
{{ __('admin.calendar.event_title') }} {{ __('common.table.date') }} {{ __('common.table.description') }} {{ __('admin.calendar.by') }} {{ __('common.table.actions') }}
{{ $ev->title }} {{ $ev->start?->format('d M Y H:i') }}@if($ev->end) - {{ $ev->end->format('d M Y H:i') }}@endif {{ \Illuminate\Support\Str::limit($ev->description ?? '', 60) ?: '-' }} {{ $ev->admin ?? '-' }}
@csrf @method("DELETE")
@endif
{{-- Add Event Modal --}} {{-- Edit Event Modal --}} @push("scripts") @endpush @endsection