?)', [$today, $streak, $u['id'], $today])->rowCount(); if ($ok) { credit($u['id'], $amount, 'daily', "Daily bonus (day $streak streak)"); flash("+$amount coins! Streak: $streak day(s)."); } } redirect('/dashboard.php'); } $claimed = $u['last_daily'] === date('Y-m-d'); $offers = (int)val("SELECT COUNT(*) FROM transactions WHERE user_id=? AND type IN ('offer','survey','task')", [$u['id']]); $refs = (int)val('SELECT COUNT(*) FROM users WHERE referred_by=?', [$u['id']]); $recent = all('SELECT * FROM transactions WHERE user_id=? ORDER BY id DESC LIMIT 10', [$u['id']]); $lvl = level_of($u['total_earned']); $nextAt = (int)(pow($lvl, 2) * 1000); $pct = min(100, (int)(($u['total_earned'] - pow($lvl - 1, 2) * 1000) / max(1, $nextAt - pow($lvl - 1, 2) * 1000) * 100)); page_header('Dashboard'); ?>

Hi, ๐Ÿ‘‹

Balance
Total earned
Offers completed
Users referred

Level

/ coins to level

Daily bonus

Claimed today โœ” ยท streak day(s)

Recent activity

'; ?>
ActivityTypeCoinsWhen
0 ? '+' : '') . coins($r['coins']) ?>
No activity yet. Start earning

All transactions โ†’