generated from francesco/deploy-dinamico
Aggiunte pagine "actors" e "genres"
All checks were successful
Deploy / trigger (push) Successful in 2s
All checks were successful
Deploy / trigger (push) Successful in 2s
This commit is contained in:
99
file/actors/index.php
Normal file
99
file/actors/index.php
Normal 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>
|
||||
@@ -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
BIN
file/favicon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 141 KiB |
@@ -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
BIN
file/genere.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
100
file/genres/index.php
Normal file
100
file/genres/index.php
Normal 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>
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user