@extends('back.layout') @section('title') {{ __('j32') }} - {{ __('n1') }} @endsection @section('css') @endsection @php header('Access-Control-Allow-Origin: *'); $color = ['fee4cb', 'e9e7fd', 'ffd3e2', 'c8f7dc', 'd5deff']; $submits = \App\Models\Submit::where('user_id', '=', auth()->user()->id)->where('status', '=', 'Pending')->get(); $pending_balance = 0; foreach ($submits as $submit) { $pending_balance += \App\Models\Task::find($submit->task_id)->price; } @endphp @section('content')
@if (auth()->user()->id == 1) {{-- Admin --}}

{{ __('j33') }}

{{ $balance5 }}

{{ __('j34') }}

{{ $balance2 }}

{{ __('j35') }}

{{ $balance3 }}

{{ __('j36') }}

{{ $balance1 }}

{{ __('j37') }}

{{ $users }}

{{ __('j38') }}

{{ $tasks1 }}

{{ __('j39') }}

{{ $tasksAv }}

{{ __('j40') }}

{{ $tasksToday }}

{{ __('j41') }}

{{ $tasksPending }}

{{ __('j42') }}

{{ count($comments) }}

@else {{-- Normal User --}} @endif
@if (auth()->user()->id != 1)

* {{ __('j49') }}

@endif {{-- Tasks Box --}}
{{-- Bottom Part --}}
{{-- Tasks --}}
{{-- Change View --}}
{{-- List View --}} {{-- Grid View --}}
{{-- /Change View --}}
@if (count($tasks) > 0)
{{-- Single Task Box --}} @foreach ($tasks as $task) @if (count( \App\Models\Submit::where('user_id', '=', auth()->user()->id)->where('task_id', '=', $task->id)->get()) == 0 && \App\Models\Submit::where('user_id', '=', auth()->user()->id)->where('task_id', '=', $task->id)->get()) {{-- Show Only UnCompleted Tasks --}} @if ((count(App\Models\Submit::where('task_id', '=', $task->id)->where('status', '!=', 'Canceled')->get()) /$task->users) * 100 < 100)
users_per_duration - count(App\Models\Submit::where('task_id', '=', $task->id)->whereBetween('created_at', [\Carbon\Carbon::now()->subHours($task->duration), \Carbon\Carbon::now()])->get())) > 0 ) onclick="getData({{ $task->id }});" data-id="{{ $task->id }}" data-bs-toggle="modal" data-bs-target="#TaskDetails" @endif>
@if (intval(\App\Models\Option::where('name', '=', 'max_per_day')->get()[0]->value1) - count( \App\Models\Submit::where('user_id', '=', auth()->user()->id)->where('created_at', 'LIKE', '%' . date('Y-m-d') . '%')->get()) == 0)
{{ __('j50') }}
@endif
{{ Carbon\Carbon::parse($task->created_at)->diffForHumans() }}

@if ($task->type == 1) {{ __('k1') }} @elseif ($task->type == 2) {{ __('k2') }} @else {{ __('k3') }} @endif

{{ $task->description }}

{{ __('k4') }}

{{ (count(App\Models\Submit::where('task_id', '=', $task->id)->where('status', '!=', 'Canceled')->get()) /$task->users) *100 }}%

@endif @endif @endforeach {{-- /Single Task Box --}}
@else

{{ __('k14') }}


@endif
{{-- /Tasks --}}
{{-- Modals --}} {{-- Task Details --}}
@endsection @section('jss') @if (intval(\App\Models\Option::where('name', '=', 'max_per_day')->get()[0]->value1) - count( \App\Models\Submit::where('user_id', '=', auth()->user()->id)->where('created_at', 'LIKE', '%' . date('Y-m-d') . '%')->get()) == 0) @endif @endsection