Files
2026-07-03 12:26:01 +02:00

240 lines
8.9 KiB
HTML

<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Administration - MonPetitPari.fr</title>
<link rel="stylesheet" href="css/dashboard.css">
<style>
.admin-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 2rem;
}
.admin-card {
background: white;
padding: 2rem;
border-radius: 15px;
box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.admin-card h3 {
color: #e85d04;
margin-bottom: 1rem;
}
.form-group {
margin-bottom: 1rem;
}
.form-group label {
display: block;
margin-bottom: 0.5rem;
color: #666;
}
.form-group input, .form-group select {
width: 100%;
padding: 0.8rem;
border: 1px solid #ddd;
border-radius: 8px;
}
.btn-success {
background: #28a745;
color: white;
border: none;
padding: 0.8rem 1.5rem;
border-radius: 8px;
cursor: pointer;
width: 100%;
}
.btn-danger {
background: #dc3545;
color: white;
border: none;
padding: 0.5rem 1rem;
border-radius: 5px;
cursor: pointer;
}
table {
width: 100%;
border-collapse: collapse;
}
th, td {
padding: 1rem;
text-align: left;
border-bottom: 1px solid #ddd;
}
th {
background: #e85d04;
color: white;
}
</style>
</head>
<body>
<nav class="dashboard-nav">
<div class="logo">🎾 MonPetitPari.fr - Admin</div>
<div class="user-info">
<span id="adminName">Administrateur</span>
<button onclick="logout()" class="btn-logout">Déconnexion</button>
</div>
</nav>
<div class="dashboard-container">
<aside class="sidebar">
<ul>
<li class="active" onclick="showAdminSection('dashboard')">📊 Tableau de bord</li>
<li onclick="showAdminSection('matches')">🎾 Gérer les matches</li>
<li onclick="showAdminSection('players')">👥 Gérer les joueurs</li>
<li onclick="showAdminSection('users')">👤 Utilisateurs</li>
<li onclick="showAdminSection('results')">✅ Résultats</li>
</ul>
</aside>
<main class="main-content">
<!-- Dashboard -->
<section id="dashboard" class="section active">
<h2>Tableau de bord</h2>
<div class="admin-grid">
<div class="admin-card">
<h3>Matches totaux</h3>
<p style="font-size: 2.5rem; color: #e85d04;" id="totalMatches">0</p>
</div>
<div class="admin-card">
<h3>Joueurs</h3>
<p style="font-size: 2.5rem; color: #e85d04;" id="totalPlayers">0</p>
</div>
<div class="admin-card">
<h3>Utilisateurs</h3>
<p style="font-size: 2.5rem; color: #e85d04;" id="totalUsers">0</p>
</div>
<div class="admin-card">
<h3>Pronostics</h3>
<p style="font-size: 2.5rem; color: #e85d04;" id="totalPredictions">0</p>
</div>
</div>
</section>
<!-- Gérer les matches -->
<section id="matches" class="section">
<h2>Gestion des Matches</h2>
<div class="admin-card">
<h3>Ajouter un match</h3>
<div class="form-group">
<label>Tour</label>
<select id="matchRound">
<option>Finale</option>
<option>Demi-finale</option>
<option>Quart de finale</option>
<option>8ème de finale</option>
</select>
</div>
<div class="form-group">
<label>Joueur 1</label>
<select id="matchPlayer1"></select>
</div>
<div class="form-group">
<label>Joueur 2</label>
<select id="matchPlayer2"></select>
</div>
<div class="form-group">
<label>Date</label>
<input type="date" id="matchDate">
</div>
<div class="form-group">
<label>Court</label>
<input type="text" id="matchCourt" placeholder="Court Philippe-Chatrier">
</div>
<button class="btn-success" onclick="addMatch()">Ajouter le match</button>
</div>
<div style="margin-top: 2rem;">
<h3>Matches existants</h3>
<table>
<thead>
<tr>
<th>Tour</th>
<th>Joueur 1</th>
<th>Joueur 2</th>
<th>Date</th>
<th>Statut</th>
<th>Actions</th>
</tr>
</thead>
<tbody id="matchesTable"></tbody>
</table>
</div>
</section>
<!-- Gérer les joueurs -->
<section id="players" class="section">
<h2>Gestion des Joueurs</h2>
<div class="admin-card">
<h3>Ajouter un joueur</h3>
<div class="form-group">
<label>Nom</label>
<input type="text" id="playerName">
</div>
<div class="form-group">
<label>Nationalité</label>
<input type="text" id="playerNationality">
</div>
<div class="form-group">
<label>Âge</label>
<input type="number" id="playerAge">
</div>
<div class="form-group">
<label>Handedness</label>
<select id="playerHandedness">
<option>Droitier</option>
<option>Gaucher</option>
</select>
</div>
<div class="form-group">
<label>Ranking</label>
<input type="number" id="playerRanking">
</div>
<button class="btn-success" onclick="addPlayer()">Ajouter le joueur</button>
</div>
</section>
<!-- Utilisateurs -->
<section id="users" class="section">
<h2>Gestion des Utilisateurs</h2>
<table>
<thead>
<tr>
<th>ID</th>
<th>Nom d'utilisateur</th>
<th>Email</th>
<th>Rôle</th>
<th>Points</th>
<th>Actions</th>
</tr>
</thead>
<tbody id="usersTable"></tbody>
</table>
</section>
<!-- Résultats -->
<section id="results" class="section">
<h2>Saisie des Résultats</h2>
<div class="admin-card">
<h3>Mettre à jour un match</h3>
<div class="form-group">
<label>Sélectionner un match</label>
<select id="resultMatch"></select>
</div>
<div class="form-group">
<label>Vainqueur</label>
<select id="resultWinner"></select>
</div>
<div class="form-group">
<label>Score</label>
<input type="text" id="resultScore" placeholder="6-4, 6-3, 6-2">
</div>
<button class="btn-success" onclick="updateResult()">Mettre à jour</button>
</div>
</section>
</main>
</div>
<script src="js/admin.js"></script>
</body>
</html>