mirror of
https://github.com/Daniongithub/ER-TPL.git
synced 2025-12-06 21:52:02 +00:00
Compare commits
7 Commits
e240fff22d
...
d67fbb26d8
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d67fbb26d8 | ||
|
|
2da2ac924b | ||
|
|
d62d4287e7 | ||
|
|
5807d3e5f0 | ||
|
|
5bc5600487 | ||
|
|
1756a545cb | ||
|
|
e78bc0bdda |
@@ -40,7 +40,7 @@
|
|||||||
<h2 class="piccolospazio yellow-warning">SETA:</h2>
|
<h2 class="piccolospazio yellow-warning">SETA:</h2>
|
||||||
<p class="piccolospazio">
|
<p class="piccolospazio">
|
||||||
<strong>Servizi rapidi:</strong> <a class="novita" href="/seta_modena/servizi/cercaorario/index.html">Cerca orario</a> <br> <br>
|
<strong>Servizi rapidi:</strong> <a class="novita" href="/seta_modena/servizi/cercaorario/index.html">Cerca orario</a> <br> <br>
|
||||||
Eliminato il servizio <a class="novita" href="/seta_modena/menu/frequenze/index.html">Frequenze e tempi di percorrenza</a>, e' stato integrato in <a class="novita" href="/seta_modena/servizi/percorsi/index.html">Percorsi</a>. <br> <br>
|
Aggiornato il <a class="novita" href="/seta_modena/servizi/cercaorario/index.html">Cerca orario</a>! Ora le linee con problemi o notizie vengono mostrate in rosso. Per vedere le notizie relative alla linea basta cliccare sopra al numero o alla destinazione. <br> <br>
|
||||||
<h3 class="yellow-warning">Sezione in manutenzione</h3>
|
<h3 class="yellow-warning">Sezione in manutenzione</h3>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -39,7 +39,10 @@ th,td {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.bus-card-red {
|
.bus-card-red {
|
||||||
background-color: rgb(241, 120, 120) !important;
|
background-color: rgb(55,14,14) !important;
|
||||||
|
}
|
||||||
|
.cursor-pointer{
|
||||||
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
hr{
|
hr{
|
||||||
|
|||||||
@@ -26,11 +26,12 @@
|
|||||||
<div id="tabella-container">Caricamento dati...</div>
|
<div id="tabella-container">Caricamento dati...</div>
|
||||||
<p>Il ritardo viene espresso rispetto all'orario previsto. Quello indicato, se disponibile, è l'orario di arrivo in tempo reale.</p>
|
<p>Il ritardo viene espresso rispetto all'orario previsto. Quello indicato, se disponibile, è l'orario di arrivo in tempo reale.</p>
|
||||||
<p>E' possibile cliccare sul numero del mezzo per vedere la sua posizione sulla mappa.</p>
|
<p>E' possibile cliccare sul numero del mezzo per vedere la sua posizione sulla mappa.</p>
|
||||||
|
<p>Se una corsa viene visualizzata in rosso, vuol dire che ci sono problemi sulla linea. Cliccare sul numero linea o sul </p>
|
||||||
<footer>
|
<footer>
|
||||||
<div>
|
<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>
|
<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>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
<script src="js/fermata.js"></script>
|
<script src="js/fermata-problemi.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
193
seta_modena/servizi/cercaorario/js/fermata-problemi.js
Normal file
193
seta_modena/servizi/cercaorario/js/fermata-problemi.js
Normal file
@@ -0,0 +1,193 @@
|
|||||||
|
const params = new URLSearchParams(window.location.search);
|
||||||
|
const nome = params.get('name');
|
||||||
|
const codice = params.get('code');
|
||||||
|
|
||||||
|
//Ricerca per pulsante dall'altra parte
|
||||||
|
const url = 'https://setaapi.serverissimo.freeddns.org/stopcodesarchive';
|
||||||
|
//const url='http://localhost:5001/stoplist';
|
||||||
|
fetch(url)
|
||||||
|
.then(response => {
|
||||||
|
if (!response.ok) throw new Error("Errore nel caricamento dei dati.");
|
||||||
|
return response.json();
|
||||||
|
})
|
||||||
|
.then(data => {
|
||||||
|
allresults = data;
|
||||||
|
//Set corsie per stazione o autostazione
|
||||||
|
const corsie_nav = document.getElementById('corsie-nav');
|
||||||
|
if(nome.includes("STAZIONE FS")){
|
||||||
|
corsie_nav.innerHTML = `
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<a href="/seta_modena/servizi/cercaorario/altrecorsie.html?location=STAZIONE FS">Altre corsie</a>
|
||||||
|
</li>
|
||||||
|
</ul>`;
|
||||||
|
}
|
||||||
|
if(nome.includes("MODENA AUTOSTAZIONE")){
|
||||||
|
corsie_nav.innerHTML = `
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<a href="/seta_modena/servizi/cercaorario/altrecorsie.html?location=MODENA AUTOSTAZIONE">Altre corsie</a>
|
||||||
|
</li>
|
||||||
|
</ul>`;
|
||||||
|
}
|
||||||
|
if(nome.includes("GARIBALDI")){
|
||||||
|
corsie_nav.innerHTML = `
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<a href="/seta_modena/servizi/cercaorario/altrecorsie.html?location=GARIBALDI">Altre corsie</a>
|
||||||
|
</li>
|
||||||
|
</ul>`;
|
||||||
|
}
|
||||||
|
if(nome.includes("POLO LEONARDO")){
|
||||||
|
corsie_nav.innerHTML = `
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<a href="/seta_modena/servizi/cercaorario/altrecorsie.html?location=POLO LEONARDO">Altre corsie</a>
|
||||||
|
</li>
|
||||||
|
</ul>`;
|
||||||
|
}
|
||||||
|
//Pulsante dall'altra parte
|
||||||
|
console.log(altraParteSearch(nome))
|
||||||
|
if(altraParteSearch(nome)!=undefined){
|
||||||
|
const codes = altraParteSearch(nome);
|
||||||
|
const altrocodice = 0;
|
||||||
|
if(codice==codes[0]){
|
||||||
|
altroCodice = codes[1];
|
||||||
|
}else{
|
||||||
|
altroCodice = codes[0];
|
||||||
|
}
|
||||||
|
corsie_nav.innerHTML = `
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<a href="/seta_modena/servizi/cercaorario/fermata.html?code=${altroCodice}&name=${nome}">Dall'altra parte</a>
|
||||||
|
</li>
|
||||||
|
</ul>`;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(error => console.error('Errore nel caricamento dei dati:', error));
|
||||||
|
|
||||||
|
//Sets stop name
|
||||||
|
const fermata_span = document.getElementById('fermata-span');
|
||||||
|
fermata_span.textContent=nome;
|
||||||
|
|
||||||
|
const urlBackend = `https://setaapi.serverissimo.freeddns.org/arrivals/${codice}`;
|
||||||
|
//const urlBackend = `http://localhost:5001/arrivals/${codice}`;
|
||||||
|
|
||||||
|
function caricadati(){
|
||||||
|
fetch(urlBackend)
|
||||||
|
.then(response => {
|
||||||
|
if (!response.ok) throw new Error("Errore nel caricamento dei dati.");
|
||||||
|
return response.json();
|
||||||
|
})
|
||||||
|
.then(data => {
|
||||||
|
item = data.arrival;
|
||||||
|
})
|
||||||
|
.then(data => {
|
||||||
|
|
||||||
|
const container = document.getElementById('tabella-container');
|
||||||
|
container.innerHTML = '';
|
||||||
|
|
||||||
|
if (item.error=="no arrivals scheduled in next 90 minutes") {
|
||||||
|
container.innerHTML = '<h3>Nessuna corsa programmata nei prossimi 90 minuti.</h3>';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// Creo tabella
|
||||||
|
const table = document.createElement('table');
|
||||||
|
|
||||||
|
// Intestazione
|
||||||
|
const thead = document.createElement('thead');
|
||||||
|
thead.innerHTML = `
|
||||||
|
<tr>
|
||||||
|
<th class="linea">Linea</th>
|
||||||
|
<th class="direzione">Direzione</th>
|
||||||
|
<th class="orario">Orario (Rit/Ant)</th>
|
||||||
|
<th class="stato">Stato corsa</th>
|
||||||
|
<th class="veicolo">Veicolo</th>
|
||||||
|
<th class="location">Ora si trova a</th>
|
||||||
|
</tr>
|
||||||
|
`;
|
||||||
|
table.appendChild(thead);
|
||||||
|
|
||||||
|
// Corpo tabella
|
||||||
|
const tbody = document.createElement('tbody');
|
||||||
|
item.services.forEach(item => {
|
||||||
|
const tr = document.createElement('tr');
|
||||||
|
if(item.type=="planned"){
|
||||||
|
var stato="Prevista";
|
||||||
|
}else{
|
||||||
|
var stato="In tempo reale";
|
||||||
|
}if(item.next_stop==null){
|
||||||
|
var posizione="";
|
||||||
|
}else{
|
||||||
|
var posizione=item.next_stop;
|
||||||
|
}
|
||||||
|
if(item.hasProblems==true){
|
||||||
|
tr.setAttribute("class","bus-card-red");
|
||||||
|
tr.innerHTML = `
|
||||||
|
<td class="cursor-pointer" onclick="window.location.href='/seta_modena/servizi/cercaorario/notizielinea.html?routenum=${item.officialService}'">${item.service}</td>
|
||||||
|
<td class="cursor-pointer" onclick="window.location.href='/seta_modena/servizi/cercaorario/notizielinea.html?routenum=${item.officialService}'">${item.destination}</td>
|
||||||
|
`;
|
||||||
|
}else{
|
||||||
|
tr.innerHTML = `
|
||||||
|
<td>${item.service}</td>
|
||||||
|
<td>${item.destination}</td>
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
if(item.delay==undefined){
|
||||||
|
//le prime righe sono spostate sopra per link alle notizie se ci sono problemi
|
||||||
|
tr.innerHTML += `
|
||||||
|
<td>${item.arrival}</td>
|
||||||
|
<td>${stato}</td>
|
||||||
|
<td><a href="https://wimb.setaweb.it/qm/index.html?id=${item.busnum}" class="bianco">${item.busnum}</a></td>
|
||||||
|
<td>${posizione}</td>
|
||||||
|
`;
|
||||||
|
tbody.appendChild(tr);
|
||||||
|
}else{
|
||||||
|
if(item.delay>0){
|
||||||
|
tr.innerHTML += `
|
||||||
|
<td>${item.arrival} (+${item.delay})</td>
|
||||||
|
<td>${stato}</td>
|
||||||
|
<td><a href="https://wimb.setaweb.it/qm/index.html?id=${item.busnum}" class="bianco">${item.busnum}</a></td>
|
||||||
|
<td>${posizione}</td>
|
||||||
|
`;
|
||||||
|
tbody.appendChild(tr);
|
||||||
|
}else{
|
||||||
|
tr.innerHTML += `
|
||||||
|
<td>${item.arrival} (${item.delay})</td>
|
||||||
|
<td>${stato}</td>
|
||||||
|
<td><a href="https://wimb.setaweb.it/qm/index.html?id=${item.busnum}" class="bianco">${item.busnum}</a></td>
|
||||||
|
<td>${posizione}</td>
|
||||||
|
`;
|
||||||
|
tbody.appendChild(tr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
table.appendChild(tbody);
|
||||||
|
|
||||||
|
container.appendChild(table);
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
console.error('Errore nel caricamento dati:', err);
|
||||||
|
document.getElementById('tabella-container').textContent = 'Errore nel caricamento dati.';
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
caricadati();
|
||||||
|
|
||||||
|
setInterval(caricadati, 60000);
|
||||||
|
|
||||||
|
function altraParteSearch(searchTerm){
|
||||||
|
var dupedCodes = [];
|
||||||
|
var i = 0;
|
||||||
|
allresults.forEach(element => {
|
||||||
|
if(element.fermata.toLowerCase()==searchTerm.toLowerCase()){
|
||||||
|
dupedCodes[i]=element.valore;
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if(dupedCodes.length==2){
|
||||||
|
return dupedCodes;
|
||||||
|
}else if(dupedCodes.length==1){
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
}
|
||||||
36
seta_modena/servizi/cercaorario/js/notizielinea.js
Normal file
36
seta_modena/servizi/cercaorario/js/notizielinea.js
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
const params = new URLSearchParams(window.location.search);
|
||||||
|
const num = params.get('routenum');
|
||||||
|
const newsContainer = document.getElementById('notizie-container');
|
||||||
|
const lineaSpan = document.getElementById('linea-span');
|
||||||
|
|
||||||
|
//Urls
|
||||||
|
const url = "https://setaapi.serverissimo.freeddns.org/routeproblems/"+num;
|
||||||
|
|
||||||
|
//Display numero linea
|
||||||
|
lineaSpan.textContent=num;
|
||||||
|
|
||||||
|
//Spawn product card
|
||||||
|
fetch(url)
|
||||||
|
.then(response => {
|
||||||
|
if (!response.ok) throw new Error("Errore nel caricamento dei dati.");
|
||||||
|
return response.json();
|
||||||
|
})
|
||||||
|
.then(data => {
|
||||||
|
newsContainer.innerHTML='';
|
||||||
|
data.problems.forEach(element => {
|
||||||
|
var div = document.createElement("div");
|
||||||
|
div.setAttribute("class","news-card");
|
||||||
|
var p = document.createElement('p');
|
||||||
|
var h3 = document.createElement('h3');
|
||||||
|
var a = document.createElement('a');
|
||||||
|
const link = "/seta_modena/menu/notizia.html?link="+element.link;
|
||||||
|
a.setAttribute("href",link);
|
||||||
|
a.setAttribute("class","bianco");
|
||||||
|
p.innerHTML=element.date;
|
||||||
|
h3.innerHTML=element.title;
|
||||||
|
a.appendChild(p);
|
||||||
|
a.appendChild(h3);
|
||||||
|
div.appendChild(a);
|
||||||
|
newsContainer.appendChild(div);
|
||||||
|
});
|
||||||
|
})
|
||||||
32
seta_modena/servizi/cercaorario/notizielinea.html
Normal file
32
seta_modena/servizi/cercaorario/notizielinea.html
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>SETA Modena - Orario fermate</title>
|
||||||
|
<link rel="stylesheet" href="/style.css">
|
||||||
|
<link rel="stylesheet" href="css/style.css">
|
||||||
|
<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 style="display: flex;">
|
||||||
|
<ul>
|
||||||
|
<li><a href="/seta_modena/servizi/cercaorario/index.html"><h1 style="font-size: 100%;font-weight: 500;">Cerca Orario</h1></a></li>
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
</header>
|
||||||
|
<h2>Notizie linea: <span id="linea-span"></span></h2>
|
||||||
|
<nav id="corsie-nav"></nav>
|
||||||
|
<div id="notizie-container">Caricamento dati...</div>
|
||||||
|
<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/notizielinea.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -410,6 +410,14 @@ span.blu{
|
|||||||
.lista-mezzi a{
|
.lista-mezzi a{
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*Notizie cercaorario*/
|
||||||
|
|
||||||
|
#notizie-container{
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
/* Zona ricerca */
|
/* Zona ricerca */
|
||||||
.product-card {
|
.product-card {
|
||||||
margin: 10px;
|
margin: 10px;
|
||||||
|
|||||||
Reference in New Issue
Block a user