@extends('layouts.app') @section('content')
@php use Carbon\Carbon; $currentTime = Carbon::now(); $hour = $currentTime->hour; if ($hour >= 5 && $hour < 12) { $greeting = 'Good morning'; } elseif ($hour >= 12 && $hour < 17) { $greeting = 'Good afternoon'; } else { $greeting = 'Good evening'; } $user = Auth::user(); $payment_amount = $user->ticket_type; if ($payment_amount == '8000') { $amount = 8000; $currency = 'KSH'; $description = 'Regular Delegate (Full Access 3-Day Pass) – KES 8,000 /='; } elseif ($payment_amount == '10000') { $amount = 10000; $currency = 'KSH'; $description = 'Regular Delegate (Full Access 3-Day Pass) – KES 10,000 /='; } elseif ($payment_amount == '12000') { $amount = 12000; $currency = 'KSH'; $description = 'Regular Delegate (Full Access 3-Day Pass) – KES 12,000 /='; } elseif ($payment_amount == '2000') { $amount = 2000; $currency = 'KSH'; $description = 'Students (Full Access 3-Day Pass) – KES 2,000 /='; } elseif ($payment_amount == '3000') { $amount = 3000; $currency = 'KSH'; $description = '1-Day Pass (Single Day Attendees) – KES 3,000 /='; } elseif ($payment_amount == '4000') { $amount = 4000; $currency = 'KSH'; $description = '1-Day Pass (Single Day Attendees) – KES 4,000 /='; } elseif (strpos($payment_amount, 'usd-') === 0) { // Check if payment_amount starts with 'usd-' $amount = (int) str_replace('usd-', '', $payment_amount); $currency = 'USD'; if ($amount == 60) { $description = 'International Delegate (Full Access 3-Day Pass) - USD 60'; } elseif ($amount == 50) { $description = 'Full Access 3-Day Pass - USD 50 per attendee (from USD 150 per group)'; } elseif ($amount == 15) { $description = 'Full Access 1-Day Pass - USD 15 per attendee (from USD 45 per group)'; } elseif ($amount == 50) { $description = 'Full Access 3-Day Pass - USD 50 per attendee (from USD 150 per group)'; } elseif ($amount == 80) { $description = 'International Delegate (Full Access 3-Day Pass) - USD 80'; } elseif ($amount == 30) { $description = 'International Delegate (1-Day Pass) - USD 30'; } else { $description = 'Unknown'; } } elseif ($payment_amount == '7000') { $amount = 7000; $currency = 'KSH'; $description = '3-Day Pass – KES 7,000 /= per attendee (from KES 21,000 /= per group)'; } elseif ($payment_amount == '2500') { $amount = 2500; $currency = 'KSH'; $description = '1-Day Pass – KES 2,500 /= per attendee (from KES 7,500 /= per group)'; } else { // Default description and amount if none of the conditions match $amount = 0; // You can set a default amount here $currency = 'KSH'; // Default currency is KSH $description = 'Unknown Payment Amount'; } @endphp
@role('system_user')
@php // $deduction = $currency == 'KSH' ? round($amount / 150) : $amount; if ($currency == 'KSH') { $deduction = round(($amount * ($groupusers->count() + 1)) / 150); } else { $deduction = $amount * ($groupusers->count() + 1); } @endphp

{{ $greeting }}, {{ Auth::user()->name }}

@if ($user->ticket_type == 'kdhc-null')

Please update your ticket application below.

@csrf
@else
Your ticket
{{ $description }}
@if ($user->payment == null) @php $groupmembers = $groupusers->count() + 1; @endphp
You are expected to pay {{ $currency . ' ' . $amount * ($groupusers->count() + 1) }}, Kindly click the below button to complete transaction
@if ($amount == 50 || ($amount == 15 || ($amount == 7000 || $amount == 2500)))
Your group has {{ $groupmembers . ($groupmembers == 1 ? ' member' : ' members') }}
@if (!$groupmembers > 2)
Your group should have at least 3 members. Please add your group members.
@endif
@if ($groupmembers > 2)
Pay the above amount via M-Pesa Paybill
  1. Go to M-Pesa Menu
  2. Lipa na M-Pesa
  3. Choose Paybill option
  4. Enter Paybill 4101463
  5. Enter Account number {{ $account_number }}
  6. Enter amount {{ $currency == 'USD' ? $amount * ($groupusers->count() + 1) * 150 : $amount * ($groupusers->count() + 1) }}
  7. Enter your pin to confirm transaction

Once complete enter transaction code below and submit to complete payment

@csrf

A total of USD {{ $deduction }} will be deducted from your PayPal account

@csrf
@livewire('registrations.bank-transfer', ['user' => $user], key($user->id))
@endif @else
Pay the above amount via M-Pesa Paybill
  1. Go to M-Pesa Menu
  2. Lipa na M-Pesa
  3. Choose Paybill option
  4. Enter Paybill 4101463
  5. Enter Account number {{ $account_number }}
  6. Enter amount {{ $currency == 'USD' ? $amount * ($groupusers->count() + 1) * 150 : $amount }}
  7. Enter your pin to confirm transaction

Once complete enter transaction code below and submit to complete payment

@php // $deduction = $currency == 'KSH' ? round($amount / 150) : $amount; if ($currency == 'KSH') { $deduction = round(($amount * ($groupusers->count() + 1)) / 150); } else { $deduction = $amount * ($groupusers->count() + 1); } @endphp
@csrf

A total of USD {{ $deduction }} will be deducted from your PayPal account

@csrf
@livewire('registrations.bank-transfer', ['user' => $user], key($user->id))
@endif @else {{-- || $user->payment->payment_status == 'pending' --}}
# Payment status Payment date Action
1 {{ optional(optional($user)->payment)->payment_status }} {{ date('jS M Y', strtotime(optional(optional($user)->payment)->created_at)) }} @if (optional(optional($user)->payment)->payment_status == 'COMPLETED') @else
Loading...
@if (!$user->paypal == null && $user->payment->payment_status == 'pending')
@csrf
@endif
@endif
@endif @endif
@if ($amount == 50 || ($amount == 15 || ($amount == 7000 || $amount == 2500)))
My Group
@if ($user->payment == null) @endif
@if (isset($groupusers) && count($groupusers) > 0)
@foreach ($groupusers as $key => $group) @endforeach
# Name Email
{{ $key + 1 }} {{ $group->name }} {{ $group->email }}
@else
No one in your group
@endif
@else @endif
Name

{{ $user->name }}

Email

{{ $user->email }}

Contact

{{ $user->phone_number }}

Country

{{ $user->country->country }}

County

{{ $user->county->county }}

@endrole @role('system_administrator') @endrole @role('system_editor')
@if (isset($resources) && count($resources) > 0)
@foreach ($resources as $key => $resource) @endforeach
# Description File Action
{{ $key + 1 }} {{ $resource->description }}
@else
@endif
@endrole
@endsection