403Webshell
Server IP : 202.61.199.114  /  Your IP : 216.73.217.139
Web Server : nginx/1.22.1
System : Linux de.arni-solutions.de 6.1.0-49-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.174-1 (2026-05-26) x86_64
User : web20 ( 1018)
PHP Version : 8.4.23
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/clients/client2/web31/web/slots/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/clients/client2/web31/web/slots/wetten.php
<?php
/**
 * Reel Royale · Wettbereich (Frontend)
 *  - WM 2026 (oder aktives Turnier) – Spiele, Quoten, Spezialwetten, Wettschein
 *  - Virtuelle Coins, kein Echtgeld. Mobiloptimiert im Casino-Design.
 */
require_once __DIR__ . '/includes/bootstrap.php';
$user = require_login();
update_playtime_ping((int)$user['id']);
$user   = current_user();
$config = app_config();
$svc    = betting();

$tournament = $svc->activeTournament();
$tid        = $tournament ? (int)$tournament['id'] : 0;

$upcoming = $tid ? $svc->matchesWithMarkets($tid, 'upcoming') : [];
$live     = $tid ? $svc->matchesWithMarkets($tid, 'live')     : [];
$finished = $tid ? $svc->matchesWithMarkets($tid, 'finished') : [];
$specials = $tid ? $svc->specialMarkets($tid)                 : [];
$myBets   = $tid ? $svc->userBets((int)$user['id'], $tid)     : [];
$myStats  = $svc->userBetStats((int)$user['id']);

$boot = [
    'csrf'     => csrf_token(),
    'currency' => $config['app']['currency'],
    'balance'  => (float)$user['balance'],
    'apiUrl'   => 'api/bet.php',
];

/* ---------- Render-Helfer ---------- */
function team_chip(?array $t): string {
    if (!$t) { return '<span class="bx-team">—</span>'; }
    return '<span class="bx-team"><span class="bx-flag">' . e((string)($t['flag'] ?? '')) . '</span>'
         . '<span class="bx-team-name">' . e($t['name']) . '</span></span>';
}
function status_badge(string $status): string {
    $map = [
        'open'      => ['offen', 'bx-badge-open'],
        'won'       => ['gewonnen', 'bx-badge-won'],
        'lost'      => ['verloren', 'bx-badge-lost'],
        'void'      => ['ungültig', 'bx-badge-void'],
        'cancelled' => ['storniert', 'bx-badge-void'],
    ];
    [$label, $cls] = $map[$status] ?? [$status, 'bx-badge-open'];
    return '<span class="bx-badge ' . $cls . '">' . e($label) . '</span>';
}

/** Eine Markt-Box (Optionen als Quoten-Buttons) rendern. */
function render_market(BettingService $svc, array $m, ?array $match): void {
    $bettable = $svc->isBettable($m, $match);
    $close    = $svc->effectiveClose($m, $match);
    echo '<div class="bx-market">';
    echo '<div class="bx-market-head"><span class="bx-market-title">' . e($m['title']) . '</span>';
    if (!$bettable) {
        $reason = $m['status'] === 'settled' ? 'abgerechnet' : ($m['status'] === 'cancelled' ? 'storniert' : ($m['status'] === 'suspended' ? 'ausgesetzt' : 'geschlossen'));
        echo '<span class="bx-market-flag">' . e($reason) . '</span>';
    } elseif ($close) {
        echo '<span class="bx-market-flag">bis ' . e(date('d.m. H:i', strtotime($close))) . '</span>';
    }
    echo '</div>';
    echo '<div class="bx-odds bx-odds-' . count($m['options']) . '">';
    foreach ($m['options'] as $o) {
        $isWin = (int)$o['is_winner'] === 1;
        $cls = 'bx-odd';
        if (!$bettable) { $cls .= ' is-disabled'; }
        if ($m['status'] === 'settled') { $cls .= $isWin ? ' is-win' : ' is-loss'; }
        $attrs = $bettable
            ? ' data-option="' . (int)$o['id'] . '" data-odds="' . e((string)$o['odds'])
              . '" data-label="' . e($o['label']) . '" data-market="' . e($m['title']) . '"'
            : ' disabled';
        echo '<button type="button" class="' . $cls . '"' . $attrs . '>';
        echo '<span class="bx-odd-label">' . e($o['label']) . '</span>';
        echo '<span class="bx-odd-val">' . e(number_format((float)$o['odds'], 2, ',', '.')) . '</span>';
        echo '</button>';
    }
    echo '</div></div>';
}
?>
<!doctype html>
<html lang="de">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
    <title>Wetten · <?= e($config['app']['name']) ?></title>
    <meta name="theme-color" content="#0a0710">
    <link href="https://fonts.googleapis.com/css2?family=Cinzel:wght@600;800&family=Inter:wght@400;600;800&display=swap" rel="stylesheet">
    <link href="css/core.css" rel="stylesheet">
    <link href="css/themes.css" rel="stylesheet">
    <link href="css/betting.css" rel="stylesheet">
</head>
<body class="rr-body bx-body" data-screen="wetten">

<header class="rr-topbar">
    <a class="rr-brand" href="index.php" style="text-decoration:none">
        <span class="rr-brand-mark">♛</span>
        <span class="rr-brand-text"><?= e($config['app']['name']) ?><small>Wettbereich</small></span>
    </a>
    <div class="rr-topbar-hud">
        <div class="rr-chip rr-chip-balance"><span>Guthaben</span><strong id="hudBalance"><?= money_fmt((float)$user['balance']) ?></strong></div>
        <a class="rr-icon-btn" href="index.php" title="Lobby" aria-label="Lobby">🏛️</a>
        <?php if (is_admin($user)): ?><a class="rr-icon-btn" href="admin_bets.php" title="Wett-Administration" style="color:#ffce53">⚙</a><?php endif; ?>
        <a class="rr-icon-btn" href="logout.php" title="Logout" aria-label="Logout">⎋</a>
    </div>
</header>

<main class="bx-wrap">

    <!-- WM-Header -->
    <section class="bx-hero">
        <div class="bx-hero-emblem"><?= e($tournament['emblem'] ?? '🏆') ?></div>
        <div class="bx-hero-text">
            <h1><?= e($tournament['name'] ?? 'Wettbereich') ?></h1>
            <p><?= e($tournament['description'] ?? 'Aktuell ist kein Turnier aktiv.') ?></p>
        </div>
    </section>

    <!-- Rechtlicher Hinweis -->
    <div class="bx-legal">
        <strong>⚠️ Hinweis:</strong> Es wird ausschließlich mit virtuellen <?= e($config['app']['currency']) ?> gespielt.
        <b>Kein Echtgeld, keine Auszahlung, kein Gewinnanspruch.</b> Nur für Spaß &amp; Unterhaltung · ab 18 Jahren ·
        Glücksspiel kann süchtig machen (Hilfe: <a href="https://www.bzga.de" target="_blank" rel="noopener">bzga.de</a>).
        Der Betreiber kann Wetten jederzeit stornieren.
    </div>

    <?php if (!$tid): ?>
        <div class="bx-empty">Derzeit ist kein Turnier aktiv. Schau später wieder vorbei!</div>
    <?php else: ?>

    <!-- Filter-Tabs -->
    <nav class="bx-tabs" id="bxTabs">
        <button class="bx-tab is-active" data-view="upcoming">Kommende <span><?= count($upcoming) ?></span></button>
        <button class="bx-tab" data-view="live">Laufende <span><?= count($live) ?></span></button>
        <button class="bx-tab" data-view="finished">Abgeschlossen <span><?= count($finished) ?></span></button>
        <button class="bx-tab" data-view="specials">Spezialwetten <span><?= count($specials) ?></span></button>
        <button class="bx-tab" data-view="mybets">Meine Wetten <span id="bxMyCount"><?= count($myBets) ?></span></button>
    </nav>

    <!-- ===== Kommende / Laufende / Abgeschlossen ===== -->
    <?php
    $views = ['upcoming' => $upcoming, 'live' => $live, 'finished' => $finished];
    foreach ($views as $key => $list): ?>
    <section class="bx-view" data-view="<?= $key ?>"<?= $key !== 'upcoming' ? ' hidden' : '' ?>>
        <?php if (!$list): ?>
            <div class="bx-empty">Keine Spiele in dieser Ansicht.</div>
        <?php else: foreach ($list as $mt): ?>
            <article class="bx-match">
                <div class="bx-match-head">
                    <div class="bx-match-teams">
                        <?= team_chip($mt['home']) ?>
                        <?php if ($mt['status'] === 'finished'): ?>
                            <span class="bx-score"><?= (int)$mt['home_score'] ?>:<?= (int)$mt['away_score'] ?></span>
                        <?php else: ?>
                            <span class="bx-vs">vs</span>
                        <?php endif; ?>
                        <?= team_chip($mt['away']) ?>
                    </div>
                    <div class="bx-match-meta">
                        <span>Gruppe <?= e((string)$mt['match_group']) ?></span>
                        <span><?= e(date('d.m.Y · H:i', strtotime($mt['kickoff_at']))) ?> Uhr</span>
                        <?php if ($mt['status'] === 'live'): ?><span class="bx-live">● LIVE</span><?php endif; ?>
                    </div>
                </div>
                <div class="bx-match-markets">
                    <?php foreach ($mt['markets'] as $m) { render_market($svc, $m, $mt); } ?>
                </div>
            </article>
        <?php endforeach; endif; ?>
    </section>
    <?php endforeach; ?>

    <!-- ===== Spezialwetten ===== -->
    <section class="bx-view" data-view="specials" hidden>
        <?php if (!$specials): ?>
            <div class="bx-empty">Aktuell keine Spezialwetten.</div>
        <?php else: foreach ($specials as $m): ?>
            <article class="bx-match bx-special">
                <div class="bx-match-head"><div class="bx-match-teams"><span class="bx-special-ico">⭐</span></div>
                    <div class="bx-match-meta"><span>Spezialwette</span></div></div>
                <div class="bx-match-markets"><?php render_market($svc, $m, null); ?></div>
            </article>
        <?php endforeach; endif; ?>
    </section>

    <!-- ===== Meine Wetten ===== -->
    <section class="bx-view" data-view="mybets" hidden>
        <div class="bx-mystats">
            <div><span><?= (int)($myStats['open'] ?? 0) ?></span>offen</div>
            <div><span><?= (int)($myStats['won'] ?? 0) ?></span>gewonnen</div>
            <div><span><?= (int)($myStats['lost'] ?? 0) ?></span>verloren</div>
            <div><span><?= money_fmt((float)($myStats['payout'] ?? 0)) ?></span>ausgezahlt</div>
        </div>
        <div id="bxMyBets" class="bx-mybets">
            <?php if (!$myBets): ?>
                <div class="bx-empty">Du hast noch keine Wetten platziert.</div>
            <?php else: foreach ($myBets as $bet): ?>
                <div class="bx-betrow">
                    <div class="bx-betrow-main">
                        <div class="bx-betrow-title"><?= e($bet['market_title']) ?></div>
                        <div class="bx-betrow-sel"><?= e($bet['option_label']) ?>
                            <?php if ($bet['home_name']): ?>
                                <span class="bx-betrow-match"><?= e($bet['home_name']) ?> – <?= e($bet['away_name']) ?>
                                <?php if ($bet['match_status'] === 'finished'): ?>(<?= (int)$bet['home_score'] ?>:<?= (int)$bet['away_score'] ?>)<?php endif; ?>
                                </span>
                            <?php endif; ?>
                        </div>
                    </div>
                    <div class="bx-betrow-num">
                        <span>Einsatz <b><?= money_fmt((float)$bet['stake']) ?></b></span>
                        <span>Quote <b><?= number_format((float)$bet['odds'], 2, ',', '.') ?></b></span>
                        <?php if ($bet['status'] === 'won'): ?>
                            <span class="bx-win">+<?= money_fmt((float)$bet['payout']) ?></span>
                        <?php else: ?>
                            <span>mögl. <b><?= money_fmt((float)$bet['potential_win']) ?></b></span>
                        <?php endif; ?>
                    </div>
                    <?= status_badge($bet['status']) ?>
                </div>
            <?php endforeach; endif; ?>
        </div>
    </section>

    <?php endif; ?>
</main>

<!-- Wettschein -->
<aside class="bx-slip" id="bxSlip" hidden>
    <div class="bx-slip-head">
        <span>🎟️ Wettschein <em id="bxSlipCount">0</em></span>
        <button class="bx-slip-min" id="bxSlipToggle" aria-label="Ein-/ausklappen">▾</button>
    </div>
    <div class="bx-slip-body" id="bxSlipBody"><!-- Auswahl via JS --></div>
    <div class="bx-slip-foot">
        <div class="bx-slip-total"><span>Möglicher Gesamtgewinn</span><strong id="bxSlipTotal">0</strong></div>
        <button class="bx-slip-place" id="bxSlipPlace">Wetten platzieren</button>
    </div>
</aside>

<button class="bx-slip-fab" id="bxSlipFab" hidden>🎟️ <em id="bxSlipFabCount">0</em></button>

<div class="bx-toasts" id="bxToasts"></div>

<script>window.BX_BOOT = <?= json_encode($boot, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) ?>;</script>
<script src="js/betting.js"></script>
</body>
</html>

Youez - 2016 - github.com/yon3zu
LinuXploit