affiche la date inscrite sur la page
This commit is contained in:
parent
c8bae4ae82
commit
e384f074e2
File diff suppressed because one or more lines are too long
23
core.php
23
core.php
@ -136,3 +136,26 @@ function geocode($cities)
|
|||||||
|
|
||||||
return $citiesData;
|
return $citiesData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getDatejour($jour) {
|
||||||
|
|
||||||
|
// URL de la page à analyser
|
||||||
|
$url = 'https://www.sabradou.com/' . $jour;
|
||||||
|
|
||||||
|
// Récupération du contenu de la page
|
||||||
|
$html = file_get_contents($url);
|
||||||
|
|
||||||
|
// Création d'un objet DOMDocument
|
||||||
|
$dom = new DOMDocument();
|
||||||
|
libxml_use_internal_errors(true); // Ignore les erreurs de parsing HTML
|
||||||
|
$dom->loadHTML($html);
|
||||||
|
libxml_clear_errors();
|
||||||
|
|
||||||
|
// Recherche du <h2> avec l'id "datejour"
|
||||||
|
$datejourH2 = $dom->getElementById('datejour');
|
||||||
|
|
||||||
|
// Extraire la date du contenu du <h2>
|
||||||
|
$datejour = trim($datejourH2->nodeValue);
|
||||||
|
|
||||||
|
return $datejour;
|
||||||
|
}
|
||||||
|
@ -17,11 +17,12 @@
|
|||||||
<h2>SUR LE SITE <a href="https://www.sabradou.com/" target="_blank">SABRADOU.COM</a></h2>
|
<h2>SUR LE SITE <a href="https://www.sabradou.com/" target="_blank">SABRADOU.COM</a></h2>
|
||||||
<form if="form" action="index.php" method="GET">
|
<form if="form" action="index.php" method="GET">
|
||||||
<label for="calendrier">Brocantes du :</label>
|
<label for="calendrier">Brocantes du :</label>
|
||||||
<select name="calendrier"onchange="this.form.submit();" id="calendrier-list">
|
<select name="calendrier" onchange="this.form.submit();" id="calendrier-list">
|
||||||
<?php $calendrier = getCalendrier(); ?>
|
<?php $calendrier = getCalendrier(); ?>
|
||||||
<?php foreach ($calendrier as $item): ?>
|
<?php foreach ($calendrier as $item): ?>
|
||||||
<?php $selected = isset($_GET['calendrier']) && $_GET['calendrier'] === $item['url'] ? 'selected' : ''; ?>
|
<?php $selected = isset($_GET['calendrier']) && $_GET['calendrier'] === $item['url'] ? 'selected' : ''; ?>
|
||||||
<option value="<?php echo $item['url']; ?>" <?php echo $selected; ?>><?php echo $item['node']; ?></option>
|
<option value="<?php echo $item['url']; ?>" <?php echo $selected; ?>><?php echo $item['node']; ?>
|
||||||
|
</option>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</select>
|
</select>
|
||||||
<!--<input type="submit"value="Localiser sur une carte">-->
|
<!--<input type="submit"value="Localiser sur une carte">-->
|
||||||
@ -59,11 +60,12 @@
|
|||||||
<ul class="cities">
|
<ul class="cities">
|
||||||
<?php $jour = isset($_GET['calendrier']) ? $_GET['calendrier'] : ''; ?>
|
<?php $jour = isset($_GET['calendrier']) ? $_GET['calendrier'] : ''; ?>
|
||||||
<?php $citiesList = getCities($jour); ?>
|
<?php $citiesList = getCities($jour); ?>
|
||||||
|
<?php echo '<h3>' . getDatejour($jour) . '</h3>'; ?>
|
||||||
<?php if (isset($citiesList)): ?>
|
<?php if (isset($citiesList)): ?>
|
||||||
<?php foreach ($citiesList as $city): ?>
|
<?php foreach ($citiesList as $city): ?>
|
||||||
<li>
|
<li>
|
||||||
<?php
|
<?php
|
||||||
echo '<a href="' . $city['href'] . '" target="_blank">' . $city['name'] . '</a>' ; ?>
|
echo '<a href="' . $city['href'] . '" target="_blank">' . $city['name'] . '</a>'; ?>
|
||||||
</li>
|
</li>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
@ -13,6 +13,10 @@
|
|||||||
.cities-column {
|
.cities-column {
|
||||||
flex: 2; /* Occupe 100% de la largeur dans les petits écrans et 10% dans les grands écrans */
|
flex: 2; /* Occupe 100% de la largeur dans les petits écrans et 10% dans les grands écrans */
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.cities-column > li {
|
||||||
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.map-column {
|
.map-column {
|
||||||
|
Loading…
Reference in New Issue
Block a user