<?php
require 'check_login.php';
// Om rollen inte är admin, skicka till användarsidan
if ($_SESSION['role'] !== 'admin') {
header("Location: user.php?msg=Du har inte rättigheter");
exit();
}
?>
<!DOCTYPE html>
<html lang="sv">
<head>
<meta charset="UTF-8">
<title>Admin</title>
<style>
* {
box-sizing: border-box;
margin: 0;
padding: 0;
font-family: Arial, sans-serif;
}
body {
background: #f0f2f5;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
.container {
background: #fff;
padding: 40px;
border-radius: 10px;
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
width: 100%;
max-width: 500px;
text-align: center;
}
h2 {
margin-bottom: 20px;
color: #333;
}
p {
margin-bottom: 30px;
color: #555;
}
a {
display: inline-block;
padding: 12px 25px;
background: #f44336;
color: white;
text-decoration: none;
border-radius: 5px;
transition: background 0.3s;
}
a:hover {
background: #d32f2f;
}
</style>
</head>
<body>
<div class="container">
<h2>Välkommen till Admin sida</h2>
<p>Välkommen <?= htmlspecialchars($_SESSION['username']); ?>!</p>
<p>Här kan du administrera systemet.</p>
<a href="logout.php">Logga ut</a>
</div>
</body>
</html>