@include('navbar')

Events you've added this month of: {{ $month }} {{ $year }}

@if ($errors->any())
{{ $errors->first('error') }}
@endif
@foreach($event_activity as $activity) @php $now = now(); $startDateTime = \Carbon\Carbon::parse($activity->start_date); $endDateTime = \Carbon\Carbon::parse($activity->end_date); // Check if the current date is between the start and end dates $isOngoing = $now->between($startDateTime, $endDateTime); // Check if the end date has passed $isPast = $endDateTime->lt($now); // Set the background color class based on the conditions if ($isOngoing) { $bgColorClass = 'bg-green-300'; // Green for ongoing events } elseif ($isPast) { $bgColorClass = 'bg-red-100'; // Red for events that have already passed } else { $bgColorClass = ''; // No background color otherwise } @endphp

Client: {{ $activity->event_name }}

Meeting Type: {{ $activity->meeting_type }}

Status: {{ $activity->status }}

Employees:

    @if (!empty($activity->employee_info)) @foreach (explode(',', $activity->employee_info) as $employeeInfo) @php // Remove the number using regular expressions $employeeName = preg_replace('/^\d+\s*-\s*/', '', $employeeInfo); @endphp
  • {{ $employeeName }}
  • @endforeach @else
  • No employees assigned to this event
  • @endif
@if($activity->link !== null)

Link: {{ $activity->link }}

@endif @if($activity->location !== null)

Location: {{ $activity->location }}

@endif @if($activity->travel_time !== null)

Travel Time: {{ $activity->travel_time }}

@endif

Description: {{ $activity->description }}

Start date: {{ $activity->formatted_start_time }}

End date: {{ $activity->formatted_end_time }}

@csrf @method('DELETE')
@endforeach
@include('modal') @include('calendarjs')