@php
$demand_status = '';
foreach ($item->demands as $demand) {
if ($demand->demand_status == 3) {
$demand_status = 3;
} elseif ($demand->demand_status == 2) {
$demand_status = 2;
} elseif ($demand->demand_status == 1) {
$demand_status = 1;
} elseif ($demand->demand_status == 1 && $item->status == 1) {
$demand_status = 4; // talep tamamlanmış
} else {
$demand_status = 0;
}
}
@endphp
@php
if ($demand_status == 3) {
$status = 'Şube onayı bekliyor';
$color = 'bg-yellow-500';
} elseif ($demand_status == 2) {
$status = 'Talep reddedildi';
$color = 'bg-red-500';
} elseif ($demand_status == 1) {
$status = 'Talep kabul edildi';
$color = 'bg-green-500';
} elseif ($demand_status == 4) {
$status = 'Talep tamamlandı';
$color = 'bg-green-500';
} else {
$status = 'Genel merkez onayı bekliyor';
$color = 'bg-yellow-500';
}
@endphp
{{--
{{ $message }}
--}}
{{-- @php
if ($item->status == '0') {
$status = 'Talep bekliyor';
$color = 'bg-yellow-500';
} else {
$status = 'Talep onaylandı';
$color = 'bg-green-500';
}
@endphp --}}
{{--
{{ $status }}
--}}
@if ($demand_status != 3)
{{ $status }}
@endif
@if ($demand_status == 3)
@if ($demand_status != 0)
@endif
@if ($demand_status != 0)
@endif
@endif