@extends('admin/layouts/default') @section('title') Maintenance Requests Dashboard @parent @stop @section('header_styles') @stop @section('content')

Maintenance and Appointment Reports

{{-- SUCCESS & ERROR --}} @if (session('success'))
{{ session('success') }}
@endif @if (session('error'))
{{ session('error') }}
@endif

Dashboard Tasks

{{ date('F d, Y') }}
{{-- VIEW APPOINTMENTS ONLY --}}
{{-- VIEW APPOINTMENTS TAB --}}
@php use Carbon\Carbon; $appointments = DB::table('appointments')->get(); @endphp @foreach ($appointments as $appointment) @php // FETCH RECEIVER FULL NAME $receiver = DB::table('dmuemployee2s') ->where('email', $appointment->reciever) ->first(); // DATE LOGIC $today = Carbon::today(); $appointmentDate = Carbon::parse($appointment->appointmentdate); if ($appointmentDate->isPast() && !$appointmentDate->isToday()) { $days = $appointmentDate->diffInDays($today); $dateHtml = " $appointment->appointmentdate (Expired $days days ago)"; } elseif ($appointmentDate->isFuture()) { $days = $today->diffInDays($appointmentDate); $dateHtml = " $appointment->appointmentdate (In $days days)"; } else { $dateHtml = " $appointment->appointmentdate (Today)"; } @endphp @endforeach
ID Ticket NO Expert Email Receiver Name Issue Appointment Date
#{{ $appointment->id }} {{ $appointment->taskid }} {{ $appointment->experemail }} @if($receiver) {{ $receiver->firstname }} {{ $receiver->lastname }} @else {{ $appointment->reciever }} @endif {{ $appointment->issue }} {!! $dateHtml !!}
{{-- END TAB --}}
@stop @section('footer_scripts') @stop