@php
$tasks = \App\Task::where('start_time', '<=', time())->where('end_time', '>=', time())->get()
@endphp
@foreach($tasks as $key => $task)
@php
$u = \App\User::whereRaw('JSON_CONTAINS(`tasks_completed`, \''.$task->id.'\', \'$\')')->where('id', Auth::user()->id)->count()
@endphp
@if($u != 0) @unset($tasks[$key]) @endif
@endforeach
@if(sizeof($tasks) == 0)
Загляните сюда позже - они обязательно появятся!
@else
@foreach($tasks as $key => $task)
@php
$arrContextOptions=array(
"ssl"=>array(
"verify_peer"=>false,
"verify_peer_name"=>false,
),
);
$game = json_decode(file_get_contents(url('/').'/game_info/'.$task->game_id, false, stream_context_create($arrContextOptions)))
@endphp
@php
$begin = $task->start_time;
$now = time();
$end = $task->end_time;
$percent = number_format((float) ($now-$begin) / ($end-$begin) * 100, 2, '.', '');
@endphp
@php($any_tries = file_get_contents(url('/').'/task/has/'.Auth::user()->id.'/'.$task->id, false, stream_context_create($arrContextOptions)) == '1')
@if($any_tries) Играть @else Начать задание @endif
@endforeach
@endif
@endif