<?php
$file = 'c:\xampp\htdocs\inveetaire\app\views\public\identity\sections\gift.php';
$content = file_get_contents($file);

$search = "                \$bankName = \$giftConfig['bank_name'] ?? '';";
$replace = <<<'PHP'
                $bankName = $giftConfig['bank_name'] ?? '';
                $accNum = $giftConfig['account_number'] ?? '';
                $accName = $giftConfig['account_name'] ?? '';
                $qrisPath = $giftConfig['qris_image'] ?? null;
                $qrisUrl = $qrisPath ? url('/i/media/serve') . '?path=' . urlencode($qrisPath) : '';
            ?>
                <section class="py-16 md:py-20 lg:py-24 px-6 md:px-12 space-y-8 border-b <?= $style['borderColor'] ?>">
                    <?php
                    $headerEmoji = '🎁';
                    $headerTitle = 'Wedding Gift & Angpau';
                    require __DIR__ . '/../partials/section_header.php';
                    ?>
                    <div class="text-center mt-2">
                        <p class="text-xs text-slate-400 leading-relaxed max-w-xs mx-auto">
                            For friends and family who wish to send wedding tokens or digital gifts, details are provided below:
                        </p>
                    </div>

                    <div class="grid grid-cols-1 md:grid-cols-2 gap-6 max-w-2xl mx-auto items-stretch text-left">
                        
                        <!-- Bank Transfer Card -->
                        <?php if (!empty($bankName) || !empty($accNum)): ?>
PHP;

$content = str_replace($search, $replace, $content);
file_put_contents($file, $content);
echo "Fixed gift.php\n";
