@extends('layouts.front') @section('page-css') @endsection @section('content')

{{ $title }}

@if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif
@foreach ($all_data as $all)

{{ $all->title }}

Exam: {{ $all->exam->title ?? '' }}

Category: {{ $all->CardCategories->title }}

@if ($all->userCard)

Exam Questions: 50

@else

Price: {{ get_price($all->price) }}

@endif @php $alreadyPurchased = DB::table('user_cards') ->where('user_id', auth('web')->id()) ->where('card_id', $all->id) ->exists(); @endphp @if ($all->userCard)

Purchase Date: {{ get_date($all->userCard->created_at) }}

@if($all->test_result >= 50)

Expire Date: {{ get_date($all->userCard->created_at->addYear()) }}

@else

Exam Deadline: {{ get_date($all->userCard->created_at->addMonth()) }}

@endif @endif
@if ($alreadyPurchased) Purchased
@php $purchasedDate = $all->userCard->created_at; $currentDate = \Carbon\Carbon::now(); $daysDifference = $currentDate->diffInDays($purchasedDate); @endphp @if ($all->test_result != '')

Result: {{ $all->test_result }}% @if ($all->test_result >= 50) (Pass) @else (Fail) @endif

@endif @if ($daysDifference <= 30 && ($all->test_result < 50)) Attempt Exam @else @endif @else   Pay with Paypal   Pay with Stripe @endif
@if ($all->test_result === null) @else @if ($all->test_result >= 50) @if ($all->test_result >= 80) @else @endif @else @endif @endif
@endforeach
@endsection @section('page-scripts') @endsection