@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) { //International Delegate (Full Access 3-Day Pass) - $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
| Ticket | Payment ID | Payment date |
|---|---|---|
| {{ $description }} |
@if ($currency == 'USD')
|
@if ($currency == 'USD') {{ date('jS M Y ', strtotime($user->paypal->created_at)) }} @else {{ date('jS M Y ', strtotime($user->mpesa->created_at)) }} @endif |