From 5281043af6c0b81b36d41c5036ecec62804b8171 Mon Sep 17 00:00:00 2001
From: Andrea Fiorencis
Date: Tue, 14 Apr 2026 08:45:15 +0200
Subject: [PATCH 01/11] Aggiunta file db_conf
---
db_conf.php | 14 ++++++++++++++
1 file changed, 14 insertions(+)
create mode 100644 db_conf.php
diff --git a/db_conf.php b/db_conf.php
new file mode 100644
index 0000000..3b9b3de
--- /dev/null
+++ b/db_conf.php
@@ -0,0 +1,14 @@
+connect_error) {
+ die("Connessione fallita: " . $conn->connect_error);
+}
+?>
From 7e51bf1271ea8f98210f476823bebdd528ccfef4 Mon Sep 17 00:00:00 2001
From: Andrea Fiorencis
Date: Tue, 14 Apr 2026 09:12:05 +0200
Subject: [PATCH 02/11] Implementazione pagina login
---
login.php | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 63 insertions(+)
create mode 100644 login.php
diff --git a/login.php b/login.php
new file mode 100644
index 0000000..7de849c
--- /dev/null
+++ b/login.php
@@ -0,0 +1,63 @@
+
+
+
+
+
+ Accesso
+
+
+
+ prepare($sql)) {
+ $stmt->bind_param("s", $email);
+ $stmt->execute();
+ $stmt->store_result();
+
+ if ($stmt->num_rows > 0) {
+ $stmt->bind_result($user_id, $name, $surname, $hashed_password);
+ $stmt->fetch();
+
+ if (password_verify($password, $hashed_password)) {
+ $_SESSION['id'] = $user_id;
+ $_SESSION['name'] = $name;
+ $_SESSION['surname'] = $surname;
+ header('Location: index.php');
+ exit();
+ } else {
+ $error = 'Credenziali errate.';
+ }
+ } else {
+ $error = 'Credenziali errate.';
+ }
+
+ $stmt->close();
+ } else {
+ $error = 'Errore nel database.';
+ }
+ }
+ ?>
+
+
+
\ No newline at end of file
From 9f1565abef92ad59254fb2819488fb13079504f7 Mon Sep 17 00:00:00 2001
From: Andrea Fiorencis
Date: Tue, 14 Apr 2026 09:26:47 +0200
Subject: [PATCH 03/11] Implementazione registrazione e ruolo utente
---
assets/Gener_Z.sql | 9 ++++----
register.php | 55 ++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 60 insertions(+), 4 deletions(-)
create mode 100644 register.php
diff --git a/assets/Gener_Z.sql b/assets/Gener_Z.sql
index a4804e4..6deac24 100644
--- a/assets/Gener_Z.sql
+++ b/assets/Gener_Z.sql
@@ -36,7 +36,8 @@ CREATE TABLE Utenti(
nome VARCHAR(30),
cognome VARCHAR(18),
email VARCHAR(255) UNIQUE NOT NULL,
- password VARCHAR(255) NOT NULL
+ password VARCHAR(255) NOT NULL,
+ ruolo VARCHAR(16) DEFAULT 'utente'
);
-- 3. INSERIMENTO DATI (INSERT INTO)
@@ -78,6 +79,6 @@ INSERT INTO Statistiche_Social (id_fascia, piattaforma, minuti_medi_giornalieri,
-- Login utente esempio
-- Email: jeevacation@gmail.com
-- Password: changeme
-INSERT INTO Utenti(nome,cognome,email,password) VALUES
-('Jeffrey', 'Epstein', 'jeevacation@gmail.com', '$2y$10$1ZILQ71xxMjaAxDs2A6/Iut8UJfBPEGkeEuZgoIkVDapbNYUACxtW'),
-('Andrea', 'Fiorencis', 'andrea@fiorencis.eu','$2y$10$y7fs8u4UOFJW5ds/dO84KumTxG2kh4jCubb1W0mAHzgmBZKRqA8Va');
\ No newline at end of file
+INSERT INTO Utenti(nome,cognome,email,password,ruolo) VALUES
+('Jeffrey', 'Epstein', 'jeevacation@gmail.com', '$2y$10$1ZILQ71xxMjaAxDs2A6/Iut8UJfBPEGkeEuZgoIkVDapbNYUACxtW', 'gestore'),
+('Andrea', 'Fiorencis', 'andrea@fiorencis.eu','$2y$10$y7fs8u4UOFJW5ds/dO84KumTxG2kh4jCubb1W0mAHzgmBZKRqA8Va', 'gestore');
\ No newline at end of file
diff --git a/register.php b/register.php
new file mode 100644
index 0000000..185e03e
--- /dev/null
+++ b/register.php
@@ -0,0 +1,55 @@
+
+
+
+
+
+
+
+ Registrazione - TechStore
+
+
+
+ Le password non corrispondono.
";
+ }
+ else{
+ $sql = "INSERT INTO Utenti (nome, cognome, email, password) VALUES (?, ?, ?, ?)";
+ if($stmt = $conn->prepare($sql)){
+ $stmt->bind_param("ssss", $name, $surname, $email, $password);
+
+ $name = $_POST['name'];
+ $surname = $_POST['surname'];
+ $email = $_POST['email'];
+ $password = password_hash($_POST['password'], PASSWORD_BCRYPT);
+ $stmt->execute();
+
+ echo "Registrazione avvenuta con successo! Accedi
";
+ }
+ else{
+ echo "Errore: " . $conn->error;
+ }
+ }
+ }
+ ?>
+
+
+
+
From e57c21386d1cd0d2df1be2626d491af6a7a75507 Mon Sep 17 00:00:00 2001
From: Andrea Fiorencis
Date: Tue, 14 Apr 2026 09:29:30 +0200
Subject: [PATCH 04/11] Creazione pagina index con query di interrogazione
statistiche
---
index.php | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
create mode 100644 index.php
diff --git a/index.php b/index.php
new file mode 100644
index 0000000..40355a3
--- /dev/null
+++ b/index.php
@@ -0,0 +1,32 @@
+query($sql);
+
+// Interruzione in caso di errore nella richiesta
+if ($resultDispositivi === false){
+ 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);
+}
+?>
+
+
+
+
+
+ Document
+
+
+
+
\ No newline at end of file
From 1ee47f62e656bd04ccb207650f22a2bb25df795a Mon Sep 17 00:00:00 2001
From: Andrea Fiorencis
Date: Fri, 17 Apr 2026 11:10:28 +0200
Subject: [PATCH 05/11] Fix query SQL non funzionanti in index
---
index.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/index.php b/index.php
index 40355a3..417bd73 100644
--- a/index.php
+++ b/index.php
@@ -3,7 +3,7 @@ session_start();
include 'db_conf.php';
//Query per ottenere le statistiche dei dispositivi
-$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 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";
$resultDispositivi = $conn->query($sql);
// Interruzione in caso di errore nella richiesta
@@ -12,7 +12,7 @@ if ($resultDispositivi === false){
}
//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";
+$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
From 461a1f48539af06619af4ec4e8166c22b7bccc1f Mon Sep 17 00:00:00 2001
From: Andrea Fiorencis
Date: Fri, 17 Apr 2026 11:25:58 +0200
Subject: [PATCH 06/11] Fix query + visualizzazione dati su pagina
---
index.php | 45 +++++++++++++++++++++++++++++++++------------
1 file changed, 33 insertions(+), 12 deletions(-)
diff --git a/index.php b/index.php
index 417bd73..c17a03c 100644
--- a/index.php
+++ b/index.php
@@ -1,32 +1,53 @@
+
query($sql);
// Interruzione in caso di errore nella richiesta
if ($resultDispositivi === false){
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);
-}
?>
- Document
+ GenZ Digital Hub
+
+ Benvenuto, !
+ Logout
+
+ Tempo Totale di Utilizzo Giornaliero per Fascia d'Età
+
+
+
+ | Fascia d'Età |
+ Ore Totali Giornaliere |
+
+
+
+ fetch_assoc()): ?>
+
+ |
+ ore |
+
+
+
+
+
+ Benvenuto su GenZ Digital Hub
+ Accedi o Registrati per visualizzare le statistiche.
+
\ No newline at end of file
From b68b7f2824018b9c34799810d53eaa65ddbe8719 Mon Sep 17 00:00:00 2001
From: Andrea Fiorencis
Date: Fri, 17 Apr 2026 11:35:11 +0200
Subject: [PATCH 07/11] Creazione stylesheet (totalmente vibecoded :skull:)
---
index.php | 1 +
login.php | 2 +-
register.php | 2 +-
3 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/index.php b/index.php
index c17a03c..e826e96 100644
--- a/index.php
+++ b/index.php
@@ -22,6 +22,7 @@ if ($resultDispositivi === false){
GenZ Digital Hub
+
diff --git a/login.php b/login.php
index 7de849c..4fc5c36 100644
--- a/login.php
+++ b/login.php
@@ -4,7 +4,7 @@
Accesso
-
+
Registrazione - TechStore
-
+
Date: Fri, 17 Apr 2026 11:35:22 +0200
Subject: [PATCH 08/11] Implementazione logout
---
logout.php | 6 ++++++
1 file changed, 6 insertions(+)
create mode 100644 logout.php
diff --git a/logout.php b/logout.php
new file mode 100644
index 0000000..2ac2507
--- /dev/null
+++ b/logout.php
@@ -0,0 +1,6 @@
+
\ No newline at end of file
From bbffb741a46bbf6253afed01f15c2cc1bd030408 Mon Sep 17 00:00:00 2001
From: Andrea Fiorencis
Date: Fri, 17 Apr 2026 11:35:55 +0200
Subject: [PATCH 09/11] Aggiunta file stylesheet (me lo ero dimenticato di
aggiungerlo nell'altro commit :skull:)
---
style.css | 200 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 200 insertions(+)
create mode 100644 style.css
diff --git a/style.css b/style.css
new file mode 100644
index 0000000..e7f211a
--- /dev/null
+++ b/style.css
@@ -0,0 +1,200 @@
+* {
+ 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: 30px;
+}
+
+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;
+}
+
+/* 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;
+ }
+}
\ No newline at end of file
From 31602977b7440e8822bc0d0c0d7eae34458bc9e1 Mon Sep 17 00:00:00 2001
From: Andrea Fiorencis
Date: Fri, 17 Apr 2026 11:42:29 +0200
Subject: [PATCH 10/11] Fix spacing link nelle pagine di autenticazione
---
login.php | 1 +
register.php | 1 +
2 files changed, 2 insertions(+)
diff --git a/login.php b/login.php
index 4fc5c36..255845a 100644
--- a/login.php
+++ b/login.php
@@ -57,6 +57,7 @@
+
Non hai un account? Registrati
diff --git a/register.php b/register.php
index 9414e6a..fcb9ed4 100644
--- a/register.php
+++ b/register.php
@@ -49,6 +49,7 @@
+
Hai già un account? Accedi