?> <div id="linesForStations"> <?php foreach ($linesForStations as $a_station) { ?> <div class="tuile" style="margin-top:20px; margin-bottom:11px;"> <span class="text" style="background:#A6B2DD; color:black;"> <?php echo $a_station['name'] . " (" . $a_station['distance'] . " m)"; ?> </span> </div> <?php foreach ($a_station['lines'] as $a_line) { $colors = getColorForLine($a_line[0]); $lineBg = $colors['bg']; $lineFg = $colors['fg']; $style = "style=\"background:{$lineBg}; color:{$lineFg}; margin-bottom:4px\""; ?> <div class="tuile aStation" style="margin-top:-11px;" target="<?php echo $a_line[1]; ?> "> <span class="text" <?php echo $style; ?> > Ligne <?php echo $a_line[0]; ?>
<?php include 'parsing_line_stations.php'; include 'misc_tag.php'; $colors = getColorForLine(getLineName($stationList['line'])); $lineBg = $colors['bg']; $lineFg = $colors['fg']; $style = "style='background:{$lineBg}; color:{$lineFg}; margin-bottom:4px'"; ?> <div id="stationsForLine" style="margin-bottom: 2em;"> <?php foreach ($stationList['stations'] as $a_station) { ?> <div class="tuile aStation" style="margin-top:-7px;" target="<?php echo $a_station['id']; ?> "> <span class="text" <?php echo $style; ?> > <?php echo $a_station['name']; ?> <div style="clear:both;"></div> </span> </div> <?php } ?>
parse_str($aStation->href, $urlarray); $stationId = $urlarray['id']; $stationInfo['station'] = $stationName; $stationInfo['distance'] = intval($distance); $stationInfo['stationID'] = intval($stationId); array_push($stationList, $stationInfo); if (!array_key_exists($stationName, $linesForStations)) { $linesForStations[$stationName] = array(); $linesForStations[$stationName]['name'] = $stationName; $linesForStations[$stationName]['distance'] = intval($distance); $linesForStations[$stationName]['lines'] = array(); } array_push($linesForStations[$stationName]['lines'], array($lineName, intval($stationId))); } $lineInfo['line'] = $lineName; $lineInfo['bgcolor'] = getColorForLine($lineName)['bg']; $lineInfo['fgcolor'] = getColorForLine($lineName)['fg']; $lineInfo['stations'] = $stationList; array_push($res, $lineInfo); } uasort($linesForStations, 'cmpDistance'); if (isset($_GET['json'])) { header("Content-type: application/json"); echo json_encode($res); } else { if (isset($_GET['vardump'])) { echo "<a href=" . $fullUrl . ">Sur Mobitrans</a> - <a href=" . $osmUrl . ">Position sur OpenStreetMap</a><br/>"; echo var_dump($res); var_dump($linesForStations); } }
<?php include 'parsing_time.php'; $colors = getColorForLine($res['line']); $lineBg = $colors['bg']; $lineFg = $colors['fg']; $style = "style=\"background:{$lineBg}; color:{$lineFg}; margin-bottom:4px\""; echo "Ligne " . $res['line'] . " - Arrêt :" . $res['station']; ?> <div id="singleStationTimes" style="margin-bottom: 2em;"> <?php foreach ($res['directions'] as $a_direction) { ?> <div class="tuile" style="margin-top:20px;"> <span class="text" <?php echo $style; ?> ><?php echo $a_direction['name']; ?> </span> </div> <?php foreach ($a_direction['time'] as $a_time) { ?> <div class="tuile" style="margin-top:-7px;"> <span class="text" style="background:#A6B2DD; color:black;"> <span>Prochain départ: </span> <span> <?php echo $a_time; ?>
<?php include 'parsing_lineslist.php'; include 'misc_tag.php'; ?> <div id="linesList" style="margin-bottom: 2em;"> <?php foreach ($linesList as $a_line) { $colors = getColorForLine(getLineName($a_line['name'])); $lineBg = $colors['bg']; $lineFg = $colors['fg']; $style = "style='background:{$lineBg}; color:{$lineFg}; margin-bottom:4px'"; ?> <div class="tuile aLine" style="margin-top:-7px;" target="<?php echo $a_line['id']; ?> "> <span class="text" <?php echo $style; ?> > Ligne <?php echo $a_line['name']; ?> <div style="clear:both;"></div> </span> </div> <?php } ?>