Aggiunte pagine "actors" e "genres"
All checks were successful
Deploy / trigger (push) Successful in 2s

This commit is contained in:
2026-04-12 21:08:28 +02:00
parent 7e82049d57
commit 8cd10b102b
10 changed files with 267 additions and 6 deletions

View File

@@ -3,7 +3,7 @@
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Creato il: Apr 12, 2026 alle 20:06
-- Creato il: Apr 12, 2026 alle 21:04
-- Versione del server: 10.4.32-MariaDB
-- Versione PHP: 8.2.12
@@ -64,9 +64,8 @@ INSERT INTO `attori` (`id_attore`, `nome`, `cognome`, `data_nascita`) VALUES
(23, 'Bud', 'Spencer', '1929-10-31'),
(24, 'Lady', 'Gaga', '1986-03-28'),
(25, 'Adam', 'Driver', '1983-11-19'),
(26, 'Francesco', 'Mancuso', '2007-02-08'),
(27, 'Massimo', 'Leone', '2026-04-01'),
(28, 'Tom', 'Cruise', '1962-07-03');
(26, 'Tom', 'Cruise', '1962-07-03'),
(27, 'Al', 'Pacino', '1940-04-25');
-- --------------------------------------------------------
@@ -183,7 +182,8 @@ INSERT INTO `recitare` (`id_attore`, `id_film`, `ruolo`) VALUES
(23, 15, 'Protagonista'),
(24, 16, 'Protagonista'),
(25, 16, 'Protagonista'),
(28, 20, 'Protagonista');
(26, 20, 'Protagonista'),
(27, 19, 'Protagonista');
--
-- Indici per le tabelle scaricate
@@ -223,7 +223,7 @@ ALTER TABLE `recitare`
-- AUTO_INCREMENT per la tabella `attori`
--
ALTER TABLE `attori`
MODIFY `id_attore` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=29;
MODIFY `id_attore` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=28;
--
-- AUTO_INCREMENT per la tabella `film`

99
file/actors/index.php Normal file
View File

@@ -0,0 +1,99 @@
<?php
if (isset($_GET['s'])) {
highlight_file("index.php");
return;
}
// Tutti gli attori
// Questi valori vengono letti automaticamente
$host = getenv('DB_HOST'); // Sarà "local_db"
$db = getenv('DB_NAME'); // Sarà "nomerepository-nomeutente"
$user = getenv('DB_USER'); // Uguale al nome DB
$pass = getenv('DB_PASS'); // Password generata casualmente ad ogni deploy
$charset = 'utf8mb4';
$dsn = "mysql:host=$host;dbname=$db;charset=$charset";
try {
$pdo = new PDO($dsn, $user, $pass);
} catch (\PDOException $e) {
throw new \PDOException($e->getMessage(), (int) $e->getCode());
}
// Collegamento al DB effettuato
$query = "SELECT * FROM attori";
$stmt = $pdo->prepare($query);
$stmt->execute();
?>
<!DOCTYPE html>
<html lang="it">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Attori - The NoSpace Cinema</title>
<!--- www.francescomancuso.it -->
<link rel="stylesheet" href="../style.css">
<link rel="icon" href="../favicon.png">
</head>
<body>
<header>
<div class="container">
<a href="../" style="text-decoration: none;">
<div>
<img src="../logo.png">
<h4>The NoSpace Cinema</h4>
</div>
</a>
<div>
<a href=".?s" style="font-size:16px">Vedi sorgente pagina</a>
<a href="../search/" class="button">Tutti i film</a>
</div>
</div>
</header>
<div class="container">
<div class="hero">
<div>
<h1>Tutti gli attori</h1>
</div>
</div>
</div>
<div class="page">
<div class="container">
<div class="grid films">
<?php
$test = true;
while ($row = $stmt->fetch()) {
$test = false;
?>
<div class="attore">
<img src="../attore-list.png">
<h5><?php echo $row['nome']; ?> <?php echo $row['cognome']; ?></h5>
<span>Nato/a il <?php echo date("d M Y", strtotime($row['data_nascita'])); ?></span>
</div>
<?php
}
?>
</div>
<?php
// Nessun risultato...
if ($test) {
echo "<div class=\"container\">Nessun attore trovato!</div>";
}
?>
</div>
</div>
<footer>
<div class="container">
<span>Realizzato da Francesco Giuseppe Mancuso - classe 5E - www.francescomancuso.it</span>
</div>
</footer>
</body>
</html>

View File

@@ -88,6 +88,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
<title>Aggiungi attore - The NoSpace Cinema</title>
<!--- www.francescomancuso.it -->
<link rel="stylesheet" href="../style.css">
<link rel="icon" href="../favicon.png">
</head>
<body>

BIN
file/favicon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 141 KiB

View File

@@ -76,6 +76,7 @@ $stmt->execute([
<title><?php echo $row["nome"]; ?> - Film - The NoSpace Cinema</title>
<!--- www.francescomancuso.it -->
<link rel="stylesheet" href="../style.css">
<link rel="icon" href="../favicon.png">
</head>
<body>

BIN
file/genere.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

100
file/genres/index.php Normal file
View File

@@ -0,0 +1,100 @@
<?php
if (isset($_GET['s'])) {
highlight_file("index.php");
return;
}
// Tutti i generi
// Questi valori vengono letti automaticamente
$host = getenv('DB_HOST'); // Sarà "local_db"
$db = getenv('DB_NAME'); // Sarà "nomerepository-nomeutente"
$user = getenv('DB_USER'); // Uguale al nome DB
$pass = getenv('DB_PASS'); // Password generata casualmente ad ogni deploy
$charset = 'utf8mb4';
$dsn = "mysql:host=$host;dbname=$db;charset=$charset";
try {
$pdo = new PDO($dsn, $user, $pass);
} catch (\PDOException $e) {
throw new \PDOException($e->getMessage(), (int) $e->getCode());
}
// Collegamento al DB effettuato
$query = "SELECT * FROM generi";
$stmt = $pdo->prepare($query);
$stmt->execute();
?>
<!DOCTYPE html>
<html lang="it">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Generi - The NoSpace Cinema</title>
<!--- www.francescomancuso.it -->
<link rel="stylesheet" href="../style.css">
<link rel="icon" href="../favicon.png">
<link rel="icon" href="../favicon.png">
</head>
<body>
<header>
<div class="container">
<a href="../" style="text-decoration: none;">
<div>
<img src="../logo.png">
<h4>The NoSpace Cinema</h4>
</div>
</a>
<div>
<a href=".?s" style="font-size:16px">Vedi sorgente pagina</a>
<a href="../search/" class="button">Tutti i film</a>
</div>
</div>
</header>
<div class="container">
<div class="hero">
<div>
<h1>Tutti i generi</h1>
</div>
</div>
</div>
<div class="page">
<div class="container">
<div class="grid genres">
<?php
$test = true;
while ($row = $stmt->fetch()) {
$test = false;
?>
<div class="genre">
<img src="../genere.png">
<h5><?php echo $row['nome']; ?></h5>
<span><?php echo $row['descrizione']; ?></span>
</div>
<?php
}
?>
</div>
<?php
// Nessun risultato...
if ($test) {
echo "<div class=\"container\">Nessun genere trovato!</div>";
}
?>
</div>
</div>
<footer>
<div class="container">
<span>Realizzato da Francesco Giuseppe Mancuso - classe 5E - www.francescomancuso.it</span>
</div>
</footer>
</body>
</html>

View File

@@ -7,6 +7,7 @@
<title>The NoSpace Cinema</title>
<!--- www.francescomancuso.it -->
<link rel="stylesheet" href="style.css">
<link rel="icon" href="favicon.png">
</head>
<body>
@@ -47,6 +48,20 @@
</div>
</a>
</div>
<div class="grid" style="margin-top: 2rem;">
<a href="actors/">
<div class="card">
<img src="attore-list.png">
<h2>Vedi tutti gli attori</h2>
</div>
</a>
<a href="genres/">
<div class="card">
<img src="genere.png">
<h2>Vedi tutti i generi</h2>
</div>
</a>
</div>
</div>
</div>
<footer>

View File

@@ -52,6 +52,7 @@ $stmt->execute($params);
<title>Film - The NoSpace Cinema</title>
<!--- www.francescomancuso.it -->
<link rel="stylesheet" href="../style.css">
<link rel="icon" href="../favicon.png">
</head>
<body>

View File

@@ -354,4 +354,48 @@ footer .container {
padding: 0.2rem 0;
margin: 1rem 0;
font-size: 80%;
}
.genres {
grid-template-columns: 1fr 1fr 1fr;
}
@media only screen and (max-width: 899px) {
.genres {
grid-template-columns: 1fr 1fr;
}
}
@media only screen and (max-width: 599px) {
.genres {
grid-template-columns: 1fr;
}
}
.genres .genre {
width: 100%;
text-align: center;
padding: 2rem 0;
}
.genres .genre img {
width: 100px;
height: 100px;
object-fit: contain;
display: block;
margin: 0 auto;
margin-bottom: 2rem;
}
.genres .genre h5 {
font-size: 1.67rem;
margin: 1rem 0;
}
.genres .genre span {
display: block;
margin: 0 auto;
font-size: 90%;
opacity: 0.9;
}