@extends('Employee.layout') @section('title',"Dashboard") @section('page-name',"Hello ".$employee['name']) @section('page-detail',"Welcome Back!") @section('pagelink', 'dashboard') @section('body')
Welcome back to your dashboard
{{ $employee['category'] }} • {{ $employee['role'] }}{{ $assignment->message }}
@endif {{ $assignment->created_at->format('M d, Y') }}| Name & Product | Your Contribution | Total Points | You Gained |
|---|---|---|---|
@if($target->custom == null)
{{$target->name ?? 'No Query'}}@else{{$target->custom}}@endif |
@php
$claim = $claims->filter(function ($item) use ($target) {
return $item->target_id == $target->id;
});
if ($claim->isEmpty()) {
$percent['value'] = 0;
$percent['status'] = "Completed";
} else {
$firstClaim = $claim->first(); // Get the first matching record
$redeemed = $firstClaim->redeemed_points ?? 0; // Ensure it exists
$quantity = $firstClaim->quantity ?? 1; // Avoid division by zero
$percent = calculatePercentage($redeemed, $quantity);
if ($percent['value'] > 100) {
$percent['value'] = 100;
}
}
@endphp
{{$percent['value']}}% {{$percent['status']}} |
{{ $target->quantity }} pts | {{ $redeemed ?? "0" }} pts |
Updated at: {{$currentDate}}
Redeemed Points
Pending Points
| VIN# | Target/Product | Points | Claimed Date | Status | |
|---|---|---|---|---|---|
| {{ $point->vin_no }} | @if($point->custom == null){{ $point->name }} | @else{{ Str::limit($point->custom, 50) }} | @endif{{ $point->points }} | {{ \Carbon\Carbon::parse($point->created_at)->format('m-d-y') }} | @if($point->status === 'Redeemed') Redeemed @elseif($point->status === 'Rejected') Rejected @else Pending @endif |