mirror of
https://github.com/Daniongithub/ER-TPL.git
synced 2025-12-06 17:12:05 +00:00
Start iframe orari
This commit is contained in:
@@ -21,6 +21,10 @@ body {
|
|||||||
margin:8px;
|
margin:8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#iframe{
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
table{
|
table{
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
|
|||||||
33
seta_menu/frequenze/iframeorari.html
Normal file
33
seta_menu/frequenze/iframeorari.html
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="it">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="description" content="Visualizza i tempi di percorrenza di SETA a Modena.">
|
||||||
|
<meta name="keywords" content="seta, modena, seta-modena, orari, in, tempo, reale, autobus, fermate, orario, palina">
|
||||||
|
<meta name="author" content="ER-TPL Team">
|
||||||
|
<title>SETA Modena - Tempi di percorrenza</title>
|
||||||
|
<link rel="stylesheet" href="css/style.css">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<link rel="shortcut icon" href="https://www.setaweb.it/images/favicon/android-icon-192x192.png">
|
||||||
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||||
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||||
|
<link href="https://fonts.googleapis.com/css2?family=Titillium+Web:ital,wght@0,200;0,300;0,400;0,600;0,700;0,900;1,200;1,300;1,400;1,600;1,700&display=swap" rel="stylesheet">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<header>
|
||||||
|
<nav id="iframe-orari-nav">
|
||||||
|
<ul>
|
||||||
|
<li><a href="/seta_menu/frequenze/index.html"><h1 style="font-size: 100%;font-weight: 500;">Selettore linea</h1></a></li>
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
</header>
|
||||||
|
<h2>Orari oggi linea: <span id="linea-span"></span></h2>
|
||||||
|
<iframe id="iframe" src="https://www.setaweb.it/lineedyn_linea_dett_fermate_e_orari.php" frameborder="0" height="500" width="500"></iframe>
|
||||||
|
<footer>
|
||||||
|
<div>
|
||||||
|
<p>Copyright (C) 2025 ER-TPL Team - <a href="https://ertpl.pages.dev" target="_blank">ertpl.pages.dev</a> - code by Il Dani & SetaModenaFanpage <a href="https://github.com/Leocraft1/SetaAPI" target="_blank">Codice Sorgente</a> - I loghi SETA Spa sono marchi registrati e sono inseriti in questo sito solo a scopo di illustrazione.</p>
|
||||||
|
</div>
|
||||||
|
</footer>
|
||||||
|
<script src="js/iframeorari.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<header>
|
<header>
|
||||||
<nav style="display: flex;">
|
<nav>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="/index.html"><h1 style="font-size: 100%;font-weight: 500;">Home</h1></a></li>
|
<li><a href="/index.html"><h1 style="font-size: 100%;font-weight: 500;">Home</h1></a></li>
|
||||||
<li><a href="/seta_menu/seta.html"><h1 style="font-size: 100%;font-weight: 500;">SETA Modena</h1></a></li>
|
<li><a href="/seta_menu/seta.html"><h1 style="font-size: 100%;font-weight: 500;">SETA Modena</h1></a></li>
|
||||||
|
|||||||
46
seta_menu/frequenze/js/iframeorari.js
Normal file
46
seta_menu/frequenze/js/iframeorari.js
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
const params = new URLSearchParams(window.location.search);
|
||||||
|
const num = params.get('routenum');
|
||||||
|
const lineaSpan = document.getElementById('linea-span');
|
||||||
|
const iframeContainer = document.getElementById('iframe-container');
|
||||||
|
const linkContainer = document.getElementById('link-a-seta');
|
||||||
|
|
||||||
|
var setaURL = "https://setaapi.serverissimo.freeddns.org/frequencydescription/"+num;
|
||||||
|
|
||||||
|
//Display numero linea
|
||||||
|
lineaSpan.innerHTML=num;
|
||||||
|
|
||||||
|
//Contenuto del testo
|
||||||
|
fetch(urlDesc)
|
||||||
|
.then(response => {
|
||||||
|
if (!response.ok) throw new Error("Impossibile raggiungere il server.");
|
||||||
|
return response.json();
|
||||||
|
})
|
||||||
|
.then(data =>{
|
||||||
|
descContainer.innerHTML=`
|
||||||
|
<table id="desc-table">
|
||||||
|
<th>Destinazione</th>
|
||||||
|
<th>Tempo di percorrenza</th>
|
||||||
|
<th>Frequenza</th>
|
||||||
|
</table>`;
|
||||||
|
const table = document.getElementById('desc-table');
|
||||||
|
if(data[0].linea==undefined){
|
||||||
|
descContainer.innerHTML="La linea specificata non possiede nessuna descrizione valida.";
|
||||||
|
}
|
||||||
|
var i=0;
|
||||||
|
data[0].destinazioni.forEach(element => {
|
||||||
|
var tr = document.createElement('tr');
|
||||||
|
var td = document.createElement('td');
|
||||||
|
td.innerHTML=data[0].destinazioni[i];
|
||||||
|
tr.appendChild(td);
|
||||||
|
var td = document.createElement('td');
|
||||||
|
td.innerHTML=data[0].percorrenza[i];
|
||||||
|
tr.appendChild(td);
|
||||||
|
var td = document.createElement('td');
|
||||||
|
td.innerHTML=data[0].frequenze[i];
|
||||||
|
tr.appendChild(td);
|
||||||
|
table.appendChild(tr);
|
||||||
|
i++;
|
||||||
|
});
|
||||||
|
linkContainer.innerHTML=`<a href="${data[0].linkseta}" class="biancosott">Visualizza sul sito seta</a>`;
|
||||||
|
})
|
||||||
|
.catch(error => {descContainer.innerHTML="La linea specificata non possiede nessuna descrizione valida.";console.error(error);})
|
||||||
Reference in New Issue
Block a user