Editing: /home/goacom/public_html/scratch_extract/promotion.php
<?php session_start(); // --- Database Configuration --- $host = 'localhost'; $db = 'tishanw1_melbets'; $user = 'tishanw1_melbets'; $pass = 'tishanw1_melbets'; $charset = 'utf8mb4'; $dsn = "mysql:host=$host;dbname=$db;charset=$charset"; $options = [ PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC, PDO::ATTR_EMULATE_PREPARES => false, ]; try { $pdo = new PDO($dsn, $user, $pass, $options); } catch (\PDOException $e) { die("Database connection failed: " . $e->getMessage()); } // Load translations require_once __DIR__ . '/lang.php'; // Fetch active promotions $promotions = []; try { $stmt = $pdo->query("SELECT * FROM promotions WHERE is_active = 1 ORDER BY sort_order ASC, id DESC"); $promotions = $stmt->fetchAll(); } catch (\PDOException $e) { // Fallback default promotions if the table doesn't exist yet $promotions = [ [ 'id' => 1, 'title' => 'ALL TIME BONUS', 'image_url' => '#', 'category' => 'deposit', 'bonus_code' => 'HehshshHH', 'offer_type' => 'Percentage', 'bonus_value' => '2%', 'valid_from' => '2025-12-18', 'valid_to' => '2028-08-16', 'apply_on' => 'Slot, Fishing, Bingo, Table, Live, Exchange, E-Game, Sports, Virtual, E-Sports', 'content' => '' ], [ 'id' => 2, 'title' => 'Welcome Bonus', 'image_url' => '#', 'category' => 'sign-up', 'bonus_code' => 'Hehhshsh', 'offer_type' => 'Fixed', 'bonus_value' => '2', 'valid_from' => '2026-05-10', 'valid_to' => '2026-11-28', 'apply_on' => 'Slot, Fishing, Bingo, Virtual, E-Sports, E-Game, Table, Live', 'content' => '' ] ]; } ?> <!DOCTYPE html> <html lang="<?php echo htmlspecialchars($GLOBALS['_site_lang'] ?? 'en'); ?>"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="description" content="MELBETE - Official Gaming & Betting Platform. Play slots, live casino, sports betting and more." /> <title>MELBETE - Promotions & Bonuses</title> <!-- Link to user's local CSS (kept as requested) --> <link rel="stylesheet" href="index.css" /> <!-- Tailwind CSS added to ensure the specific classes work in this standalone file --> <script src="https://cdn.tailwindcss.com"></script> <link href="https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800;900&display=swap" rel="stylesheet" /> <style> body { font-family: 'Outfit', sans-serif; } #root { width: 100%; overflow-x: hidden; } </style> </head> <body class="bg-bodyColor"> <div id="root"> <!-- Navigation --> <nav class="w-full bg-[#000] px-3 py-2"> <div class="max-w-[1000px] mx-auto flex items-center justify-between"> <div class="flex items-center space-x-1"> <a href="home.php"><img alt="Logo" class="h-12" src="/assets/logo-BaCaHIRU.png"></a> </div> <div> <h1 class="text-white font-bold text-sm md:text-base tracking-wide uppercase px-3"><?php echo __('sidebar.promotion'); ?></h1> </div> </div> </nav> <!-- Main Content --> <div class="w-full pb-36"> <div class="max-w-[1000px] mx-auto"> <div class="w-full"> <div class="max-w-[1200px] mx-auto"> <div class="grid md:grid-cols-2 gap-4 p-4"> <?php foreach ($promotions as $index => $promo): $isOpen = ($index === 0); // Open first accordion by default $contentClass = $isOpen ? 'max-h-[2000px] opacity-100' : 'max-h-0 opacity-0'; $arrowClass = $isOpen ? 'rotate-180' : ''; ?> <!-- Card Container --> <div class="w-full"> <div class="w-full rounded-2xl overflow-hidden bg-[#ffffff] shadow-md border border-gray-100"> <?php if (!empty($promo['image_url']) && $promo['image_url'] !== '#'): ?> <img class="w-full object-cover aspect-[2/1]" alt="<?php echo htmlspecialchars($promo['title']); ?>" src="<?php echo htmlspecialchars($promo['image_url']); ?>"> <?php else: ?> <div class="w-full aspect-[2/1] bg-slate-100 flex flex-col items-center justify-center text-slate-400"> <svg class="h-12 w-12 text-slate-300 mb-1" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z" /> </svg> <span class="text-xs">No Promo Banner Image</span> </div> <?php endif; ?> <!-- Header (Click Trigger) --> <div class="min-h-[50px] px-4 cursor-pointer flex items-center justify-between transition-colors duration-200 accordion-header bg-gradient-to-r from-[#f06827] to-[#e05520]"> <strong class="text-white text-sm md:text-base font-bold"> <?php echo htmlspecialchars($promo['title']); ?> </strong> <div> <img height="14" width="24" alt="" class="transition-transform duration-300 <?php echo $arrowClass; ?> accordion-arrow" src="/down2.svg" style="filter: brightness(0) invert(1);"> </div> </div> <!-- Content Body --> <div class="overflow-hidden transition-all duration-500 ease-in-out <?php echo $contentClass; ?> accordion-content"> <div class="w-full bg-[#db5e22] p-4 text-white"> <p class="flex items-center justify-between my-3 border-b border-orange-400/30 pb-2"> <span class="text-xs md:text-sm text-orange-100">Category:</span> <strong class="text-xs md:text-sm capitalize font-semibold"><?php echo htmlspecialchars($promo['category']); ?></strong> </p> <p class="flex items-center justify-between my-3 border-b border-orange-400/30 pb-2"> <span class="text-xs md:text-sm text-orange-100">Bonus Code:</span> <strong class="text-xs md:text-sm font-mono font-bold text-yellow-300"><?php echo htmlspecialchars($promo['bonus_code'] ?: 'N/A'); ?></strong> </p> <p class="flex items-center justify-between my-3 border-b border-orange-400/30 pb-2"> <span class="text-xs md:text-sm text-orange-100">Offer Type:</span> <strong class="text-xs md:text-sm font-semibold"><?php echo htmlspecialchars($promo['offer_type']); ?></strong> </p> <p class="flex items-center justify-between my-3 border-b border-orange-400/30 pb-2"> <span class="text-xs md:text-sm text-orange-100">Bonus:</span> <strong class="text-xs md:text-sm text-yellow-300 font-bold text-base"><?php echo htmlspecialchars($promo['bonus_value']); ?></strong> </p> <p class="flex items-center justify-between my-3 border-b border-orange-400/30 pb-2"> <span class="text-xs md:text-sm text-orange-100">Valid From:</span> <strong class="text-xs md:text-sm font-semibold"> <?php $from = $promo['valid_from'] ? date('m/d/Y', strtotime($promo['valid_from'])) : 'Anytime'; $to = $promo['valid_to'] ? date('m/d/Y', strtotime($promo['valid_to'])) : 'Forever'; echo "$from - $to"; ?> </strong> </p> <p class="flex items-start justify-between my-3 border-b border-orange-400/30 pb-2"> <span class="text-xs md:text-sm text-orange-100">Bonus Apply On:</span> <strong class="text-xs md:text-sm text-right max-w-[65%] font-medium"><?php echo htmlspecialchars($promo['apply_on']); ?></strong> </p> <?php if (!empty($promo['content'])): ?> <div class="mt-4 text-xs md:text-sm leading-relaxed border-t border-orange-400/40 pt-3 text-orange-50 font-normal"> <?php echo nl2br(htmlspecialchars($promo['content'])); ?> </div> <?php endif; ?> </div> </div> </div> </div> <?php endforeach; ?> </div> </div> </div> </div> </div> <!-- Footer --> <footer class="bg-[#000000] text-center text-white py-8"> <div class="mb-6"> <a class="bg-[#f06827] py-2 px-4 text-xl rounded-md text-white inline-block" href="https://ag.melbets.live/login" target="_blank" style="background: linear-gradient(rgb(245, 124, 58), rgb(212, 82, 26)); box-shadow: rgba(255, 255, 255, 0.2) 0px 1px 0px inset, rgba(0, 0, 0, 0.3) 0px -3px 0px inset, rgba(0, 0, 0, 0.4) 0px 4px 6px; text-shadow: rgba(0, 0, 0, 0.3) 0px 1px 1px;"> Join Affiliate </a> </div> <h2 class="text-lg font-bold"> <span class="text-white">PAYMENT</span> METHOD </h2> <div class="flex justify-center"> <img class="h-[38.4533px]" src="/assets/payment-img.8e4ddc9b-BZa1RCos.png"> </div> <h2 class="text-lg font-bold mt-6"> <span class="text-white">GAMES</span> PROVIDERS </h2> <div class="flex justify-center"> <img class="w-full" src="/assets/vendor-img.413b6a29-CfuACWLZ.png"> </div> <div class="flex justify-center mt-6"> <img alt="Gaming Curacao" class="h-10" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIMAAAArCAMAAABsDMvXAAACslBMVEUAAACOjJmWmJeIiIiIiomnpp++v7+Lj46JiYmMjYiJiYmOk5j09PWJiYmJiYne3t6JiYmKioqIiIj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YHBPT4tRatqcIPC0vaCe6M+geZ3IlHq7jXGgFMyVN+b3ylr+/YICC4NYCXYbxCEdCLCyJRUaAlajg6MIEGCfYD1oTQonljCnaL/MvoYGOvxXKdO2xzWLm/SktPiS982zVM7hAc7B7YFWIVbAjSgZO4N++PzcrJGHToAeTOQAN3lxkiITxsZnBwcJ/xCnCEGUYV7BaLj3O71IjZRCgzWa7YHXCHvNVSiWf84hG9FApF4OT+ECjmJ/oEt+zD4j4MJM03ogOQuyD+2aRe8cD2CSQLZkrBkWiq4GiBDhZShg2UzPyr3PUKjY3y9lRi6L88n3NyfnHYd5w720ptURdwlALzVe7Kw1xbInI/UomJQBFHNEGUABIJEKSeAMoobySCXp6UZFpbvxaEZGnPTG73m7AcJGefFdRNdGMRCnT27EoSjrpmVDIXKGa0CH03se2jORQB2GA8FztG8TZLQviNrwoXQAOn8PRORHrCShft4kbBu5B35PpCNV8dDRwYuu9WjjA8MadUjW61uZCGmYh2vcKfUezAR/Wh2uqCIOI4Hg70uHKB8QiYDgRRw8geBDgsubqHRERSelGfBrhqkL9aLC......"> </div> <div class="flex justify-center mt-6"> <img class="h-[29px]" src="/assets/license-img-2.9a22b477-qpDmnrgc.png"> </div> <p class="text-sm text-gray-400 mt-4"> Copyright © 2025 <span class="font-bold">MELBETS.LIVE™</span>. All rights reserved. </p> </footer> <!-- Bottom Navigation --> <div class="fixed bottom-0 left-0 w-full bg-cover bg-center flex justify-around items-end pb-2 h-[120px] text-white z-40" style="background-image: url('/assets/footer-bg-BIKEY1xb.png'); background-position: 50% center; background-size: 100% 100%;"> <!-- Home --> <a class="flex flex-col items-center text-xs" href="home.php"> <img class="w-[38px] mb-1" src="/assets/footer-home-BBlLUMJX.png" /> <span style="color: rgb(240, 104, 39)"><?php echo __('footer.home'); ?></span> </a> <!-- Deposit --> <a class="flex flex-col items-center text-xs" href="deposit.php"> <img class="w-[38px] mb-1" src="/assets/img/deposit.png" /> <span style="color: rgb(240, 104, 39)"><?php echo __('sidebar.deposit'); ?></span> </a> <!-- Share --> <a href="share.php"> <div class="relative -top-2"> <img alt="Share" class="w-[71px] cursor-pointer drop-shadow-lg shareIconAni" src="/assets/footer-invite-gdwLcv1n.png" /> <p class="text-center text-xs text-[#f06827] mt-4 font-semibold"> <?php echo __('footer.share'); ?> </p> </div> </a> <!-- Lifting --> <a class="flex flex-col items-center text-xs" href="lifting.php"> <img class="w-[38px] mb-1" src="/assets/img/atm-machine.png" /> <span style="color: rgb(240, 104, 39)"><?php echo __('sidebar.lifting'); ?></span> </a> <!-- Account --> <a class="flex flex-col items-center text-xs" href="account.php"> <img class="w-[38px] mb-1" src="https://melbets.live/assets/footer-member.010392b4-BoQ-15DX.png" /> <span style="color: rgb(240, 104, 39)"><?php echo __('footer.account'); ?></span> </a> </div> <section class="Toastify" aria-live="polite" aria-atomic="false" aria-relevant="additions text" aria-label="Notifications Alt+T"></section> </div> <script> // Logic to handle the Open and Close system document.addEventListener('DOMContentLoaded', () => { // Select all accordion headers const headers = document.querySelectorAll('.accordion-header'); headers.forEach(header => { header.addEventListener('click', () => { const content = header.nextElementSibling; const arrow = header.querySelector('.accordion-arrow'); const isOpen = content.classList.contains('max-h-[2000px]'); if (isOpen) { // Close Action content.classList.remove('max-h-[2000px]', 'opacity-100'); content.classList.add('max-h-0', 'opacity-0'); if (arrow) arrow.classList.remove('rotate-180'); } else { // Open Action content.classList.remove('max-h-0', 'opacity-0'); content.classList.add('max-h-[2000px]', 'opacity-100'); if (arrow) arrow.classList.add('rotate-180'); } }); }); }); </script> </body> </html>
💾 Save