@extends('layouts.user', ['header' => true, 'nav' => true, 'demo' => true, 'settings' => $settings]) {{-- Custom CSS --}} @section('css') @endsection {{-- Get plan details --}} @php use App\User; use App\Plan; use App\Category; use Illuminate\Support\Facades\Auth; // Get user plan details $plan = User::where('user_id', Auth::user()->user_id)->first(); $active_plan = json_decode($plan->plan_details); // Default $purchasedPlan = ""; // Check active plan if ($active_plan != null) { // Check plan type is exists if (isset($active_plan->plan_type) == false) { // Get plan details $getPlan = Plan::where('plan_id', Auth::user()->plan_id)->first(); $active_plan->plan_type = env('APP_TYPE'); $active_plan->no_of_vcard_products = $getPlan->no_of_services; $active_plan->no_of_links = $getPlan->no_of_links; $active_plan->no_testimonials = $getPlan->no_testimonials; $active_plan->business_hours = $getPlan->business_hours; $active_plan->contact_form = $getPlan->contact_form; $active_plan->no_of_enquires = $getPlan->no_of_enquires; $active_plan->no_of_stores = $getPlan->no_of_vcards; $active_plan->no_of_categories = $getPlan->no_of_categories; $active_plan->no_of_store_products = $getPlan->no_of_services; $active_plan->pwa = $getPlan->pwa; $active_plan->password_protected = $getPlan->password_protected; $active_plan->advanced_settings = $getPlan->advanced_settings; $active_plan->additional_tools = $getPlan->additional_tools; // Update existing users plan details User::where('user_id', Auth::user()->user_id)->update([ 'plan_details' => json_encode($active_plan) ]); // Add category $category = new Category(); $category->user_id = Auth::user()->user_id; $category->category_id = "others"; $category->thumbnail = "images/categories/others.avif"; $category->category_name = "Others"; $category->save(); $purchasedPlan = env('APP_TYPE'); } else { $plan = User::where('user_id', Auth::user()->user_id)->first(); $active_plan = json_decode($plan->plan_details); $purchasedPlan = $active_plan->plan_type ; } } @endphp @section('content')
{{-- Failed --}} @if(Session::has("failed")) @endif
{{-- Current plan --}}
{{ __('Current Plan') }}
@if ($active_plan->plan_price == 0)
{{ __($active_plan->plan_name) }}

{{ __('FREE PLAN') }}

@else

{{ __($active_plan->plan_name) }}

@endif {{ __('Show details') }}
{{-- VCARD --}} @if ($active_plan->plan_type == "VCARD") {{-- Business cards --}}
{{ __('Business Cards') }}
{{ $business_card == 999 ? __('Unlimited') : $business_card }}
{{ __('Show details') }}
@endif {{-- STORE --}} @if ($active_plan->plan_type == "STORE") {{-- Stores --}}
{{ __('Stores') }}
{{ $storesCount == 999 ? __('Unlimited') : $storesCount }}
{{ __('Show details') }}
@endif {{-- BOTH --}} @if ($active_plan->plan_type == "BOTH") {{-- Business cards --}}
{{ __('Business Cards') }}
{{ $business_card == 999 ? __('Unlimited') : $business_card }}
{{ __('Show details') }}
{{-- Stores --}}
{{ __('Stores') }}
{{ $storesCount == 999 ? __('Unlimited') : $storesCount }}
{{ __('Show details') }}
@endif {{-- Remaining datas --}}
{{ __('Remaining Days') }}
@if ($active_plan->validity == 9999)

{{ __('Lifetime') }}

@else

{{ $remaining_days > 0 ? $remaining_days : __('Plan Expired!') }}

@endif {{ __('Show details') }}
{{ __('Overview') }}
{{ __('vCards') }}
{{ $totalvCards }}
{{ __('Stores') }}
{{ $totalStores }}
{{-- Platforms --}}
{{-- Title --}}
{{ __('Platforms') }}
{{ __('This week\'s audience of cards') }}
{{-- Devices --}}
{{-- Title --}}
{{ __('Devices') }}
{{ __('Top 10 Most Viewed Cards') }}
{{-- Top 10 Cards --}} @foreach ($highestCards as $highestCard) @endforeach
{{ __('Card name') }} {{ __('Visitors') }}
/{{ $highestCard['card'] }} {{ $highestCard['count'] }}
@include('user.includes.footer')
{{-- Custom JS --}} @section('scripts') @endsection @endsection