50 lines
2.4 KiB
PHP
50 lines
2.4 KiB
PHP
<?php
|
|
require_once 'db/config.php';
|
|
|
|
$username = $_GET['player'] ?? '';
|
|
$db = db();
|
|
|
|
$user = null;
|
|
if (!empty($username)) {
|
|
$stmt = $db->prepare("SELECT username, display_name, level, grade FROM users WHERE username = ?");
|
|
$stmt->execute([$username]);
|
|
$user = $stmt->fetch();
|
|
}
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html lang="fr">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Profil Joueur - Nexus</title>
|
|
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
|
|
<style>
|
|
body { background: #000; margin: 0; padding: 20px; font-family: Arial, sans-serif; color: #fff; background-image: radial-gradient(circle at 50% 50%, #1a2a4a 0%, #000 70%); min-height: 100vh; }
|
|
.profile-container { background: rgba(10, 15, 30, 0.95); border: 1px solid #4c566a; padding: 30px; width: 100%; max-width: 500px; margin: 0 auto; box-shadow: 0 0 20px rgba(0,0,0,0.8); text-align: center; }
|
|
h2 { text-transform: uppercase; color: #88c0d0; margin-bottom: 20px; }
|
|
.stat-card { padding: 15px; background: rgba(0,0,0,0.3); border: 1px solid #2d3545; margin-bottom: 15px; text-align: left; }
|
|
.stat-card strong { color: #8c92a3; display: block; font-size: 12px; text-transform: uppercase; margin-bottom: 5px; }
|
|
.not-found { color: #bf616a; }
|
|
.nav-links { margin-top: 25px; font-size: 13px; }
|
|
.nav-links a { color: #88c0d0; text-decoration: none; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="profile-container">
|
|
<?php if ($user): ?>
|
|
<h2><i class="fa-solid fa-user"></i> Profil de <?php echo htmlspecialchars($user['display_name']); ?></h2>
|
|
<div class="stat-card"><strong>Identifiant</strong> @<?php echo htmlspecialchars($user['username']); ?></div>
|
|
<div class="stat-card"><strong>Niveau</strong> <?php echo htmlspecialchars($user['level'] ?? 'N/A'); ?></div>
|
|
<div class="stat-card"><strong>Grade</strong> <?php echo htmlspecialchars($user['grade'] ?? 'N/A'); ?></div>
|
|
<?php else: ?>
|
|
<h2 class="not-found">Joueur introuvable</h2>
|
|
<p>Le profil demandé n'existe pas ou a été supprimé.</p>
|
|
<?php endif; ?>
|
|
|
|
<div class="nav-links">
|
|
<a href="index.php"><i class="fa-solid fa-arrow-left"></i> Retour au Nexus</a>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|