Alpha V2.5.12
This commit is contained in:
parent
2c3897166c
commit
b27feb7780
659
guilde.php
659
guilde.php
@ -5,76 +5,64 @@ session_start();
|
||||
$db = db();
|
||||
|
||||
if (!isset($_SESSION['user_id'])) {
|
||||
header('Location: auth.php');
|
||||
header("Location: auth.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
$user_id = $_SESSION['user_id'];
|
||||
$message = '';
|
||||
$error = '';
|
||||
|
||||
// Récupérer les informations de l'utilisateur
|
||||
$stmt = $db->prepare("SELECT u.*, g.name as guild_name, g.owner_id as guild_owner_id
|
||||
// --- HEADER DATA FETCHING (from index.php) ---
|
||||
$user_role = 'user';
|
||||
$stmt = $db->prepare("SELECT u.role, u.display_name, u.username, u.guild_id, l.name as level_raw,
|
||||
u.selected_title_id, u.selected_badge_id,
|
||||
t.name as title_name,
|
||||
b.name as badge_name, b.image_url as badge_image
|
||||
FROM users u
|
||||
LEFT JOIN guilds g ON u.guild_id = g.id
|
||||
LEFT JOIN levels l ON u.level_id = l.id
|
||||
LEFT JOIN titles t ON u.selected_title_id = t.id
|
||||
LEFT JOIN badges b ON u.selected_badge_id = b.id
|
||||
WHERE u.id = ?");
|
||||
$stmt->execute([$user_id]);
|
||||
$user = $stmt->fetch();
|
||||
$u_data = $stmt->fetch();
|
||||
|
||||
$guild_id = $user['guild_id'];
|
||||
$is_owner = ($guild_id && $user['id'] == $user['guild_owner_id']);
|
||||
|
||||
// Gérer la création de guilde
|
||||
$error = '';
|
||||
$success = '';
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['create_guild']) && !$guild_id) {
|
||||
$name = trim($_POST['guild_name']);
|
||||
$tag = trim($_POST['guild_tag']);
|
||||
if ($u_data) {
|
||||
$user_role = $u_data['role'] ?? 'user';
|
||||
$_SESSION['display_name'] = $u_data['display_name'] ?: $u_data['username'];
|
||||
$level_num = (int)filter_var($u_data['level_raw'], FILTER_SANITIZE_NUMBER_INT);
|
||||
$_SESSION['level'] = $level_num;
|
||||
$_SESSION['guild_id'] = $u_data['guild_id'];
|
||||
|
||||
if (empty($name) || empty($tag)) {
|
||||
$error = "Le nom et le tag sont obligatoires.";
|
||||
$_SESSION['selected_title_name'] = $u_data['title_name'];
|
||||
$_SESSION['selected_badge_name'] = $u_data['badge_name'];
|
||||
$_SESSION['selected_badge_image'] = $u_data['badge_image'];
|
||||
|
||||
$grade_type = ($user_role === 'admin') ? 'admin' : 'utilisateur';
|
||||
$g_stmt = $db->prepare("SELECT name, image_url FROM grades
|
||||
WHERE user_type = ?
|
||||
AND (min_level <= ? OR min_level IS NULL)
|
||||
AND (max_level >= ? OR max_level IS NULL)
|
||||
LIMIT 1");
|
||||
$g_stmt->execute([$grade_type, $level_num, $level_num]);
|
||||
$grade_data = $g_stmt->fetch();
|
||||
|
||||
if ($grade_data) {
|
||||
$_SESSION['grade_name'] = $grade_data['name'];
|
||||
$_SESSION['grade_image'] = $grade_data['image_url'];
|
||||
} else {
|
||||
try {
|
||||
$db->beginTransaction();
|
||||
|
||||
$stmt = $db->prepare("INSERT INTO guilds (name, tag, owner_id) VALUES (?, ?, ?)");
|
||||
$stmt->execute([$name, $tag, $user_id]);
|
||||
$new_guild_id = $db->lastInsertId();
|
||||
|
||||
$stmt = $db->prepare("UPDATE users SET guild_id = ? WHERE id = ?");
|
||||
$stmt->execute([$new_guild_id, $user_id]);
|
||||
|
||||
$stmt = $db->prepare("INSERT INTO guild_members (guild_id, user_id, role) VALUES (?, ?, 'owner')");
|
||||
$stmt->execute([$new_guild_id, $user_id]);
|
||||
|
||||
$db->commit();
|
||||
header('Location: guilde.php');
|
||||
exit;
|
||||
} catch (Exception $e) {
|
||||
$db->rollBack();
|
||||
$error = "Erreur lors de la création : " . $e->getMessage();
|
||||
}
|
||||
$_SESSION['grade_name'] = "Recrue";
|
||||
$_SESSION['grade_image'] = "assets/images/placeholder_grade.png";
|
||||
}
|
||||
}
|
||||
|
||||
// Récupérer les membres si en guilde
|
||||
$members = [];
|
||||
if ($guild_id) {
|
||||
$stmt = $db->prepare("SELECT u.id, u.username, u.display_name, m.role, m.joined_at, l.name as level_name
|
||||
FROM guild_members m
|
||||
JOIN users u ON m.user_id = u.id
|
||||
LEFT JOIN levels l ON u.level_id = l.id
|
||||
WHERE m.guild_id = ?
|
||||
ORDER BY CASE WHEN m.role = 'owner' THEN 1 WHEN m.role = 'officer' THEN 2 ELSE 3 END ASC, joined_at ASC");
|
||||
$stmt->execute([$guild_id]);
|
||||
$members = $stmt->fetchAll();
|
||||
}
|
||||
|
||||
// Ressources pour le header (copié de index.php)
|
||||
// Dynamic Resources for Header & Check
|
||||
$resources = [];
|
||||
$user_resource_amounts = []; // For easier access
|
||||
$stmt = $db->prepare("
|
||||
SELECT gr.*, COALESCE(ur.amount, 0) as amount
|
||||
FROM game_resources gr
|
||||
LEFT JOIN user_resources ur ON gr.id = ur.resource_id AND ur.user_id = ?
|
||||
WHERE gr.show_in_header = 1
|
||||
ORDER BY CASE
|
||||
WHEN gr.name LIKE 'Crédit%' THEN 1
|
||||
WHEN gr.name LIKE 'Matériau%' THEN 2
|
||||
@ -84,53 +72,262 @@ $stmt = $db->prepare("
|
||||
END ASC, gr.name ASC
|
||||
");
|
||||
$stmt->execute([$user_id]);
|
||||
$header_resources = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
foreach($header_resources as $hr) {
|
||||
$resources[$hr["name"]] = [
|
||||
"val" => (string)$hr["amount"],
|
||||
"prod" => "",
|
||||
"icon" => $hr["icon"] ?: "fa-gem",
|
||||
"image" => $hr["image_url"]
|
||||
];
|
||||
$all_resources_raw = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
foreach($all_resources_raw as $hr) {
|
||||
$user_resource_amounts[$hr['id']] = (float)$hr['amount'];
|
||||
if ($hr['show_in_header'] == 1) {
|
||||
$resources[$hr["name"]] = [
|
||||
"val" => (string)$hr["amount"],
|
||||
"prod" => "",
|
||||
"icon" => $hr["icon"] ?: "fa-gem",
|
||||
"image" => $hr["image_url"]
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
// --- GUILD SPECIFIC LOGIC ---
|
||||
|
||||
// Check if user is in a guild
|
||||
$stmt = $db->prepare("SELECT u.guild_id, m.role, g.name as guild_name, g.tag as guild_tag, g.description as guild_desc
|
||||
FROM users u
|
||||
LEFT JOIN guild_members m ON u.id = m.user_id
|
||||
LEFT JOIN guilds g ON u.guild_id = g.id
|
||||
WHERE u.id = ?");
|
||||
$stmt->execute([$user_id]);
|
||||
$user_guild_info = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
$in_guild = !empty($user_guild_info['guild_id']);
|
||||
|
||||
// Fetch member limit
|
||||
$stmt = $db->query("SELECT value FROM guild_restrictions WHERE restriction_key = 'member_limit'");
|
||||
$member_limit = (int)($stmt->fetchColumn() ?: 50);
|
||||
|
||||
// --- ACTIONS ---
|
||||
|
||||
// JOIN GUILD
|
||||
if (isset($_GET['join']) && !$in_guild) {
|
||||
$guild_id = (int)$_GET['join'];
|
||||
$stmt = $db->prepare("SELECT COUNT(*) FROM guild_members WHERE guild_id = ?");
|
||||
$stmt->execute([$guild_id]);
|
||||
$current_members = (int)$stmt->fetchColumn();
|
||||
if ($current_members >= $member_limit) { $error = "Cette guilde est pleine."; } else {
|
||||
$db->beginTransaction();
|
||||
try {
|
||||
$db->prepare("UPDATE users SET guild_id = ? WHERE id = ?")->execute([$guild_id, $user_id]);
|
||||
$db->prepare("INSERT INTO guild_members (guild_id, user_id, role) VALUES (?, ?, 'membre')")->execute([$guild_id, $user_id]);
|
||||
$_SESSION['guild_id'] = $guild_id;
|
||||
$db->commit();
|
||||
header("Location: guilde.php");
|
||||
exit;
|
||||
} catch (Exception $e) { $db->rollBack(); $error = "Erreur : " . $e->getMessage(); }
|
||||
}
|
||||
}
|
||||
|
||||
// DISBAND GUILD
|
||||
if (isset($_GET['action']) && $_GET['action'] === 'disband' && $in_guild && $user_guild_info['role'] === 'superviseur') {
|
||||
$guild_id = $user_guild_info['guild_id'];
|
||||
$db->beginTransaction();
|
||||
try {
|
||||
$db->prepare("UPDATE users SET guild_id = NULL WHERE guild_id = ?")->execute([$guild_id]);
|
||||
$db->prepare("DELETE FROM guild_members WHERE guild_id = ?")->execute([$guild_id]);
|
||||
$db->prepare("DELETE FROM guilds WHERE id = ?")->execute([$guild_id]);
|
||||
$_SESSION['guild_id'] = null;
|
||||
$db->commit();
|
||||
header("Location: guilde.php");
|
||||
exit;
|
||||
} catch (Exception $e) { $db->rollBack(); $error = "Erreur : " . $e->getMessage(); }
|
||||
}
|
||||
|
||||
// LEAVE GUILD
|
||||
if (isset($_GET['action']) && $_GET['action'] === 'leave' && $in_guild && $user_guild_info['role'] !== 'superviseur') {
|
||||
$db->beginTransaction();
|
||||
try {
|
||||
$db->prepare("UPDATE users SET guild_id = NULL WHERE id = ?")->execute([$user_id]);
|
||||
$db->prepare("DELETE FROM guild_members WHERE user_id = ?")->execute([$user_id]);
|
||||
$_SESSION['guild_id'] = null;
|
||||
$db->commit();
|
||||
header("Location: guilde.php");
|
||||
exit;
|
||||
} catch (Exception $e) { $db->rollBack(); $error = "Erreur : " . $e->getMessage(); }
|
||||
}
|
||||
|
||||
// KICK MEMBER
|
||||
if (isset($_GET['kick']) && $in_guild && ($user_guild_info['role'] === 'superviseur' || $user_guild_info['role'] === 'officier')) {
|
||||
$target_id = (int)$_GET['kick'];
|
||||
if ($target_id != $user_id) {
|
||||
$stmt = $db->prepare("SELECT role FROM guild_members WHERE user_id = ? AND guild_id = ?");
|
||||
$stmt->execute([$target_id, $user_guild_info['guild_id']]);
|
||||
$target_role = $stmt->fetchColumn();
|
||||
if ($target_role) {
|
||||
$can_kick = ($user_guild_info['role'] === 'superviseur') || ($user_guild_info['role'] === 'officier' && $target_role === 'membre');
|
||||
if ($can_kick) {
|
||||
$db->prepare("UPDATE users SET guild_id = NULL WHERE id = ?")->execute([$target_id]);
|
||||
$db->prepare("DELETE FROM guild_members WHERE user_id = ?")->execute([$target_id]);
|
||||
$message = "Membre exclu.";
|
||||
} else $error = "Droits insuffisants.";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// UPDATE ROLE
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['action']) && $_POST['action'] === 'update_role' && $in_guild && $user_guild_info['role'] === 'superviseur') {
|
||||
$target_id = (int)$_POST['target_user_id'];
|
||||
$new_role = $_POST['new_role'];
|
||||
if (in_array($new_role, ['membre', 'officier']) && $target_id != $user_id) {
|
||||
$db->prepare("UPDATE guild_members SET role = ? WHERE user_id = ? AND guild_id = ?")->execute([$new_role, $target_id, $user_guild_info['guild_id']]);
|
||||
$message = "Grade mis à jour.";
|
||||
}
|
||||
}
|
||||
|
||||
// CREATE GUILD
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['action']) && $_POST['action'] === 'create_guild' && !$in_guild) {
|
||||
$name = trim($_POST['name']);
|
||||
$tag = strtoupper(trim($_POST['tag']));
|
||||
$description = trim($_POST['description']);
|
||||
if (strlen($name) < 3) $error = "Nom trop court.";
|
||||
elseif (strlen($tag) < 2) $error = "Tag trop court.";
|
||||
else {
|
||||
$reqs = $db->query("SELECT resource_id, amount FROM guild_creation_requirements WHERE amount > 0")->fetchAll(PDO::FETCH_ASSOC);
|
||||
$db->beginTransaction();
|
||||
try {
|
||||
$can_afford = true;
|
||||
foreach ($reqs as $req) {
|
||||
$stmt = $db->prepare("SELECT amount FROM user_resources WHERE user_id = ? AND resource_id = ?");
|
||||
$stmt->execute([$user_id, $req['resource_id']]);
|
||||
if (($stmt->fetchColumn() ?: 0) < $req['amount']) { $can_afford = false; break; }
|
||||
}
|
||||
if (!$can_afford) { $error = "Ressources insuffisantes."; $db->rollBack(); }
|
||||
else {
|
||||
foreach ($reqs as $req) $db->prepare("UPDATE user_resources SET amount = amount - ? WHERE user_id = ? AND resource_id = ?")->execute([$req['amount'], $user_id, $req['resource_id']]);
|
||||
$db->prepare("INSERT INTO guilds (name, tag, description) VALUES (?, ?, ?)")->execute([$name, $tag, $description]);
|
||||
$guild_id = $db->lastInsertId();
|
||||
$db->prepare("INSERT INTO guild_members (guild_id, user_id, role) VALUES (?, ?, 'superviseur')")->execute([$guild_id, $user_id]);
|
||||
$db->prepare("UPDATE users SET guild_id = ? WHERE id = ?")->execute([$guild_id, $user_id]);
|
||||
$_SESSION['guild_id'] = $guild_id;
|
||||
$db->commit();
|
||||
header("Location: guilde.php");
|
||||
exit;
|
||||
}
|
||||
} catch (Exception $e) { $db->rollBack(); $error = "Erreur : " . $e->getMessage(); }
|
||||
}
|
||||
}
|
||||
|
||||
// --- DATA FETCHING ---
|
||||
|
||||
if ($in_guild) {
|
||||
$stmt = $db->prepare("SELECT m.*, u.username, u.display_name, l.name as level_raw FROM guild_members m JOIN users u ON m.user_id = u.id LEFT JOIN levels l ON u.level_id = l.id WHERE m.guild_id = ? ORDER BY FIELD(m.role, 'superviseur', 'officier', 'membre'), m.joined_at ASC");
|
||||
$stmt->execute([$user_guild_info['guild_id']]);
|
||||
$guild_members = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
} else {
|
||||
$display_reqs = $db->query("SELECT r.id, r.name, r.icon, r.image_url, gr.amount FROM guild_creation_requirements gr JOIN game_resources r ON gr.resource_id = r.id WHERE gr.amount > 0")->fetchAll(PDO::FETCH_ASSOC);
|
||||
$all_guilds = $db->query("SELECT g.*, (SELECT COUNT(*) FROM guild_members WHERE guild_id = g.id) as member_count FROM guilds g ORDER BY member_count DESC")->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
// Check global affordability for create button
|
||||
$can_afford_creation = true;
|
||||
foreach ($display_reqs as $req) {
|
||||
if (($user_resource_amounts[$req['id']] ?? 0) < $req['amount']) {
|
||||
$can_afford_creation = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Nexus - Guilde</title>
|
||||
<title><?php echo $in_guild ? htmlspecialchars($user_guild_info['guild_name']) : 'Guildes'; ?> - Nexus</title>
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
|
||||
<link href="assets/css/custom.css?v=<?php echo time(); ?>" rel="stylesheet">
|
||||
<style>
|
||||
body { background: #000; color: #fff; font-family: 'Segoe UI', sans-serif; margin: 0; }
|
||||
#top-bar { background: #0f172a; border-bottom: 1px solid #1e293b; padding: 10px 40px; display: flex; flex-direction: column; gap: 10px; }
|
||||
.user-auth-bar { display: flex; justify-content: flex-end; align-items: center; gap: 20px; font-size: 11px; color: #8c92a3; }
|
||||
body { background: #000; color: #fff; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; margin: 0; }
|
||||
#main-wrapper { display: flex; flex-direction: column; min-height: 100vh; }
|
||||
|
||||
/* HEADER STYLES (MATCHING index.php) */
|
||||
#top-bar {
|
||||
background: #0f172a;
|
||||
border-bottom: 1px solid #1e293b;
|
||||
padding: 10px 40px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
}
|
||||
.user-auth-bar {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
gap: 20px;
|
||||
font-size: 11px;
|
||||
color: #8c92a3;
|
||||
}
|
||||
.user-auth-bar a { color: #88c0d0; text-decoration: none; font-weight: bold; }
|
||||
.resource-container { display: flex; justify-content: center; align-items: center; gap: 30px; }
|
||||
.resource-box { display: flex; align-items: center; gap: 12px; background: rgba(30, 41, 59, 0.4); padding: 6px 15px; border-radius: 8px; border: 1px solid rgba(136, 192, 208, 0.1); min-width: 140px; }
|
||||
.resource-icon img { width: 24px; height: 24px; object-fit: contain; }
|
||||
.user-auth-bar .username { color: #ebcb8b; }
|
||||
|
||||
.resource-container {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
gap: 30px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.resource-box {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
background: rgba(30, 41, 59, 0.5);
|
||||
padding: 6px 15px;
|
||||
border-radius: 8px;
|
||||
border: 1px solid #1e293b;
|
||||
min-width: 140px;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
.resource-box:hover { border-color: #88c0d0; background: rgba(30, 41, 59, 0.8); }
|
||||
.resource-icon {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
background: #1e293b;
|
||||
border-radius: 6px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 16px;
|
||||
color: #88c0d0;
|
||||
}
|
||||
.resource-icon img { width: 20px; height: 20px; object-fit: contain; }
|
||||
.resource-info { display: flex; flex-direction: column; }
|
||||
.resource-name { font-size: 9px; text-transform: uppercase; letter-spacing: 0.05em; color: #64748b; margin-bottom: 2px; }
|
||||
.resource-val-prod { display: flex; align-items: baseline; gap: 6px; }
|
||||
.resource-value { font-size: 14px; font-weight: bold; color: #f8fafc; }
|
||||
|
||||
#main-content { padding: 40px; max-width: 1200px; margin: 0 auto; }
|
||||
.card { background: rgba(15, 23, 42, 0.8); border: 1px solid #1e293b; border-radius: 12px; padding: 30px; margin-bottom: 30px; backdrop-filter: blur(10px); }
|
||||
.card-title { font-size: 24px; color: #88c0d0; margin-bottom: 20px; display: flex; align-items: center; gap: 15px; }
|
||||
|
||||
.member-table { width: 100%; border-collapse: collapse; margin-top: 20px; }
|
||||
.member-table th { text-align: left; padding: 15px; border-bottom: 2px solid #1e293b; color: #8c92a3; font-size: 12px; text-transform: uppercase; }
|
||||
.member-table td { padding: 15px; border-bottom: 1px solid #1e293b; font-size: 14px; }
|
||||
.role-badge { padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: bold; text-transform: uppercase; }
|
||||
.role-owner { background: rgba(235, 203, 139, 0.2); color: #ebcb8b; border: 1px solid #ebcb8b; }
|
||||
.role-officer { background: rgba(136, 192, 208, 0.2); color: #88c0d0; border: 1px solid #88c0d0; }
|
||||
.role-member { background: rgba(148, 163, 184, 0.2); color: #94a3b8; border: 1px solid #94a3b8; }
|
||||
|
||||
.form-group { margin-bottom: 20px; }
|
||||
.form-group label { display: block; margin-bottom: 8px; font-size: 14px; color: #94a3b8; }
|
||||
.form-control { width: 100%; background: #0f172a; border: 1px solid #334155; border-radius: 6px; padding: 12px; color: #fff; box-sizing: border-box; }
|
||||
.btn-primary { background: #88c0d0; color: #0f172a; border: none; padding: 12px 24px; border-radius: 6px; font-weight: bold; cursor: pointer; transition: all 0.2s; }
|
||||
.btn-primary:hover { background: #a3be8c; transform: translateY(-2px); }
|
||||
|
||||
.member-link { color: #88c0d0; text-decoration: none; cursor: pointer; font-weight: bold; }
|
||||
.member-link:hover { color: #fff; text-decoration: underline; }
|
||||
.resource-prod { font-size: 10px; color: #10b981; }
|
||||
|
||||
#game-container { flex: 1; padding: 30px; display: flex; flex-direction: column; align-items: center; }
|
||||
|
||||
/* GUILD SPECIFIC STYLES */
|
||||
.guild-content { max-width: 1000px; width: 100%; margin-top: 20px; }
|
||||
.guild-card { background: rgba(10, 15, 30, 0.95); border: 1px solid #2d3545; padding: 25px; border-radius: 8px; box-shadow: 0 0 30px rgba(0,0,0,0.5); }
|
||||
h1, h2, h3 { color: #88c0d0; text-transform: uppercase; letter-spacing: 1px; border-bottom: 1px solid #2d3545; padding-bottom: 10px; }
|
||||
.form-group { margin-bottom: 15px; }
|
||||
.form-group label { display: block; color: #8c92a3; font-size: 13px; margin-bottom: 5px; }
|
||||
.form-group input, .form-group textarea { width: 100%; background: #0f172a; border: 1px solid #334155; color: #fff; padding: 10px; box-sizing: border-box; font-family: inherit; border-radius: 4px; }
|
||||
.btn { border: none; padding: 10px 20px; cursor: pointer; font-weight: bold; border-radius: 4px; text-transform: uppercase; font-family: inherit; text-decoration: none; display: inline-block; font-size: 12px; transition: all 0.2s; }
|
||||
.btn-primary { background: #88c0d0; color: #000; }
|
||||
.btn-primary:hover { background: #81a1c1; }
|
||||
.btn-primary:disabled { background: #4c566a; color: #8c92a3; cursor: not-allowed; }
|
||||
.btn-danger { background: #bf616a; color: #fff; }
|
||||
.btn-join { background: #a3be8c; color: #000; }
|
||||
.error-msg { background: rgba(191, 97, 106, 0.1); color: #bf616a; padding: 12px; border: 1px solid #bf616a; margin-bottom: 20px; border-radius: 4px; }
|
||||
.success-msg { background: rgba(163, 190, 140, 0.1); color: #a3be8c; padding: 12px; border: 1px solid #a3be8c; margin-bottom: 20px; border-radius: 4px; }
|
||||
.member-table, .guild-table { width: 100%; border-collapse: collapse; margin-top: 20px; }
|
||||
.member-table th, .member-table td, .guild-table th, .guild-table td { border-bottom: 1px solid #1e293b; padding: 15px; text-align: left; }
|
||||
.member-table th, .guild-table th { background: rgba(30, 41, 59, 0.5); color: #88c0d0; font-size: 11px; text-transform: uppercase; }
|
||||
.role-badge { padding: 3px 10px; border-radius: 12px; font-size: 10px; font-weight: bold; text-transform: uppercase; }
|
||||
.role-superviseur { background: #ebcb8b; color: #000; }
|
||||
.role-officier { background: #81a1c1; color: #fff; }
|
||||
.role-membre { background: #4c566a; color: #fff; }
|
||||
.req-item { background: #1a202c; padding: 8px 12px; border: 1px solid #2d3545; display: inline-flex; align-items: center; gap: 8px; border-radius: 4px; margin-right: 10px; margin-bottom: 10px;}
|
||||
.req-item img { width: 18px; height: 18px; }
|
||||
.req-item.insufficient { border-color: #bf616a; color: #bf616a; }
|
||||
|
||||
/* MODAL STYLES (Copiés de index.php) */
|
||||
.modal-overlay {
|
||||
@ -169,125 +366,189 @@ foreach($header_resources as $hr) {
|
||||
}
|
||||
.modal-close:hover { color: #fff; }
|
||||
.modal-body { padding: 25px; }
|
||||
|
||||
.loader {
|
||||
border: 4px solid rgba(136, 192, 208, 0.1);
|
||||
border-left-color: #88c0d0;
|
||||
border-radius: 50%;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
animation: spin 1s linear infinite;
|
||||
margin: 40px auto;
|
||||
}
|
||||
@keyframes spin { to { transform: rotate(360deg); } }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<header id="top-bar">
|
||||
<div class="user-auth-bar">
|
||||
<span>Bienvenue, <span style="color: #ebcb8b;">@<?php echo htmlspecialchars($user['display_name'] ?: $user['username']); ?></span></span>
|
||||
<a href="index.php"><i class="fa-solid fa-earth-europe"></i> Retour au Nexus</a>
|
||||
<a href="auth.php?logout=1" style="color: #bf616a;"><i class="fa-solid fa-right-from-bracket"></i> Déconnexion</a>
|
||||
</div>
|
||||
<div class="resource-container">
|
||||
<?php foreach($resources as $name => $res): ?>
|
||||
<div class="resource-box">
|
||||
<div class="resource-icon">
|
||||
<?php if (!empty($res["image"])): ?>
|
||||
<img src="<?php echo htmlspecialchars($res["image"]); ?>?v=<?php echo time(); ?>">
|
||||
<div id="main-wrapper">
|
||||
<header id="top-bar">
|
||||
<div style="display: flex; align-items: center; gap: 20px;">
|
||||
<a href="index.php" style="text-decoration:none; color:#8c92a3; font-size:11px; font-weight:bold;"><i class="fa-solid fa-arrow-left"></i> Retour au Nexus</a>
|
||||
<?php if (isset($_SESSION["user_id"])): ?>
|
||||
<a href="guilde.php" style="text-decoration:none; color:#88c0d0; font-size:11px; font-weight:bold;"><i class="fa-solid fa-building-shield"></i> <?php echo empty($_SESSION["guild_id"]) ? "Création de guilde" : "Voir ma guilde"; ?></a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="user-auth-bar">
|
||||
<?php if (isset($_SESSION["user_id"])): ?>
|
||||
<span>Bienvenue, <span class="username">@<?php echo htmlspecialchars($_SESSION["display_name"] ?? $_SESSION["username"]); ?></span></span>
|
||||
<a href="project_log.php"><i class="fa-solid fa-clipboard-list"></i> Journal</a> <a href="account.php"><i class="fa-solid fa-user-gear"></i> Mon compte</a>
|
||||
<a href="auth.php?logout=1" style="color: #bf616a;"><i class="fa-solid fa-right-from-bracket"></i> Déconnexion</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="resource-container">
|
||||
<?php foreach($resources as $name => $res): ?>
|
||||
<div class="resource-box">
|
||||
<div class="resource-icon">
|
||||
<?php if (!empty($res["image"])): ?>
|
||||
<img src="<?php echo htmlspecialchars($res["image"]); ?>?v=<?php echo time(); ?>">
|
||||
<?php else: ?>
|
||||
<i class="fa-solid <?php echo htmlspecialchars($res["icon"]); ?>"></i>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="resource-info">
|
||||
<div class="resource-name"><?php echo htmlspecialchars($name); ?></div>
|
||||
<div class="resource-val-prod">
|
||||
<span class="resource-value"><?php echo htmlspecialchars($res["val"]); ?></span>
|
||||
<span class="resource-prod"><?php echo htmlspecialchars($res["prod"]); ?></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main id="game-container">
|
||||
<div class="guild-content">
|
||||
<?php if ($message): ?><div class="success-msg"><?php echo $message; ?></div><?php endif; ?>
|
||||
<?php if ($error): ?><div class="error-msg"><?php echo $error; ?></div><?php endif; ?>
|
||||
|
||||
<div class="guild-card">
|
||||
<?php if (!$in_guild): ?>
|
||||
<div style="display: flex; gap: 40px; flex-wrap: wrap;">
|
||||
<!-- Liste des guildes -->
|
||||
<div style="flex: 2; min-width: 300px;">
|
||||
<h2><i class="fa-solid fa-list"></i> Guildes Actives</h2>
|
||||
<table class="guild-table">
|
||||
<thead><tr><th>Guilde</th><th>Membres</th><th>Actions</th></tr></thead>
|
||||
<tbody>
|
||||
<?php if (empty($all_guilds)): ?>
|
||||
<tr><td colspan="3" style="text-align:center; color:#8c92a3;">Aucune guilde pour le moment.</td></tr>
|
||||
<?php endif; ?>
|
||||
<?php foreach ($all_guilds as $g): ?>
|
||||
<tr>
|
||||
<td>
|
||||
<strong style="color:#ebcb8b;">[<?php echo htmlspecialchars($g['tag']); ?>]</strong>
|
||||
<strong><?php echo htmlspecialchars($g['name']); ?></strong><br>
|
||||
<small style="color:#8c92a3;"><?php echo htmlspecialchars(mb_strimwidth($g['description'], 0, 80, "...")); ?></small>
|
||||
</td>
|
||||
<td><?php echo $g['member_count']; ?> / <?php echo $member_limit; ?></td>
|
||||
<td>
|
||||
<?php if ($g['member_count'] < $member_limit): ?>
|
||||
<a href="?join=<?php echo $g['id']; ?>" class="btn btn-join">Rejoindre</a>
|
||||
<?php else: ?>
|
||||
<span style="color:#bf616a; font-size:11px; font-weight:bold;">PLEINE</span>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- Création -->
|
||||
<div style="flex: 1; min-width: 280px; background: rgba(30, 41, 59, 0.3); padding: 20px; border: 1px solid #2d3545; border-radius: 8px;">
|
||||
<h3>Fonder une Guilde</h3>
|
||||
<div style="margin-bottom: 20px;">
|
||||
<p style="font-size: 13px; color: #8c92a3;">Coût requis :</p>
|
||||
<?php if (empty($display_reqs)): ?><p style="color:#a3be8c;">Gratuit</p>
|
||||
<?php else: ?>
|
||||
<?php foreach ($display_reqs as $req):
|
||||
$user_has = $user_resource_amounts[$req['id']] ?? 0;
|
||||
$is_insufficient = $user_has < $req['amount'];
|
||||
?>
|
||||
<div class="req-item <?php echo $is_insufficient ? 'insufficient' : ''; ?>" title="Vous avez: <?php echo number_format($user_has); ?>">
|
||||
<?php if ($req['image_url']): ?><img src="<?php echo htmlspecialchars($req['image_url']); ?>">
|
||||
<?php else: ?><i class="fa-solid <?php echo htmlspecialchars($req['icon'] ?: 'fa-gem'); ?>"></i><?php endif; ?>
|
||||
<strong><?php echo number_format($req['amount']); ?></strong>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<form method="POST">
|
||||
<input type="hidden" name="action" value="create_guild">
|
||||
<div class="form-group"><label>Nom</label><input type="text" name="name" required placeholder="Nom de votre organisation"></div>
|
||||
<div class="form-group"><label>Tag (2-5 car.)</label><input type="text" name="tag" required maxlength="5" placeholder="TAG"></div>
|
||||
<div class="form-group"><label>Description</label><textarea name="description" rows="3" placeholder="Objectifs de la guilde..."></textarea></div>
|
||||
<button type="submit" class="btn btn-primary" style="width:100%;" <?php echo !$can_afford_creation ? 'disabled' : ''; ?>>
|
||||
<?php echo $can_afford_creation ? 'Fonder la guilde' : 'Ressources insuffisantes'; ?>
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<i class="fa-solid <?php echo htmlspecialchars($res["icon"]); ?>" style="color: #88c0d0;"></i>
|
||||
<div style="display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid #88c0d0; padding-bottom: 15px; margin-bottom: 20px;">
|
||||
<div>
|
||||
<span style="color: #ebcb8b; font-weight: bold; font-size: 24px;">[<?php echo htmlspecialchars($user_guild_info['guild_tag']); ?>]</span>
|
||||
<h1 style="display: inline; border-bottom: none; margin-left: 10px;"><?php echo htmlspecialchars($user_guild_info['guild_name']); ?></h1>
|
||||
</div>
|
||||
<div style="color: #8c92a3; font-size: 14px;">Votre grade : <span class="role-badge role-<?php echo $user_guild_info['role']; ?>"><?php echo $user_guild_info['role']; ?></span></div>
|
||||
</div>
|
||||
|
||||
<div style="background: rgba(30, 41, 59, 0.4); border-left: 4px solid #88c0d0; padding: 20px; margin-bottom: 30px; color: #d8dee9; border-radius: 0 4px 4px 0;">
|
||||
<?php echo nl2br(htmlspecialchars($user_guild_info['guild_desc'] ?: "Pas de description.")); ?>
|
||||
</div>
|
||||
|
||||
<h3>Membres de la Guilde (<?php echo count($guild_members); ?> / <?php echo $member_limit; ?>)</h3>
|
||||
<table class="member-table">
|
||||
<thead><tr><th style="text-align: center;">Niveau</th><th>Membre</th><th>Grade</th><th>Ancienneté</th><?php if ($user_guild_info['role'] === 'superviseur' || $user_guild_info['role'] === 'officier'): ?><th>Gestion</th><?php endif; ?></tr></thead>
|
||||
<tbody>
|
||||
<?php foreach ($guild_members as $member): ?>
|
||||
<?php $m_level = (int)filter_var($member["level_raw"], FILTER_SANITIZE_NUMBER_INT); ?>
|
||||
<tr>
|
||||
<td style="text-align: center; font-weight: bold; color: #88c0d0;"><?php echo $m_level; ?></td>
|
||||
<td>
|
||||
<strong style="color:<?php echo $member['user_id'] == $user_id ? '#88c0d0' : '#fff'; ?>; cursor: pointer;" onclick="openProfileModal(<?php echo $member['user_id']; ?>)">
|
||||
@<?php echo htmlspecialchars($member['display_name'] ?: $member['username']); ?>
|
||||
<?php if($member['user_id'] == $user_id) echo " (Vous)"; ?>
|
||||
</strong>
|
||||
</td>
|
||||
<td><span class="role-badge role-<?php echo $member['role']; ?>"><?php echo $member['role']; ?></span></td>
|
||||
<td><?php echo date('d/m/Y', strtotime($member['joined_at'])); ?></td>
|
||||
<?php if ($user_guild_info['role'] === 'superviseur' || $user_guild_info['role'] === 'officier'): ?>
|
||||
<td>
|
||||
<?php if ($member['user_id'] != $user_id): ?>
|
||||
<?php if ($user_guild_info['role'] === 'superviseur'): ?>
|
||||
<form method="POST" style="display: inline;">
|
||||
<input type="hidden" name="action" value="update_role">
|
||||
<input type="hidden" name="target_user_id" value="<?php echo $member['user_id']; ?>">
|
||||
<select name="new_role" onchange="this.form.submit()" style="background: #1a202c; color: #fff; border: 1px solid #334155; padding: 4px; font-size: 11px; border-radius: 4px; cursor: pointer;">
|
||||
<option value="membre" <?php echo $member['role'] === 'membre' ? 'selected' : ''; ?>>Membre</option>
|
||||
<option value="officier" <?php echo $member['role'] === 'officier' ? 'selected' : ''; ?>>Officier</option>
|
||||
</select>
|
||||
</form>
|
||||
<?php endif; ?>
|
||||
<?php if ($user_guild_info['role'] === 'superviseur' || ($user_guild_info['role'] === 'officier' && $member['role'] === 'membre')): ?>
|
||||
<a href="?kick=<?php echo $member['user_id']; ?>" style="color: #bf616a; margin-left: 15px;" onclick="return confirm('Voulez-vous vraiment exclure ce membre ?')" title="Exclure"><i class="fa-solid fa-user-xmark"></i></a>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<?php endif; ?>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div style="margin-top: 40px; border-top: 1px solid #1e293b; padding-top: 20px; display: flex; justify-content: flex-end;">
|
||||
<?php if ($user_guild_info['role'] === 'superviseur'): ?>
|
||||
<a href="?action=disband" class="btn btn-danger" onclick="return confirm('ATTENTION : Voulez-vous vraiment DISSOUDRE la guilde ? Cette action est irréversible.')">Dissoudre la guilde</a>
|
||||
<?php else: ?>
|
||||
<a href="?action=leave" class="btn btn-danger" onclick="return confirm('Quitter la guilde ?')">Quitter la guilde</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="resource-info">
|
||||
<div style="font-size: 9px; text-transform: uppercase; color: #64748b;"><?php echo htmlspecialchars($name); ?></div>
|
||||
<span class="resource-value"><?php echo htmlspecialchars($res["val"]); ?></span>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</header>
|
||||
</main>
|
||||
</div>
|
||||
|
||||
<main id="main-content">
|
||||
<?php if ($guild_id): ?>
|
||||
<div class="card">
|
||||
<div class="card-title">
|
||||
<i class="fa-solid fa-building-shield"></i>
|
||||
<span><?php echo htmlspecialchars($user['guild_name']); ?> [<?php echo htmlspecialchars($members[0]['role'] == 'owner' ? $members[0]['role'] : 'Membre'); ?>]</span>
|
||||
</div>
|
||||
|
||||
<table class="member-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Niveau</th>
|
||||
<th>Membre</th>
|
||||
<th>Rang</th>
|
||||
<th>Date d'arrivée</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($members as $m): ?>
|
||||
<tr>
|
||||
<td style="color: #88c0d0; font-weight: bold;">
|
||||
<?php echo htmlspecialchars($m['level_name'] ?: 'Niveau 1'); ?>
|
||||
</td>
|
||||
<td>
|
||||
<span class="member-link" onclick="openProfileModal(<?php echo $m['id']; ?>)">
|
||||
<?php echo htmlspecialchars($m['display_name'] ?: $m['username']); ?>
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
<span class="role-badge role-<?php echo $m['role']; ?>">
|
||||
<?php
|
||||
switch($m['role']) {
|
||||
case 'owner': echo 'Superviseur'; break;
|
||||
case 'officer': echo 'Officier'; break;
|
||||
default: echo 'Explorateur';
|
||||
}
|
||||
?>
|
||||
</span>
|
||||
</td>
|
||||
<td style="color: #64748b; font-size: 12px;">
|
||||
<?php echo date('d/m/Y', strtotime($m['joined_at'])); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div class="card">
|
||||
<div class="card-title">
|
||||
<i class="fa-solid fa-plus-circle"></i>
|
||||
<span>Fonder une nouvelle guilde</span>
|
||||
</div>
|
||||
|
||||
<?php if ($error): ?><div style="color: #bf616a; margin-bottom: 20px; padding: 10px; background: rgba(191,97,106,0.1); border-radius: 6px;"><?php echo $error; ?></div><?php endif; ?>
|
||||
|
||||
<form method="POST">
|
||||
<div class="form-group">
|
||||
<label>Nom de la guilde</label>
|
||||
<input type="text" name="guild_name" class="form-control" placeholder="ex: Les Pionniers du Vide" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Tag (3-4 caractères)</label>
|
||||
<input type="text" name="guild_tag" class="form-control" placeholder="ex: LPV" maxlength="4" required>
|
||||
</div>
|
||||
<button type="submit" name="create_guild" class="btn-primary">Fonder la guilde</button>
|
||||
</form>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</main>
|
||||
|
||||
<!-- MODAL DE PROFIL (Même structure que index.php) -->
|
||||
<div id="profileModal" class="modal-overlay" onclick="if(event.target === this) closeProfileModal()">
|
||||
<!-- PROFILE MODAL (Structure identique à index.php) -->
|
||||
<div id="profileModal" class="modal-overlay" onclick="if(event.target === this) this.style.display='none'">
|
||||
<div class="modal-container">
|
||||
<div class="modal-header">
|
||||
<h2>Profil Public</h2>
|
||||
<button class="modal-close" onclick="closeProfileModal()">×</button>
|
||||
<button class="modal-close" onclick="document.getElementById('profileModal').style.display='none'">×</button>
|
||||
</div>
|
||||
<div id="profileModalContent" class="modal-body">
|
||||
<!-- Le contenu sera chargé ici via AJAX -->
|
||||
<div id="profileModalContent" class="modal-body" style="text-align: center; padding-top: 40px; padding-bottom: 40px;">
|
||||
<!-- Chargé via AJAX -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -297,7 +558,7 @@ foreach($header_resources as $hr) {
|
||||
const modal = document.getElementById('profileModal');
|
||||
const content = document.getElementById('profileModalContent');
|
||||
|
||||
content.innerHTML = '<div class="loader"></div>';
|
||||
content.innerHTML = '<div style="padding: 40px; color: #8c92a3;"><i class="fa-solid fa-spinner fa-spin fa-2x"></i><br><br>Chargement des données...</div>';
|
||||
modal.style.display = 'flex';
|
||||
|
||||
fetch(`profile.php?id=${userId}`, {
|
||||
@ -308,14 +569,10 @@ foreach($header_resources as $hr) {
|
||||
content.innerHTML = html;
|
||||
})
|
||||
.catch(error => {
|
||||
content.innerHTML = '<div style="color: #bf616a; text-align: center;">Erreur lors du chargement du profil.</div>';
|
||||
content.innerHTML = '<div style="color: #bf616a; padding: 40px;">Erreur de connexion au Nexus.</div>';
|
||||
console.error('Error:', error);
|
||||
});
|
||||
}
|
||||
|
||||
function closeProfileModal() {
|
||||
document.getElementById('profileModal').style.display = 'none';
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
80
profile.php
80
profile.php
@ -46,48 +46,46 @@ if ($id || !empty($username)) {
|
||||
}
|
||||
|
||||
if ($is_ajax): ?>
|
||||
<div style="text-align: center; padding: 20px 0;">
|
||||
<?php if ($user): ?>
|
||||
<div style="display: flex; align-items: center; justify-content: center; gap: 15px; margin-bottom: 10px;">
|
||||
<img src="<?php echo htmlspecialchars($user['grade_image']); ?>" style="width: 60px; height: 60px; object-fit: contain;">
|
||||
<span style="font-size: 28px; font-weight: bold; color: #fff;">
|
||||
<?php echo htmlspecialchars($user['grade_name']); ?>
|
||||
<?php echo htmlspecialchars($user['display_name'] ?: $user['username']); ?>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<?php if (!empty($user['title_name'])): ?>
|
||||
<div style="font-size: 14px; font-weight: bold; color: #ebcb8b; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 5px;">
|
||||
« <?php echo htmlspecialchars($user['title_name']); ?> »
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div style="font-size: 16px; color: #88c0d0; opacity: 0.8; margin-bottom: 20px;">
|
||||
Niveau <?php echo $user['level_num']; ?>
|
||||
</div>
|
||||
|
||||
<?php if (!empty($user['guild_id'])): ?>
|
||||
<div style="background: rgba(30, 41, 59, 0.3); padding: 10px; border-radius: 8px; border: 1px solid rgba(136, 192, 208, 0.1); display: inline-flex; align-items: center; gap: 8px; margin-bottom: 20px;">
|
||||
<i class="fa-solid fa-building-shield" style="color: #88c0d0;"></i>
|
||||
<span style="color: #ebcb8b; font-weight: bold;">[<?php echo htmlspecialchars($user['guild_tag']); ?>]</span>
|
||||
<span style="color: #fff; font-size: 13px;"><?php echo htmlspecialchars($user['guild_name']); ?></span>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!empty($user['badge_image'])): ?>
|
||||
<div style="margin-top: 20px; padding: 15px; background: rgba(30, 41, 59, 0.3); border-radius: 12px; display: block; width: fit-content; margin-left: auto; margin-right: auto;">
|
||||
<img src="<?php echo htmlspecialchars($user['badge_image']); ?>?v=<?php echo time(); ?>" style="width: 80px; height: 80px; object-fit: contain; filter: drop-shadow(0 0 10px rgba(136, 192, 208, 0.2));" title="<?php echo htmlspecialchars($user['badge_name']); ?>">
|
||||
<div style="font-size: 10px; color: #8c92a3; margin-top: 8px; text-transform: uppercase;">Badge Équipé</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php else: ?>
|
||||
<div style="text-align: center; padding: 40px;">
|
||||
<i class="fa-solid fa-user-slash" style="font-size: 48px; color: #bf616a; margin-bottom: 20px;"></i>
|
||||
<h2 style="color: #fff;">Joueur introuvable</h2>
|
||||
<?php if ($user): ?>
|
||||
<div style="display: flex; align-items: center; justify-content: center; gap: 15px; margin-bottom: 10px;">
|
||||
<img src="<?php echo htmlspecialchars($user['grade_image']); ?>" style="width: 60px; height: 60px; object-fit: contain;">
|
||||
<span style="font-size: 28px; font-weight: bold; color: #fff;">
|
||||
<?php echo htmlspecialchars($user['grade_name']); ?>
|
||||
<?php echo htmlspecialchars($user['display_name'] ?: $user['username']); ?>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<?php if (!empty($user['title_name'])): ?>
|
||||
<div style="font-size: 14px; font-weight: bold; color: #ebcb8b; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 5px;">
|
||||
« <?php echo htmlspecialchars($user['title_name']); ?> »
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div style="font-size: 16px; color: #88c0d0; opacity: 0.8; margin-bottom: 20px;">
|
||||
Niveau <?php echo $user['level_num']; ?>
|
||||
</div>
|
||||
|
||||
<?php if (!empty($user['guild_id'])): ?>
|
||||
<div style="background: rgba(30, 41, 59, 0.3); padding: 8px 15px; border-radius: 8px; border: 1px solid rgba(136, 192, 208, 0.1); display: inline-flex; align-items: center; gap: 8px; margin-bottom: 10px;">
|
||||
<i class="fa-solid fa-building-shield" style="color: #88c0d0;"></i>
|
||||
<span style="color: #ebcb8b; font-weight: bold;">[<?php echo htmlspecialchars($user['guild_tag']); ?>]</span>
|
||||
<span style="color: #fff; font-size: 13px;"><?php echo htmlspecialchars($user['guild_name']); ?></span>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!empty($user['badge_image'])): ?>
|
||||
<div style="margin-top: 15px; padding: 15px; background: rgba(30, 41, 59, 0.3); border-radius: 12px; display: inline-block;">
|
||||
<img src="<?php echo htmlspecialchars($user['badge_image']); ?>?v=<?php echo time(); ?>" style="width: 80px; height: 80px; object-fit: contain; filter: drop-shadow(0 0 10px rgba(136, 192, 208, 0.2));" title="<?php echo htmlspecialchars($user['badge_name']); ?>">
|
||||
<div style="font-size: 10px; color: #8c92a3; margin-top: 8px; text-transform: uppercase;">Badge Équipé</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php else: ?>
|
||||
<div style="text-align: center; padding: 20px;">
|
||||
<i class="fa-solid fa-user-slash" style="font-size: 48px; color: #bf616a; margin-bottom: 20px;"></i>
|
||||
<h2 style="color: #fff;">Joueur introuvable</h2>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php exit; endif; ?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
@ -166,4 +164,4 @@ if ($is_ajax): ?>
|
||||
<a href="index.php" class="btn-back"><i class="fa-solid fa-arrow-left"></i> Retour au Nexus</a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
Loading…
x
Reference in New Issue
Block a user