@extends('user.layouts.main') @push('style') @endpush @section('contents') @php $timePosted = strtotime($service->created_at); $timeDifference = time() - $timePosted; if ($timeDifference < 60) { $timeElapsed = $timeDifference . ' seconds ago'; } elseif ($timeDifference < 3600) { $minutes = floor($timeDifference / 60); $timeElapsed = $minutes . ' minutes ago'; } elseif ($timeDifference < 86400) { $hours = floor($timeDifference / 3600); $timeElapsed = $hours . ' hours ago'; } else { $days = floor($timeDifference / 86400); $timeElapsed = $days . ' days ago'; } @endphp
View Service Bid
Back
@if ($service->status == '4' || $service->status == '1')
Service Closed
@else
Bid Ongoing
@endif
{{$timeElapsed}}
@if ($service->status != '4' && $service->status != '1')

If you want, you can select the bid as per your choice.

@endif @if ($service->status != '4' && $service->status != '1')
@endif

Service ID: #{{$service->service_id}}

{{$service->service_title}}

Category: {{$service->serviceCategory->name}} Requested Date: {{date('d M Y', strtotime($service->request_date))}} Requested Time: {{$service->request_time}} Approx Rate: {{$service->service_rate}} KSh City: {{$service->city}} Location: {{$service->location}} @if ($service->special_note) Special Note: {{$service->special_note}} @endif Description: {{$service->service_description}}
{{-- @if ($service->status != '4' && $service->status != '1') @endif --}}
@if ($service->status == '4' || $service->status == '1')
Bid list
@else
Select Any Bid
@endif @forelse ($bids as $bid)
@if ($bid->status == 'accepted')
Hired
@endif
{{ $bid->user->name }}
@php $subCategoryIds = is_array($bid->user->subCategory_id) ? $bid->user->subCategory_id : json_decode($bid->user->subCategory_id, true) ?? []; @endphp

@foreach($subCategoryIds as $subCategoryId) @php $subCategory = DB::table('sub_categories')->where('id', $subCategoryId)->first(); @endphp {{ $subCategory->name ?? 'Unknown' }} @if (!$loop->last) , @endif @endforeach

@php $averageRating = $bid->user->reviews->avg('rating'); $percentage = ($averageRating / 5) * 100; $roundedPercentage = round($percentage * 2) / 2; @endphp @for ($i = 1; $i <= 5; $i++) @endfor {{-- --}} {{ number_format($roundedPercentage, 1, '.', '') }}%
Chat @if ($service->status != '4' && $service->status != '1') Hire me @endif
Bid Price: {{$bid->bid_amount}} KSh
@empty
No bids available for this service yet.
@endforelse {{--
Generic placeholder image
Abdul Hakim

Window Clean

96%

Profile
3500 KSh
Generic placeholder image
Sheikh Mujibur Rahman

Window Clean

71%

Profile
3000 KSh
Generic placeholder image
Alauddin

Window Clean

86%

Profile
2000 KSh
Generic placeholder image
Mamun Khan

Window Clean

86%

Profile
2700 KSh
--}}
@endsection @push('scripts') @endpush