8 Commits

Author SHA1 Message Date
e2f913a543 Téléverser les fichiers vers "/" 2025-10-13 18:01:39 +00:00
257657a630 Supprimer php 2025-10-13 18:00:17 +00:00
c84a9d2e6a Supprimer TRAVAIL PHP PAS COMPRIS 2025-10-13 18:00:06 +00:00
872124b5e6 Ajouter TRAVAIL PHP PAS COMPRIS 2025-10-13 17:59:54 +00:00
a76196950f Ajouter php 2025-10-13 17:58:33 +00:00
74e1bffa27 Actualiser DevoirSqlFahym.sql 2025-10-13 11:43:50 +00:00
e82de84656 Téléverser les fichiers vers "/" 2025-10-13 11:37:56 +00:00
8e50a9ef53 leekwars
Signed-off-by: fahym.bouaichi <fahym.bouaichi@lasallesaintdenis.com>
2025-09-29 15:09:30 +00:00
4 changed files with 115 additions and 0 deletions

33
DevoirSqlFahym.sql Normal file
View File

@@ -0,0 +1,33 @@
INSERT INTO Auteurs (nom, prenom) VALUES ('Dumas', 'Alexandre');
INSERT INTO Auteurs (nom, prenom) VALUES ('JK', 'Rowling');
INSERT INTO Livres (titre, annee_publication, auteur_id ) VALUES ('Les Trois Mousquetais', 1844, 15);
INSERT INTO Livres (titre, annee_publication, auteur_id ) VALUES ('Jack et la grande aventure du cochon de Noël', 2020, 3);
#exo2
SELECT * FROM Livres WHERE annee_publication < 1900;
SELECT * FROM Auteurs WHERE prenom = 'Victor';
SELECT * FROM Livres WHERE titre LIKE '%PARIS%';
#exo3
DELETE FROM Livres WHERE titre = 'NotreDame de Paris';
SELECT * FROM Livres WHERE titre = 'NotrEDame de Paris';
#exo4
SELECT * FROM Livres WHERE nom = 'Hugo';
SELECT * FROM Livres WHERE annee_publication < 1900 AND nom = 'Hugo';
SELECT nom,titre FROM Auteur INNER JOIN Livre ON auteur_id = livre_id ;
SELECT nom,titre FROM Auteur INNER JOIN Livre ON auteur_id = livre_id WHERE annee_publi > 1900;

9
Dockerfile Normal file
View File

@@ -0,0 +1,9 @@
FROM php:8.2-apache
LABEL authors="Fahym"
COPY . /var/www/html
WORKDIR /var/www/html
RUN docker-php-ext-install pdo pdo_mysql
EXPOSE 80

16
PDO.php Normal file
View File

@@ -0,0 +1,16 @@
<?php
$HOST = "SQL";
$db = "bibliotheque";
$user = "root";
$pass = "123456";
$charset = "utf8mb4";
$dsn = "mysql:host=$HOST;dbname=$db;charset=$charset";
try {
$pdo = new PDO($dsn, $user, $pass);
$GLOBALS['BddIsConnected'] = true;
} catch (PDOException $e) {
$GLOBALS['BddIsConnected'] = false;
echo "<script>console.log('Error PDD : " . $e->getMessage() , "');</script>";
}

57
index.php Normal file
View File

@@ -0,0 +1,57 @@
<!DOCTYPE html>
<html lang="fr">
<head>
<title>Ma super bibliothèque</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">-->
<!-- <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>-->
<!-- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">-->
<!-- <link href="style.css" rel="stylesheet" type="text/css">-->
</head>
<body>
<?php include("sql/pdo.php"); ?>
<header class="main-content">
<H1>Bibliothèque</H1>
<ul class="nav nav-tabs">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="/">Accueil</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/">Ajouter un livre</a>
</li>
</ul>
</header>
<main class="main-content">
<?php include("view/view_books.php"); ?>
</main>
<footer class="fixed-bottom d-flex flex-wrap justify-content-between align-items-center py-3 my-4 border-top p-4">
<div>
<i class="bi bi-c-circle"></i> 2025 - LM I-Manager
</div>
<div>
Version : 1.0.0
</div>
<div class="d-flex align-items-center d-flex-row">
Connexion BDD :
<?php
if ($GLOBALS['BddIsConnected']) {
echo "<p class='m-1' style='color:green;'>✅</p>";
} else {
echo "<p class='m-1' style='color:red;'>❌</p>";
}
?>
</div>
</footer>
</body>
</html>