Autyo submit, get plus court
This commit is contained in:
parent
4aebec2a32
commit
58ee2a9ed0
4
core.php
4
core.php
@ -30,7 +30,7 @@ function getCalendrier()
|
|||||||
$url = $link->getAttribute('href');
|
$url = $link->getAttribute('href');
|
||||||
$calendrier[] = array(
|
$calendrier[] = array(
|
||||||
'node' => $node,
|
'node' => $node,
|
||||||
'url' => 'https://www.sabradou.com/' . $url
|
'url' => $url,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return ($calendrier);
|
return ($calendrier);
|
||||||
@ -38,7 +38,7 @@ function getCalendrier()
|
|||||||
function getCities($html)
|
function getCities($html)
|
||||||
{
|
{
|
||||||
// Création d'un objet DOMDocument
|
// Création d'un objet DOMDocument
|
||||||
$html = file_get_contents($html);
|
$html = file_get_contents('https://www.sabradou.com/' . $html);
|
||||||
$dom = new DOMDocument();
|
$dom = new DOMDocument();
|
||||||
libxml_use_internal_errors(true); // Ignore les erreurs de parsing HTML
|
libxml_use_internal_errors(true); // Ignore les erreurs de parsing HTML
|
||||||
$dom->loadHTML($html);
|
$dom->loadHTML($html);
|
||||||
|
17
index.php
17
index.php
@ -5,23 +5,26 @@
|
|||||||
|
|
||||||
<head>
|
<head>
|
||||||
<title>Carte Sabradou</title>
|
<title>Carte Sabradou</title>
|
||||||
|
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||||
|
<script src="index.js"></script>
|
||||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.7.1/leaflet.css" />
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.7.1/leaflet.css" />
|
||||||
<link rel="stylesheet" href="style.css" />
|
<link rel="stylesheet" href="style.css" />
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body
|
||||||
<div class="header">
|
<div class="header">
|
||||||
<h1>GÉOLOCALISATION DES BROCANTES RÉFÉRENCÉES</h1>
|
<h1>GÉOLOCALISATION DES BROCANTES RÉFÉRENCÉES</h1>
|
||||||
<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 class="form" action="index.php" method="GET">
|
<form if="form" action="index.php" method="GET">
|
||||||
<label for="calendrier-list">Brocantes du :</label>
|
<label for="calendrier">Brocantes du :</label>
|
||||||
<select name="calendrier" 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): ?>
|
||||||
<option value="<?php echo $item['url']; ?>"><?php echo $item['node']; ?></option>
|
<?php $selected = isset($_GET['calendrier']) && $_GET['calendrier'] === $item['url'] ? 'selected' : ''; ?>
|
||||||
<?php endforeach; ?>
|
<option value="<?php echo $item['url']; ?>" <?php echo $selected; ?>><?php echo $item['node']; ?></option>
|
||||||
|
<?php endforeach; ?>
|
||||||
</select>
|
</select>
|
||||||
<input type="submit" value="Localiser sur une carte">
|
<!--<input type="submit"value="Localiser sur une carte">-->
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user