@extends('layouts.portal') @section('title', 'Pay for Edit Access') @section('page_title', 'Pay for Edit Access') @section('page_subtitle', 'Complete payment to enable editing') @section('sidebar') @include('client.partials.sidebar', ['active' => 'profile']) @endsection @php // Get selected sections $selectedSections = []; if ($editRequest->section_type === 'multi' && $editRequest->sections_json) { $selectedSections = is_array($editRequest->sections_json) ? $editRequest->sections_json : (json_decode($editRequest->sections_json, true) ?? []); } elseif ($editRequest->section_type !== 'multi') { $selectedSections = [$editRequest->section_type]; } // Map section to details $sectionDetails = [ 'beneficiaries' => [ 'name' => 'Beneficiaries', 'icon' => 'heart', 'color' => 'orange', 'package_code' => 'UPDATE_BENEFICIARIES', 'price' => 150, ], 'assets' => [ 'name' => 'Assets & Allocations', 'icon' => 'briefcase', 'color' => 'cyan', 'package_code' => 'UPDATE_ASSETS', 'price' => 150, ], 'liabilities' => [ 'name' => 'Liabilities', 'icon' => 'credit-card', 'color' => 'rose', 'package_code' => 'UPDATE_LIABILITIES', 'price' => 150, ], 'executors' => [ 'name' => 'Executors', 'icon' => 'user-tie', 'color' => 'teal', 'package_code' => 'UPDATE_EXECUTORS', 'price' => 150, ], 'allowances' => [ 'name' => 'Allowances', 'icon' => 'receipt', 'color' => 'amber', 'package_code' => 'UPDATE_ALLOWANCES', 'price' => 150, ], 'gifts' => [ 'name' => 'Gifts & Donations', 'icon' => 'gift', 'color' => 'pink', 'package_code' => 'UPDATE_GIFTS', 'price' => 150, ], ]; // Get packages for each selected section $packagesToPay = collect(); foreach ($selectedSections as $section) { if (isset($sectionDetails[$section])) { $details = $sectionDetails[$section]; $pkg = \App\Models\Package::where('is_active', true) ->where('code', $details['package_code']) ->first(); if ($pkg) { $packagesToPay->push($pkg); } } } $totalPrice = $packagesToPay->sum('price'); $primaryColor = isset($sectionDetails[$selectedSections[0]]) ? $sectionDetails[$selectedSections[0]]['color'] : 'blue'; @endphp @section('content')
@if(session('error'))
{{ session('error') }}
@endif @if(session('success'))
{{ session('success') }}
@endif

Complete Payment for Edit Access

You have selected {{ count($selectedSections) }} section(s) to edit. Complete the payment to unlock editing.

{{-- UNPAID --}} @if($editRequest->payment_status === 'unpaid')
@csrf

Selected Sections

@foreach($selectedSections as $section) @php $details = $sectionDetails[$section] ?? []; $color = $details['color'] ?? 'gray'; $icon = $details['icon'] ?? 'box'; $name = $details['name'] ?? ucfirst($section); $price = $details['price'] ?? 0; @endphp

{{ $name }}

Edit access for {{ strtolower($name) }}

RM {{ number_format($price, 2) }}

@endforeach
Total Amount: RM {{ number_format($totalPrice, 2) }}

After payment, you'll have 7 days of editing access for all selected sections.

Your payment is secure and encrypted. No payment information is stored on our servers.

@else

Payment Successful!

Your edit access is now active for the following sections:

@foreach($selectedSections as $section) @php $details = $sectionDetails[$section] ?? []; $name = $details['name'] ?? ucfirst($section); @endphp

{{ $name }}

@endforeach
Go Back to Profile
@endif
@endsection