Primo Commit

This commit is contained in:
root
2026-01-03 11:59:31 +01:00
commit 719d750a7a
72 changed files with 14088 additions and 0 deletions

54
config/getStation.inc.php Normal file
View File

@@ -0,0 +1,54 @@
<?php
// Funzione per caricare il file XML delle radio
function loadRadioStations() {
$xml = simplexml_load_file('./data/radio.xml');
if ($xml === false) {
error_log("Errore nel caricamento del file XML: data/radio.xml");
return [];
}
return $xml->station;
}
// Funzione per ottenere una singola stazione radio
function getRadioStation($id) {
$xml = simplexml_load_file('./data/radio.xml');
if ($xml === false) {
error_log("Errore nel caricamento del file XML: data/radio.xml");
return null;
}
foreach ($xml->station as $station) {
if ((int)$station->id === $id) {
return $station;
}
}
return null;
}
// Funzione per caricare il file XML delle TV
function loadTVStations() {
$xml = simplexml_load_file('./data/tv.xml');
if ($xml === false) {
error_log("Errore nel caricamento del file XML: data/tv.xml");
return [];
}
return $xml->station;
}
// Funzione per ottenere una singola stazione TV
function getTVStation($id) {
$xml = simplexml_load_file('./data/tv.xml');
if ($xml === false) {
error_log("Errore nel caricamento del file XML: data/tv.xml");
return null;
}
foreach ($xml->station as $station) {
if ((int)$station->id === $id) {
return $station;
}
}
return null;
}
$changelog = simplexml_load_file("./data/changelog.xml") or die("Errore: Impossibile accedere al file CHANGELOG");
$version_app = $changelog->version->number[0];