prepare("SELECT points, tier FROM user_rewards WHERE user_id = ?"); $stmt->execute([$user_id]); $result = $stmt->fetch(); if ($result) { $points = $result['points']; $tier = $result['tier']; } else { // If user has no entry, create one $insert_stmt = $pdo->prepare("INSERT INTO user_rewards (user_id, points, tier) VALUES (?, ?, ?)"); $insert_stmt->execute([$user_id, 0, 'Bronze']); } $history_stmt = $pdo->prepare("SELECT points_change, reason, created_at FROM reward_history WHERE user_id = ? ORDER BY created_at DESC LIMIT 10"); $history_stmt->execute([$user_id]); $history = $history_stmt->fetchAll(); } catch (PDOException $e) { // Handle database errors error_log($e->getMessage()); // You might want to show a generic error message to the user } include 'header.php'; ?>

Your Rewards

Welcome to the MajuroEats Rewards Program! Here you can see your points, your tier, and the rewards you can claim.

Your Current Points

You have points.

Your Current Tier

You are in the tier.

Reward Tiers

  • Bronze: 0+ points
  • Silver: 1000+ points (1.2x point multiplier)
  • Gold: 5000+ points (1.5x point multiplier)

Available Rewards

  • $5 off your next order (500 points)
  • Free delivery on your next order (1000 points)

Redeem Points

Reward History

Date Reason Points