1
0
Fork 0
This repository has been archived on 2024-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
PHP_TP4/views/v_accueil.php

35 lines
1.1 KiB
PHP
Raw Permalink Normal View History

2020-10-16 10:23:24 +02:00
<?php
// En tête de page
?>
<?php require_once(PATH_VIEWS.'header.php');?>
<!-- Zone message d'alerte -->
<?php require_once(PATH_VIEWS.'alert.php');?>
<!-- Début de la page -->
2020-10-27 22:23:11 +01:00
<?php if (isset($categories) and $categories) { ?>
<form>
<label for="category"><?= CATEGORY_SELECT ?></label>
<select id="category" name="category">
<option value="0"><?= ALL_PHOTOS ?></option>
<?php foreach ($categories as $cat) { ?>
<option value="<?= $cat["catId"] ?>" <?= $cat["catId"] == $category ? "selected" : "" ?>><?= $cat["nomCat"] ?></option>
<?php } ?>
</select>
<input type="submit">
</form>
<?php } ?>
2020-10-16 10:23:24 +02:00
<h1><?= TITRE_PAGE_ACCUEIL_TOUS ?></h1>
2020-10-27 22:23:11 +01:00
<?php if(isset($photos) and $photos) { ?>
<?php foreach ($photos as $photo) {?>
2020-10-27 21:58:56 +01:00
<a href="index.php?page=photo&id=<?= $photo["photoId"] ?>"><img src="<?= PATH_IMAGES ?>/<?= $photo['nomFich'] ?>" alt="<?= $photo['description'] ?>"></a>
2020-10-16 11:57:47 +02:00
<?php }
} ?>
2020-10-16 10:23:24 +02:00
<!-- Fin de la page -->
<!-- Pied de page -->
<?php require_once(PATH_VIEWS.'footer.php');