@extends('adminlte::page') @section('title', config('adminlte.title') . ' | My leave: view holidays') @section('content_header')

Holiday Records

@stop @section('content')
@if (session('success')) @endif @if ($errors->any())
    @foreach ($errors->all() as $error)
  • {{ $error }}
  • @endforeach
@endif

@php $approved = collect($holidayDatas)->where('status', 'Approved')->count(); $pending = collect($holidayDatas)->where('status', 'Pending')->count(); $rejected = collect($holidayDatas)->where('status', 'Rejected')->count(); $cancelled = collect($holidayDatas)->where('status', 'Cancelled')->count(); $workFromHome = collect($holidayDatas)->where('type', 'Working from home')->count(); $duvetDay = collect($holidayDatas)->where('type', 'Duvet day')->count(); @endphp
Approved {{ $approved }}
Pending {{ $pending }}
Rejected {{ $rejected }}
Cancelled {{ $cancelled }}
Holiday Records
@foreach ($holidayDatas as $data) {{-- All modals remain the same - keeping your existing modal code --}} @if (!empty($data->id)) @php $modalIDTag = 'modal' . $data->id; @endphp @if ( $data->type == 'TOIL' || $data->type == 'Adjustment' || $data->type == 'pro-rata adjustment' || $data->type == 'Carry over') @else @endif {{-- @if ($AbsForm != null) @endif --}} @endif @endforeach
# Date Day(s) Type Note Action By Requested date Status Actions
{{ $data->id }} @if ( $data->type == 'TOIL' || $data->type == 'Adjustment' || $data->type == 'pro-rata adjustment' || $data->type == 'Carry over') {{ date('d/m/Y', strtotime($data->start_date)) }} @elseif($data->number_days == 0.5 || $data->number_days == 1) {{ date('d/m/Y', strtotime($data->start_date)) }} {{ $data->start_ampm }} @else {{ date('d/m/Y', strtotime($data->start_date)) }} {{ $data->start_ampm }} - {{ date('d/m/Y', strtotime($data->end_date)) }} {{ $data->end_ampm }} @endif {{ number_format($data->number_days, 1) }} {{ $data->type }} {{ $data->note }} {{ $data->approve_by }} {{ date('d/m/Y H:m:s', strtotime($data->holidays_created_at)) }} @if ($data->docname) @endif @if ($data->absence_holidays_data_id == $data->id) @switch($data->absence_yes_no) @case('1') @break @case('0') @break @default @endswitch @endif @switch($data->status) @case('Approved') @if ($data->cancel_req === 1) Requested Cancellation @else Approved @endif @break @case('Pending') @if ($data->cancel_req === 1)
Pending
Cancelling
@else
Pending
@endif @break @case('Rejected') Rejected @break @case('Cancelled') Cancelled @break @case('System') System Adjustment @break @endswitch
@switch($data->status) @case('Approved') @if (time() - strtotime($data->start_date) < 0) @if (empty($data->reject_reason) && $data->cancel_req != 1) @else @endif @else @endif @break @case('Pending') @if ($data->cancel_req != 1) @else @endif @break @case('Rejected') @break @endswitch @if ($data->status == 'Approved' && $data->cancel_req != 1) @else @endif
@stop @section('footer')   @stop