@extends('frontend.layout.dashboard-master') @section('site_title', __('Work History')) @section('content') @php $orderTitle = match($order_details->is_project_job) { 'project' => $order_details->project?->title ?? __('N/A'), 'job' => $order_details->job?->title ?? __('N/A'), default => __('Custom Order'), }; $statusLabel = match($order_details->status) { 0 => ['label' => __('Queue'), 'class' => 'bg-[#ECEDEF] text-[#3B4759]'], 1 => ['label' => __('Active'), 'class' => 'bg-primary/10 text-primary'], 2 => ['label' => __('Delivered'), 'class' => 'bg-primary/10 text-primary'], 3 => ['label' => __('Completed'), 'class' => 'bg-[#DCFCE7] text-[#15803D]'], 4 => ['label' => __('Cancelled'), 'class' => 'bg-[#FF4D4D]/10 text-[#FF4D4D]'], 5 => ['label' => __('Declined'), 'class' => 'bg-[#FF4D4D]/10 text-[#FF4D4D]'], default => ['label' => __('On Hold'), 'class' => 'bg-[#FA8C00]/10 text-[#FA8C00]'], }; $isHourly = $order_details->is_fixed_hourly === 'hourly'; $isComplete = $order_details->status === 3; $clientUser = $order_details->user; if ($clientUser?->image) { if (cloudStorageExist() && in_array(\Illuminate\Support\Facades\Storage::getDefaultDriver(), ['s3','cloudFlareR2','wasabi'])) { $clientImage = render_frontend_cloud_image_if_module_exists('profile/'.$clientUser->image, load_from: $clientUser->load_from ?? ''); } else { $clientImage = asset('assets/uploads/profile/'.$clientUser->image); } } else { $clientImage = asset('assets/static/img/author/author.jpg'); } $workHoursInt = floor($total_work_time); $workMinutes = round(($total_work_time - $workHoursInt) * 60); $workFormatted = $workHoursInt . 'h ' . $workMinutes . 'm'; $minHour = (int)(get_static_option('minimum_hour_for_realtime_earning') ?? 1); $earnings = $isComplete ? $order_details->payable_amount : \App\Models\OrderMilestone::where('order_id', $order_details->id)->where('status', 2)->sum('price'); $total_job = \App\Models\JobPost::where('user_id', $clientUser?->id)->count(); $total_order = \App\Models\Order::where('user_id', $clientUser?->id)->where('status', 3)->count(); $hiring_rate = $total_job > 0 ? ($total_order * 100) / $total_job : 0; @endphp {{-- Page header --}}
#{{ str_pad($order_details->id, 6, '0', STR_PAD_LEFT) }} · {{ $orderTitle }}
{{ __('Order ID') }}: #{{ str_pad($order_details->id, 6, '0', STR_PAD_LEFT) }}
{{ $order_details->created_at->toFormattedDateString() }}
{{ __('Earned') }}
{{ float_amount_with_currency_symbol($earnings) }}
{{ __('Hourly Rate') }}
{{ float_amount_with_currency_symbol($order_details->hourly_rate) }}
{{ __('Est. Hours') }}
{{ $order_details->job?->estimated_hours }} h
{{ __('Approx. Budget') }}
{{ float_amount_with_currency_symbol($order_details->price) }}
{{ __('Pending') }}
{{ (!$isComplete && $order_details->payment_status) ? float_amount_with_currency_symbol($order_details->payable_amount) : site_currency_symbol() . ' 0' }}
{{ __('Commission') }}
{{ float_amount_with_currency_symbol($order_details->commission_amount) }}
{{ __('Total Budget') }}
{{ float_amount_with_currency_symbol($order_details->price) }}
| {{ __('Start') }} | {{ __('End') }} | {{ __('Duration') }} | {{ __('Note') }} |
|---|---|---|---|
| {{ \Carbon\Carbon::parse($history->start_date)->format('M d, Y H:i') }} | {{ \Carbon\Carbon::parse($history->end_date)->format('M d, Y H:i') }} | {{ $history->hours_worked }} | {{ $history->notes ?: '—' }} |
{{ __('No work sessions yet') }}
{{ __('Sessions will appear here once you start the time tracker.') }}
{{ __('Client') }}
{{ $clientUser?->first_name }} {{ $clientUser?->last_name }}
@if($clientUser?->user_verified_status) @endif{{ implode(', ', array_filter([$clientUser?->user_state?->state, $clientUser?->user_country?->country])) }}
@endif @if(\Illuminate\Support\Facades\Cache::has('user_is_online_' . $clientUser?->id)) {{ __('Online') }} @else {{ __('Offline') }} @endif