Sélectionner une révision Git
index.php 2,21 Kio
<?php
require '../vendor/autoload.php';
include './utils/content.php';
include './utils/requestUtils.php';
session_start();
//postgres
$dbName = getenv('DB_NAME');
$dbUser = getenv('DB_USER');
$dbPassword = getenv('DB_PASSWORD');
$connection = new PDO("pgsql:host=postgres user=$dbUser dbname=$dbName password=$dbPassword");
//repositories
$userRepository = new \User\UserRepository($connection);
$test2 = new \Review\ReviewRepository($connection);
$test3 = new \CoupDeCoeur\CoupDeCoeurRepository($connection);
$test1 = new \Photo\PhotoRepository($connection);
$liste = $userRepository->fetchAll();
$data_url_image_of_the_day = 'https://api.nasa.gov/planetary/apod?api_key=CBR6hv51WhLbBrGISiDXibh5Upw7olOrijlVd2AB';
$imageDataArray = retrieveJsonFromUrl($data_url_image_of_the_day);
urlHasArgument();
?>
<html>
<?php
generateHeader('Pimaza');
generateUserBanner();
?>
<body style="text-align: center;
background-image:url('./ressources/background/test2.jpeg');
background-repeat: no-repeat;
background-attachment:fixed; "
>
<!-- génération de la bannière de connexion (voir content.php) -->
<?php
generateNavBar('index');
?>
<!-- test d'affichage de l'image du jour -->
<h1 class="titre" > Bienvenue sur Pimasa, le site repertoriant les images de la NASA </h1>
<div class="debug" style="display: none">
<?php var_dump($imageDataArray);
echo $imageDataArray->{'hdurl'};
?>
</div>
<div class="hover-container" style="width:70%">
<img style="box-shadow: 2px 3px 4px rgba(0, 0, 0, .5);" class="img-fluid" src=<?php echo $imageDataArray->{'hdurl'} ?>>
<div class="content">
<div class="text" style="font-size:large;">
<h3 style="font-weight: bold"><?php echo $imageDataArray->{'title'}?></h3>
<?php echo $imageDataArray->{'explanation'}?>
</div>
</div>
</div>
<!-- </div> -->
</body>
<!--fin test image du jour-->
</div>
<?php generateFooter(); ?>
</body>
</html>