Commit iniziale build non versionata

This commit is contained in:
2026-02-18 11:35:26 +01:00
commit 9b5fe68262
3 changed files with 241 additions and 0 deletions

15
db_conf.php Normal file
View File

@@ -0,0 +1,15 @@
<?php
$host = "127.0.0.1";
$username = "root";
$password = "ehhhvoleviii";
$database = "Northwind";
// Connessione al database
$conn = mysqli_connect($host, $username, $password, $database);
if(!$conn) {
die("Connessione fallita: " . mysqli_connect_error());
}
// echo "Connessione riuscita!<br>";
?>

54
index.php Normal file
View File

@@ -0,0 +1,54 @@
<?php
require_once "db_conf.php";
//Esempio query
$sql = "SELECT CategoryID,CategoryName,Description FROM Categories";
$result = mysqli_query($conn, $sql);
$id = $_GET["Selezione"]
?>
<!DOCTYPE html>
<head>
<meta charset="UTF-8">
<title>Document</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<form id="formCategorie">
<select name='Selezione' id='category'>
<?php
if ($result){
while($row = mysqli_fetch_assoc($result)){
echo "<option value='" . $row["CategoryID"] . "'>" . $row["CategoryName"] . "</option>";
}
}
?>
</select>
<input type=submit value="Cerca">
</form>
<br>
<?php
if ($result){
$queryProdotti = "SELECT ProductID, ProductName, CategoryID, Unit, Price FROM Products";
$result = mysqli_query($conn, $queryProdotti);
echo "<table><tr><th>ID</th><th>Name</th><th>Unit</th><th>Price</th></tr>";
while($row = mysqli_fetch_assoc($result)){
if($row["CategoryID"] == $id){
echo "<tr>";
echo "<td>" . $row["ProductID"] . "</td>";
echo "<td>" . $row["ProductName"] . "</td>";
echo "<td>" . $row["Unit"] . "</td>";
echo "<td>" . $row["Price"] . "</td>";
echo "</tr>";
}
}
echo "</table>";
}
else{
echo "Errore nella query: " . mysqli_error($conn);
}
?>
</body>
</html>

172
style.css Normal file
View File

@@ -0,0 +1,172 @@
/* ==========================================================================
1. VARIABILI E COLORI (Design Tokens 2026)
========================================================================== */
:root {
/* Palette 2026: Basata su "Cloud Dancer" (bianco caldo) e accenti vibranti */
--bg-page: #f9f9fb; /* Sfondo chiaro e riposante */
--text-main: #1a1a1c; /* Testo quasi nero per massimo contrasto */
--text-muted: #64748b; /* Testo secondario */
--primary: #2563eb; /* Blu moderno e saturo */
--primary-hover: #1d4ed8;
--accent: #f59e0b; /* Ambra per richiamare l'attenzione */
/* Colori per i Form */
--input-bg: #ffffff;
--input-border: #e2e8f0;
--input-focus: #3b82f6;
--error: #ef4444;
--success: #10b981;
/* Spaziature e Bordi */
--radius: 12px;
--shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
--shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
}
/* Modalità Notte Automatica */
@media (prefers-color-scheme: dark) {
:root {
--bg-page: #0f172a;
--text-main: #f8fafc;
--text-muted: #94a3b8;
--input-bg: #1e293b;
--input-border: #334155;
}
}
/* ==========================================================================
2. TIPOGRAFIA E TESTO NELLA PAGINA
========================================================================== */
body {
font-family: 'Inter', system-ui, -apple-system, sans-serif;
background-color: var(--bg-page);
color: var(--text-main);
line-height: 1.6;
/* Tipografia fluida: scala tra 16px e 18px in base alla finestra */
font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
margin: 0;
padding: 2rem;
}
p {
margin-bottom: 1.5rem;
max-width: 70ch; /* Limita la larghezza per una lettura ottimale */
}
/* ==========================================================================
3. TITOLI (H1, H2, H3)
========================================================================== */
h1, h2, h3 {
margin-top: 2.5rem;
margin-bottom: 1rem;
font-weight: 800;
line-height: 1.2;
color: var(--primary);
}
h1 { font-size: clamp(2rem, 5vw, 3.5rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 4vw, 2.25rem); color: var(--text-main); }
h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); border-left: 4px solid var(--accent); padding-left: 1rem; }
/* ==========================================================================
4. FORM E INPUT (Stile Moderno)
========================================================================== */
form {
display: flex;
flex-direction: column;
gap: 1.5rem;
max-width: 500px;
background: var(--input-bg);
padding: 2rem;
border-radius: var(--radius);
box-shadow: var(--shadow-md);
}
.form-group {
display: flex;
flex-direction: column;
gap: 0.5rem;
}
label {
font-weight: 600;
font-size: 0.9rem;
}
input, textarea, select {
padding: 0.75rem 1rem;
border: 2px solid var(--input-border);
border-radius: 8px;
background-color: var(--input-bg);
color: var(--text-main);
transition: all 0.2s ease;
font-size: 1rem;
}
input:focus {
outline: none;
border-color: var(--input-focus);
box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}
/* Feedback validazione nativa senza JS */
input:invalid:not(:placeholder-shown) { border-color: var(--error); }
input:valid:not(:placeholder-shown) { border-color: var(--success); }
button {
background-color: var(--primary);
color: white;
padding: 0.8rem 1.5rem;
border: none;
border-radius: 8px;
font-weight: 700;
cursor: pointer;
transition: background 0.3s ease;
}
button:hover { background-color: var(--primary-hover); }
/* ==========================================================================
5. TABELLE (Stile Minimalista Bento)
========================================================================== */
.table-container {
overflow-x: auto; /* Rende la tabella scrollabile su mobile */
margin: 2rem 0;
border-radius: var(--radius);
box-shadow: var(--shadow-sm);
}
table {
width: 100%;
border-collapse: collapse;
background: var(--input-bg);
text-align: left;
}
th, td {
padding: 1rem 1.5rem;
border-bottom: 1px solid var(--input-border);
}
th {
background-color: var(--primary);
color: white;
font-weight: 600;
text-transform: uppercase;
font-size: 0.8rem;
letter-spacing: 0.05em;
position: sticky; /* Header fisso allo scroll */
top: 0;
}
tr:last-child td { border-bottom: none; }
/* Effetto riga al passaggio del mouse */
tr:hover td {
background-color: rgba(37, 99, 235, 0.05);
}
@media (max-width: 600px) {
th, td { padding: 0.75rem; font-size: 0.9rem; }
}