<?
php
// Inclure le fichier de vérification d'authentification
require_once 'check_auth.php';
// Vérifier si l'utilisateur est connecté
requireLogin();
// Récupérer les informations de l'agent depuis la session
$matricule = $_SESSION['matricule'];
$nom = $_SESSION['nom'];
$prenom = $_SESSION['prenom'];
$fonction = $_SESSION['fonction'] ?? '';
$structure = $_SESSION['structure'] ?? '';
// Créer l'initiale pour l'avatar (première lettre du prénom)
$initiale = strtoupper(substr($prenom, 0, 1));
$nomComplet = $prenom . ' ' . $nom;
?>
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Espace Agent - Sonatrach</title>
<style>
/* Styles de base */
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
margin: 0;
padding: 0;
background-color: #f5f5f5;
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 20px;
}
header {
background-color: #fff;
box-shadow: 0 2px 5px rgba(0,0,0,0.1);
padding: 15px 0;
}
.header-content {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 20px;
}
.logo {
display: flex;
align-items: center;
}
.logo img {
height: 50px;
margin-right: 10px;
}
.user-info {
display: flex;
align-items: center;
}
.avatar {
width: 40px;
height: 40px;
background-color: #f39c12;
color: white;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
margin-right: 10px;
font-weight: bold;
}
.welcome-section {
text-align: center;
margin: 40px 0;
}
.welcome-section h1 {
color: #333;
margin-bottom: 10px;
}
.welcome-section p {
color: #666;
max-width: 600px;
margin: 0 auto;
}
.dashboard-cards {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
gap: 20px;
margin-top: 30px;
}
.card {
background-color: white;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
padding: 20px;
text-align: center;
}
.card h2 {
color: #f39c12;
font-size: 2rem;
margin-bottom: 10px;
}
.card p {
color: #666;
font-size: 0.9rem;
}
.logout-btn {
background-color: #f39c12;
color: white;
border: none;
padding: 8px 15px;
border-radius: 4px;
cursor: pointer;
text-decoration: none;
}
.logout-btn:hover {
background-color: #e67e22;
}
</style>
</head>
<body>
<header>
<div class="header-content">
<div class="logo">
<img src="images/[Link]" alt="Sonatrach Logo">
<span>Sonatrach</span>
</div>
<div class="user-info">
<div class="avatar"><?php echo $initiale; ?></div>
<span><?php echo htmlspecialchars($nomComplet); ?></span>
<a href="[Link]" class="logout-btn" style="margin-left:
15px;">Déconnexion</a>
</div>
</div>
</header>
<div class="container">
<section class="welcome-section">
<h1>Bienvenue dans votre Espace Agent</h1>
<p>Gérez efficacement vos missions, congés et demandes administratives
avec l'espace agent Sonatrach.</p>
</section>
<div class="dashboard-cards">
<div class="card">
<h2>14</h2>
<p>Jours de congés restants</p>
</div>
<div class="card">
<h2>2</h2>
<p>Missions en cours</p>
</div>
<div class="card">
<h2>3</h2>
<p>Demandes en attente</p>
</div>
<div class="card">
<h2>7</h2>
<p>Notifications non lues</p>
</div>
</div>
</div>
</body>
</html>