@php $class= "warning"; $progressWidth = 0; $itemCount = 0; $itemCompleted = 0; $itemTemporarilyCompleted = 0; // $itemNotCompletedCompleted = 0; $participants = $reasons = collect(); $notes = ""; $items = $data->items; $reasons = $reasons->merge($data->items->whereNotNull('reason')); $participants = $participants->merge($data->items->whereNotNull('completed_by')); $itemCount = $data->total_items; $itemCompleted = $data->completed_items; $itemTemporarilyCompleted = $data->temporarily_completed_items_total; // $itemNotCompletedCompleted += $checklist->not_completable_items_total; $itemCount = $itemCount == 0 ? 1 : $itemCount; $progressWidth = 100 * ( $itemCompleted / $itemCount ); if($data->status == "completed") { $class = $data->approved ? "stroke-custom-blue-300" : "stroke-custom-green-300"; } elseif($data->status == "due") { $class = "stroke-custom-yellow-500"; } elseif($data->status == "pending") { $class = "stroke-custom-orange-300"; if($progressWidth >= 75) { $class = "stroke-custom-light-green-300"; } if($progressWidth < 25) { $class = "stroke-custom-yellow-300"; } } else { $class = "stroke-custom-red-300"; } $circumference = 22.61 * 2 * pi(); @endphp