?)', [$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'); ?>
Claimed today โ ยท streak = (int)$u['daily_streak'] ?> day(s)
| Activity | Type | Coins | When |
|---|---|---|---|
| = e($r['description']) ?> | = e($r['type']) ?> | = ($r['coins'] > 0 ? '+' : '') . coins($r['coins']) ?> | = ago($r['created_at']) ?> | No activity yet. Start earning | '; ?>