@extends('user.user_dashboard')
@section('home')
@php
$id = Auth::user()->id;
$profileData = App\Models\User::find($id);
// Get the latest active subscription if it exists
$subscription = $profileData
->subscriptions()
->where('status', 'active')
->where('end_date', '>', now())
->latest()
->first();
$today = now();
$purchase = $profileData
->purchases()
->where('status', 'active')
->where('product_id', $product->id) // Assuming purchases have a product_id column
->first();
@endphp
{{ $product->product_name }}
{{ $product->product_subtitle }}
Tags
@php
$tags = explode(',', $product->product_tags);
@endphp
@foreach ($tags as $tag)
{{ ucfirst($tag) }}
@endforeach
Access Level
@foreach ($product->levels as $level)
{{ $level->level_name }}
@if ($level->id != 7)
Subscription
@endif
@if (!$loop->last)
@endif
@endforeach
{{ $subscription->subscription_name }} member
@else
You
are a
{{ $subscription->subscription_name }}
member
@endif
{{-- unsubscribed users --}}
@else
{{-- subscribe to access enhanced study, read and listen --}}
{{-- @if ($product->cloud_code && count($product->audio) > 0) --}}
@if ($product->enhanced_study && $product->read_ebook && $product->listen_audiobook)
{{-- modifcation for ISM --}}
@if (auth()->user()->zone == 'ISM')
Subscribe to Access Enhanced Study ,
Read E-Book and Listen to AudioBook
@else
Subscribe to Access Enhanced Study,
Read E-Book and Listen to AudioBook
@endif
{{-- subscribe to read ebook and listen to audiobook --}}
@elseif (!$product->enhanced_study && $product->read_ebook && $product->listen_audiobook)
{{-- modifcation for ISM --}}
@if (auth()->user()->zone == 'ISM')
Subscribe to Read E-book
and Listen to AudioBook
@else
Subscribe to Read E-book
and Listen to AudioBook
@endif
{{-- subscribe to access enhanced study and ebook --}}
@elseif ($product->enhanced_study && $product->read_ebook && !$product->listen_audiobook)
{{-- modifcation for ISM --}}
@if (auth()->user()->zone == 'ISM')
Subscribe to Access Enhanced Study
and Read E-Book
@else
Subscribe to Access Enhanced Study
and Read E-Book
@endif
{{-- subscribe to access enhanced study and audiobook --}}
@elseif ($product->enhanced_study && !$product->read_ebook && $product->listen_audiobook)
{{-- modifcation for ISM --}}
@if (auth()->user()->zone == 'ISM')
Subscribe to Access Enhanced Study
and Listen to AudioBook
@else
Subscribe to Access Enhanced Study
and Listen to AudioBook
@endif
{{-- subscribe to read ebook --}}
{{-- @elseif ($product->cloud_code && $product->audio->isEmpty()) --}}
@elseif (!$product->enhanced_study && $product->read_ebook && !$product->listen_audiobook)
{{-- modifcation for ISM --}}
@if (auth()->user()->zone == 'ISM')
Subscribe to Read
E-Book
@else
Subscribe to Read
E-Book
@endif
{{-- subscribe to listen to audiobook --}}
{{-- @elseif ($product->cloud_code == null && count($product->audio) > 0) --}}
@elseif (!$product->enhanced_study && !$product->read_ebook && $product->listen_audiobook)
{{-- modifcation for ISM --}}
@if (auth()->user()->zone == 'ISM')
Subscribe to Listen To
AudioBook
@else
Subscribe to Listen To
AudioBook
@endif
{{-- subscribe to Access Enhanced Study --}}
@elseif ($product->enhanced_study && !$product->read_ebook && !$product->listen_audiobook)
{{-- modifcation for ISM --}}
@if (auth()->user()->zone == 'ISM')
Subscribe to Access
Enhanced Study
@else
Subscribe to Access
Enhanced Study
@endif
@else
@endif
@endif
@endif
This E-Book
@else
{{-- modifcation for ISM and HSCH --}}
@if (auth()->user()->zone == 'ISM' || auth()->user()->zone == 'HSCH')
Purchase E-Book
@if (!$product->discount_price_esp && !$product->discount_price_usd)
@else
{{ $product->selling_price_esp }} Espees |
{{ $product->selling_price_usd }} USD
@endif
{{ $product->discount_price_esp ? $product->discount_price_esp : $product->selling_price_esp }}
Espees |
{{ $product->discount_price_usd ? $product->discount_price_usd : $product->selling_price_usd }}
USD
{{-- | NGN {{ $product->discount_price_ngn ? $product->discount_price_ngn : $product->selling_price_ngn }} --}}
@else
Purchase E-Book
@if (!$product->discount_price_esp && !$product->discount_price_usd)
@else
{{ $product->selling_price_esp }} Espees |
{{ $product->selling_price_usd }} USD
@endif
{{ $product->discount_price_esp ? $product->discount_price_esp : $product->selling_price_esp }}
Espees |
{{ $product->discount_price_usd ? $product->discount_price_usd : $product->selling_price_usd }}
USD
{{-- | NGN {{ $product->discount_price_ngn ? $product->discount_price_ngn : $product->selling_price_ngn }} --}}
@endif {{-- modifcation for ISM and HSCH --}}
@endif
@endif
Book Description