@php $getCourseLevel= ''; $getProduct = ''; $getPeriod = ''; $getBranch = ''; if (!empty($data['course_level_id'])){ $getCourseLevel = \App\Models\CourseLevel::find($data['course_level_id']); $getProduct = \App\Models\CourseLevel::find($data['course_level_id'])->product; } if (!empty($data['branch_id'])){ $getBranch = \App\Models\Branch::find($data['branch_id']); } if (!empty($data['period_id'])){ $getPeriod = \App\Models\Period::find($data['period_id']); } @endphp

@if(!empty($data['course_level_id'])) {{$getProduct->name}} - {{$getCourseLevel->name}} @endif @if(!empty($data['branch_id'])) - {{$getBranch->name}} @endif @if(!empty($data['period_id'])) -{{$getPeriod->name}} @endif

# {{__('messages.Name')}} {{__('messages.Code')}} {{__('messages.mobile')}} {{__('messages.Waiting Days')}} {{__('messages.Course')}} {{__('messages.comment')}} select @php $row_index =0; $now = \Carbon\Carbon::now(); @endphp @foreach ($waiting as $key =>$order_detail) @php $last_comment_from_operation = ($order_detail->customer->comments->where('comment_type_id',6)->last())?$order_detail->customer->comments->where('comment_type_id',6)->last()->name : '-'; @endphp #{{++$row_index}} {{__('messages.Name')}} {{ $order_detail->customer->name}} {{__('messages.Code')}}{{$order_detail->customer->code}} {{__('messages.mobile')}}{{$order_detail->customer->mobile}} {{__('messages.Waiting Days')}} {{$order_detail->created_at->diffInDays($now)}} {{__('messages.Course')}}  {{__('messages.comment')}} {{$last_comment_from_operation ?? "-"}}   {{-- @empty {{__('messages.Empty Result')}} --}} @endforeach @foreach ($running as $key =>$customer_course) @php $order_detail = \App\Models\OrderDetail::where("customer_id" , $customer_course->customer_id)->where("course_level_id" , $course_level->id)->where("branch_id" , $branch->id)->where('status' , 'waiting')->first(); // dd([ $branch, $course_level ,$customer_course, $order_detail]); @endphp @if ($order_detail) #{{++$row_index}} {{__('messages.Name')}} {{ $order_detail->customer->name}} {{__('messages.Code')}}{{$order_detail->customer->code}} {{__('messages.mobile')}}{{$order_detail->customer->mobile}} {{__('messages.Waiting Days')}} {{$order_detail->created_at->diffInDays($now)}} {{__('messages.Course')}} {{$customer_course->course->end_date}} {{__('messages.comment')}} {{$last_comment_from_operation ?? "-"}}   @endif {{-- @empty {{__('messages.Empty Result')}} --}} @endforeach