Compare commits
8 Commits
e57c21386d
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
a07a070b92
|
|||
|
87a58068f0
|
|||
|
31602977b7
|
|||
|
bbffb741a4
|
|||
|
a0c0cef41b
|
|||
|
b68b7f2824
|
|||
|
461a1f4853
|
|||
|
1ee47f62e6
|
@@ -1,32 +1,56 @@
|
|||||||
|
<!-- RICHIESTA FILA A -->
|
||||||
<?php
|
<?php
|
||||||
session_start();
|
session_start();
|
||||||
include 'db_conf.php';
|
include 'db_conf.php';
|
||||||
|
|
||||||
//Query per ottenere le statistiche dei dispositivi
|
// Query per ottenere il tempo totale di utilizzo giornaliero aggregato per fascia d'età
|
||||||
$sql = "SELECT s.id_stat_device, f.range_eta, s.tipo_dispositivo, s.ore_medie_giornaliere FROM statistiche_dispositivi s JOIN fasce_eta f ON f.id_fascia=s.id_fascia";
|
$sql = "SELECT f.range_eta, SUM(s.ore_medie_giornaliere) AS ore_totali
|
||||||
|
FROM Statistiche_Dispositivi s
|
||||||
|
JOIN Fasce_Eta f ON f.id_fascia=s.id_fascia
|
||||||
|
GROUP BY f.id_fascia, f.range_eta
|
||||||
|
ORDER BY f.id_fascia ASC";
|
||||||
$resultDispositivi = $conn->query($sql);
|
$resultDispositivi = $conn->query($sql);
|
||||||
|
|
||||||
// Interruzione in caso di errore nella richiesta
|
// Interruzione in caso di errore nella richiesta
|
||||||
if ($resultDispositivi === false){
|
if ($resultDispositivi === false){
|
||||||
die("Errore nella query: " . $conn->error);
|
die("Errore nella query: " . $conn->error);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Query per ottenere le statistiche social
|
|
||||||
$sql = "SELECT s.id_stat_social, f.range_eta, s.piattaforma, s.minuti_medi_giornalieri, s.percentuale_penetrazione FROM statistiche_social s JOIN fasce_eta f ON f.id_fascia = s.id_fascia";
|
|
||||||
$resultSocial = $conn->query($sql);
|
|
||||||
|
|
||||||
// Interruzione in caso di errore nella richiesta
|
|
||||||
if ($resultSocial === false){
|
|
||||||
die("Errore nella query: " . $conn->error);
|
|
||||||
}
|
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>Document</title>
|
<title>GenZ Digital Hub</title>
|
||||||
|
<link rel="stylesheet" href="style.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
<?php if (isset($_SESSION['id'])): ?>
|
||||||
|
<h1>Benvenuto, <?php echo htmlspecialchars($_SESSION['name'] . ' ' . $_SESSION['surname']); ?>!</h1>
|
||||||
|
<p><a href="logout.php">Logout</a></p>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
<h2>Tempo Totale di Utilizzo Giornaliero per Fascia d'Età</h2>
|
||||||
|
<table border="1" cellpadding="10" cellspacing="0">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Fascia d'Età</th>
|
||||||
|
<th>Ore Totali Giornaliere</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php while ($row = $resultDispositivi->fetch_assoc()): ?>
|
||||||
|
<tr>
|
||||||
|
<td><?php echo htmlspecialchars($row['range_eta']); ?></td>
|
||||||
|
<td><?php echo number_format($row['ore_totali'], 2, ',', '.'); ?> ore</td>
|
||||||
|
</tr>
|
||||||
|
<?php endwhile; ?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<?php else: ?>
|
||||||
|
<h1>Benvenuto su GenZ Digital Hub</h1>
|
||||||
|
<p><a href="login.php">Accedi</a> o <a href="register.php">Registrati</a> per visualizzare le statistiche.</p>
|
||||||
|
<?php endif; ?>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>Accesso</title>
|
<title>Accesso</title>
|
||||||
<link rel="stylesheet" href="assets/style.css">
|
<link rel="stylesheet" href="style.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<?php
|
<?php
|
||||||
@@ -57,6 +57,7 @@
|
|||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<br>
|
<br>
|
||||||
<input type="submit" value="Accedi">
|
<input type="submit" value="Accedi">
|
||||||
|
<br><br>
|
||||||
<p>Non hai un account? <a href="register.php">Registrati</a></p>
|
<p>Non hai un account? <a href="register.php">Registrati</a></p>
|
||||||
</form>
|
</form>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
<?php
|
||||||
|
session_start();
|
||||||
|
session_destroy();
|
||||||
|
header('Location: index.php');
|
||||||
|
exit();
|
||||||
|
?>
|
||||||
+2
-1
@@ -8,7 +8,7 @@
|
|||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>Registrazione - TechStore</title>
|
<title>Registrazione - TechStore</title>
|
||||||
<link rel="stylesheet" href="assets/style.css">
|
<link rel="stylesheet" href="style.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<?php
|
<?php
|
||||||
@@ -49,6 +49,7 @@
|
|||||||
<label for="confirm_password">Conferma password:</label>
|
<label for="confirm_password">Conferma password:</label>
|
||||||
<input type="password" id="confirm_password" name="confirm_password" required><br><br>
|
<input type="password" id="confirm_password" name="confirm_password" required><br><br>
|
||||||
<input type="submit" value="Registrati">
|
<input type="submit" value="Registrati">
|
||||||
|
<br><br>
|
||||||
<p>Hai già un account? <a href="login.php">Accedi</a></p>
|
<p>Hai già un account? <a href="login.php">Accedi</a></p>
|
||||||
</form>
|
</form>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -0,0 +1,208 @@
|
|||||||
|
* {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
||||||
|
background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
|
||||||
|
color: #e0e0e0;
|
||||||
|
line-height: 1.6;
|
||||||
|
min-height: 100vh;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Typography */
|
||||||
|
h1, h2 {
|
||||||
|
color: #00d4ff;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
text-align: center;
|
||||||
|
/* Opzionale: aggiunge un leggero effetto di glow alle intestazioni */
|
||||||
|
/* text-shadow: 0 0 10px rgba(0, 212, 255, 0.5); */
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
font-size: 2.5rem;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
h2 {
|
||||||
|
font-size: 2rem;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
margin-bottom: 20px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Links */
|
||||||
|
a {
|
||||||
|
color: #00d4ff;
|
||||||
|
text-decoration: none;
|
||||||
|
transition: color 0.3s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
a:hover {
|
||||||
|
color: #0099cc;
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Forms */
|
||||||
|
form {
|
||||||
|
background: rgba(255, 255, 255, 0.05);
|
||||||
|
backdrop-filter: blur(10px);
|
||||||
|
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||||
|
border-radius: 15px;
|
||||||
|
padding: 40px;
|
||||||
|
width: 100%;
|
||||||
|
max-width: 400px;
|
||||||
|
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
|
||||||
|
animation: fadeIn 0.5s ease-in-out;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes fadeIn {
|
||||||
|
from { opacity: 0; transform: translateY(-20px); }
|
||||||
|
to { opacity: 1; transform: translateY(0); }
|
||||||
|
}
|
||||||
|
|
||||||
|
label {
|
||||||
|
display: block;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #b0b0b0;
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type="text"],
|
||||||
|
input[type="email"],
|
||||||
|
input[type="password"] {
|
||||||
|
width: 100%;
|
||||||
|
padding: 12px 15px;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
border: 1px solid rgba(255, 255, 255, 0.2);
|
||||||
|
border-radius: 8px;
|
||||||
|
background: rgba(255, 255, 255, 0.1);
|
||||||
|
color: #e0e0e0;
|
||||||
|
font-size: 16px;
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type="text"]:focus,
|
||||||
|
input[type="email"]:focus,
|
||||||
|
input[type="password"]:focus {
|
||||||
|
outline: none;
|
||||||
|
border-color: #00d4ff;
|
||||||
|
box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.2);
|
||||||
|
background: rgba(255, 255, 255, 0.15);
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type="submit"] {
|
||||||
|
width: 100%;
|
||||||
|
padding: 12px;
|
||||||
|
background: linear-gradient(45deg, #00d4ff, #0099cc);
|
||||||
|
color: white;
|
||||||
|
border: none;
|
||||||
|
border-radius: 8px;
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: 600;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
text-transform: uppercase;
|
||||||
|
letter-spacing: 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type="submit"]:hover {
|
||||||
|
background: linear-gradient(45deg, #0099cc, #0077aa);
|
||||||
|
transform: translateY(-2px);
|
||||||
|
box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Error Messages */
|
||||||
|
p[style*="color: red"] {
|
||||||
|
background: rgba(255, 0, 0, 0.1);
|
||||||
|
border: 1px solid rgba(255, 0, 0, 0.3);
|
||||||
|
border-radius: 5px;
|
||||||
|
padding: 10px;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
color: #ff6b6b !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
p[style*="color: green"] {
|
||||||
|
background: rgba(0, 255, 0, 0.1);
|
||||||
|
border: 1px solid rgba(0, 255, 0, 0.3);
|
||||||
|
border-radius: 5px;
|
||||||
|
padding: 10px;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
color: #51cf66 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Horizontal Rule */
|
||||||
|
hr {
|
||||||
|
border: none;
|
||||||
|
height: 2px;
|
||||||
|
background: linear-gradient(90deg, transparent, #00d4ff, transparent);
|
||||||
|
margin: 30px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Table Styles */
|
||||||
|
table {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 800px;
|
||||||
|
margin: 20px auto;
|
||||||
|
border-collapse: collapse;
|
||||||
|
background: rgba(255, 255, 255, 0.05);
|
||||||
|
backdrop-filter: blur(10px);
|
||||||
|
border-radius: 10px;
|
||||||
|
overflow: hidden;
|
||||||
|
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
|
||||||
|
}
|
||||||
|
|
||||||
|
thead {
|
||||||
|
background: linear-gradient(45deg, #00d4ff, #0099cc);
|
||||||
|
}
|
||||||
|
|
||||||
|
th, td {
|
||||||
|
padding: 15px;
|
||||||
|
text-align: left;
|
||||||
|
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
th {
|
||||||
|
font-weight: 600;
|
||||||
|
color: white;
|
||||||
|
text-transform: uppercase;
|
||||||
|
letter-spacing: 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
td {
|
||||||
|
color: #e0e0e0;
|
||||||
|
}
|
||||||
|
|
||||||
|
tbody tr:hover {
|
||||||
|
background: rgba(255, 255, 255, 0.05);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Responsive Design */
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
body {
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
form {
|
||||||
|
padding: 20px;
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
table {
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
th, td {
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user