commit 5dc2ac79227f3e5b0d76407826f9a31d3079e996 Author: Sergio-Bianchi Date: Fri Oct 17 09:33:37 2025 +0200 First commit diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/PHP_Esercizio1.iml b/.idea/PHP_Esercizio1.iml new file mode 100644 index 0000000..c956989 --- /dev/null +++ b/.idea/PHP_Esercizio1.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/discord.xml b/.idea/discord.xml new file mode 100644 index 0000000..30bab2a --- /dev/null +++ b/.idea/discord.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..186d49a --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,21 @@ + + + + \ No newline at end of file diff --git a/.idea/laravel-idea.xml b/.idea/laravel-idea.xml new file mode 100644 index 0000000..bd941a4 --- /dev/null +++ b/.idea/laravel-idea.xml @@ -0,0 +1,8 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..f374bff --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/php.xml b/.idea/php.xml new file mode 100644 index 0000000..2e7d504 --- /dev/null +++ b/.idea/php.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..8fc4f8a --- /dev/null +++ b/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "ext-mysqli": "*" + } +} \ No newline at end of file diff --git a/config/database-connection.php b/config/database-connection.php new file mode 100644 index 0000000..dc76c3f --- /dev/null +++ b/config/database-connection.php @@ -0,0 +1,7 @@ +num_rows > 0) { + $_SESSION['username'] = $data['username']; + $_SESSION['password'] = $data['password']; + header('Location: http://localhost:8080/index.php/'); + } else { + $login_error = "Username o password errati"; + $_SESSION['login_error'] = $login_error; + header('Location: http://localhost:8080/form.php/'); + } + exit(); + } +} +?> + + + + + + Login + + +

LOGIN

+ +
+ + + +
+ + + + diff --git a/index.php b/index.php new file mode 100644 index 0000000..4996281 --- /dev/null +++ b/index.php @@ -0,0 +1,72 @@ +num_rows == 1) { + header('Location: http://localhost:8080/form.php/'); +} + + +?> + + + + + + +

Tabella Utenti

+"; +echo " ID DESCRIZIONE DATA_CREAZIONE ID_PERSONA "; +while ($row = mysqli_fetch_assoc($result)) { + echo "" . + "" . $row["ID"] . "" . + "" . $row["DESCRIZIONE"] . "" . + "" . $row["DATA_CREAZIONE"] . "" . + "" . $row["ID_PERSONA"] . "" . + " "; +} +echo ""; +?> + + + + diff --git a/search.php b/search.php new file mode 100644 index 0000000..3f83d48 --- /dev/null +++ b/search.php @@ -0,0 +1,70 @@ + + + + + + Cerca + + + + +

Cerca

+"; + +if (empty($username)) { + echo $formRicerca; +} else { + $result = Search::searchByUsername($username); + if ($result->num_rows == 0) { + echo "Utente " . $username . " non trovato"; + echo $formRicerca; + } else { + $data = $result->fetch_assoc(); + echo " + + + " . + "" . + "" . + "" . + "" . + "" . + " +
" . $data["ID"] . "" . $data["NOME"] . "" . $data["COGNOME"] . "" . $data["DATA_NASCITA"] . "" . $data["LUOGO_NASCITA"] . "" . $data["CF"] . "
+ "; + } + +} +?> + + + + diff --git a/services/Access.php b/services/Access.php new file mode 100644 index 0000000..715bcb6 --- /dev/null +++ b/services/Access.php @@ -0,0 +1,14 @@ +query($query); + } +} \ No newline at end of file diff --git a/services/Search.php b/services/Search.php new file mode 100644 index 0000000..a78360a --- /dev/null +++ b/services/Search.php @@ -0,0 +1,17 @@ +query($query); + } + +} \ No newline at end of file