@extends('superadmin.layout.master') @section('users','active') @section('contant') @php use Carbon\Carbon; $dateEnd = Carbon::now()->subDays(14); $dateEnd28 = Carbon::now()->subDays(28); $dateEnd90 = Carbon::now()->subDays(90); $dateStart = Carbon::now(); @endphp
@if(Session::get('errors')) {!!Session::forget('errors')!!} @endif @if(Session::get('success')) {!!Session::forget('success')!!} @endif
@if(!empty($users)) @foreach($users as $key => $user) @php if (!empty($user->problemResult) && $user->problemResult->where('status','!=','pending')->where('created_at','<=', $dateStart)->where('created_at','>=', $dateEnd)->count() > 0) { $Accuracy = number_format(($user->problemResult->where('status', 'correct')->where('created_at','<=', $dateStart)->where('created_at','>=', $dateEnd)->count() * 100) / $user->problemResult->where('status','!=','pending')->where('created_at','<=', $dateStart)->where('created_at','>=', $dateEnd)->count(),2); } else { $Accuracy = 0; } @endphp @php if (!empty($user->problemResult) && $user->problemResult->where('status','!=','pending')->where('created_at','<=', $dateStart)->where('created_at','>=', $dateEnd28)->count() > 0) { $Accuracy28 = number_format(($user->problemResult->where('status', 'correct')->where('created_at','<=', $dateStart)->where('created_at','>=', $dateEnd28)->count() * 100) / $user->problemResult->where('status','!=','pending')->where('created_at','<=', $dateStart)->where('created_at','>=', $dateEnd28)->count(),2); } else { $Accuracy28 = 0; } @endphp @php if (!empty($user->problemResult) && $user->problemResult->where('status','!=','pending')->where('created_at','<=', $dateStart)->where('created_at','>=', $dateEnd90)->count() > 0) { $Accuracy90 = number_format(($user->problemResult->where('status', 'correct')->where('created_at','<=', $dateStart)->where('created_at','>=', $dateEnd90)->count() * 100) / $user->problemResult->where('status','!=','pending')->where('created_at','<=', $dateStart)->where('created_at','>=', $dateEnd90)->count(),2); } else { $Accuracy90 = 0; } @endphp @php $level = $all_handicap ->where('bottom_range', '<=', $Accuracy) ->where('top_range', '>=', $Accuracy) ->first(); @endphp {{-- --}} @endforeach @endif
User Name Email Role User Status Last 14D Handicap Score Last 14D Accuracy Last 14D Answers 14 Days Above %50 Last 28D Accuracy Last 28D Answers Last 90D Accuracy Last 90D Answers Actions
{{$user->name}} {{$user->email}} @if($user->role_id==3){{'User'}}@else{{"Admin"}}@endif @if($user->in_training==1) Trainee @elseif($user->in_training==0) Senior @elseif($user->in_training==2) junior @elseif($user->in_training==3) Apprentice @endif @if ($level) {{ $level->title }} @else Not Available @endif {{ $Accuracy . '%' }} @if(!empty($user->problemResult)) {{$user->problemResult->where('created_at','<=', $dateStart)->where('created_at','>=', $dateEnd)->count()}} @endif @if(!empty($per_arr)) {{$per_arr[$user->id]}} @endif {{ $Accuracy28 . '%' }} @if(!empty($user->problemResult)) {{$user->problemResult->where('created_at','<=', $dateStart)->where('created_at','>=', $dateEnd28)->count()}} @endif {{ $Accuracy90 . '%' }} @if(!empty($user->problemResult)) {{$user->problemResult->where('created_at','<=', $dateStart)->where('created_at','>=', $dateEnd90)->count()}} @endif Edit Delete
User Name Email Role User Status Last 14D Handicap Score Last 14D Accuracy Last 14D Answers 14 Days Above %50 Last 28D Accuracy Last 28D Answers Last 90D Accuracy Last 90D Answers Actions
@endsection @push('script') {{-- --}} @endpush