feat(login/register) blabla
This commit is contained in:
@@ -1,5 +1,14 @@
|
||||
<?php
|
||||
include 'services/stop_service.php';
|
||||
|
||||
function getStops($line) {
|
||||
$json = file_get_contents(__DIR__ . '/../../data/stops.json');
|
||||
$data = json_decode($json, true);
|
||||
$result = array_filter($data, function($item) use ($line) {
|
||||
return $item['fields']['mode'] === 'METRO' && $item['fields']['indice_lig'] === "$line";
|
||||
});
|
||||
return $result;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<h2>Lignes de Métro</h2>
|
||||
@@ -20,7 +29,6 @@ include 'services/stop_service.php';
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php
|
||||
$stops = getStops($i);
|
||||
include 'components/navigate/stop_list.php';
|
||||
?>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
<div class="row">
|
||||
<?php
|
||||
$stations = array_fill(1, 10, 'Station');
|
||||
|
||||
$stations = getStops($i);
|
||||
|
||||
$half = ceil(count($stations) / 2);
|
||||
$chunks = array_chunk($stations, ceil(count($stations) / 2), true);
|
||||
?>
|
||||
@@ -17,12 +19,12 @@
|
||||
<tbody>
|
||||
<?php foreach ($chunk as $station): ?>
|
||||
<tr>
|
||||
<td><?php echo $station; ?></td>
|
||||
<td class="text-end"><div class="btn btn-success">Ajouter</div></td>
|
||||
<td><?php echo htmlspecialchars($station['fields']['nom_zda']); ?></td>
|
||||
<td class="text-end"><button class="btn btn-success">Ajouter</button></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user