';
return $output;
}
}
class ContactManager {
public function displayForm() {
return '
';
}
public function handleSubmission($name, $email, $message) {
$feedback = [
'name' => $name,
'email' => $email,
'message' => $message,
'date' => date('Y-m-d H:i:s')
];
$feedbacks = json_decode(file_get_contents('feedbacks.json') ?: '[]', true);
$feedbacks[] = $feedback;
file_put_contents('feedbacks.json', json_encode($feedbacks));
}
}
class AdminManager {
public function isAdmin() {
return isset($_SESSION['admin']) && $_SESSION['admin'] === true;
}
public function handleLogin($username, $password) {
echo "Login-Versuch: Username = $username, Passwort = $password"; // Debugging
if ($username === 'admin' && $password === 'sonne4000') {
$_SESSION['admin'] = true;
return true;
}
return false;
}
public function handleImageUpload($file) {
if (!$this->isAdmin()) {
return false; // Nur Admins dürfen Bilder hochladen
}
if (!isset($file['tmp_name']) || empty($file['tmp_name'])) {
echo "Keine Datei hochgeladen.";
return false;
}
$target_dir = "uploads/";
if (!file_exists($target_dir)) {
mkdir($target_dir, 0777, true);
}
$target_file = $target_dir . basename($file["name"]);
$uploadOk = 1;
$imageFileType = strtolower(pathinfo($target_file,PATHINFO_EXTENSION));
$check = @getimagesize($file["tmp_name"]);
if($check === false) {
echo "Die Datei ist kein Bild.";
return false;
}
if ($file["size"] > 5000000) { // 5MB Limit
echo "Die Datei ist zu groß.";
return false;
}
// Erlauben Sie nur bestimmte Dateiformate
if($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg"
&& $imageFileType != "gif" ) {
echo "Nur JPG, JPEG, PNG & GIF Dateien sind erlaubt.";
return false;
}
// Wenn alles in Ordnung ist, versuchen Sie, die Datei hochzuladen
if (move_uploaded_file($file["tmp_name"], $target_file)) {
echo "Die Datei ". basename( $file["name"]). " wurde hochgeladen.";
return true;
} else {
echo "Es gab einen Fehler beim Hochladen der Datei.";
return false;
}
}
public function displayLoginForm() {
return '
';
}
public function displayAdminContent() {
$feedbacks = json_decode(file_get_contents('feedbacks.json') ?: '[]', true);
$output = '
Admin-Bereich
';
foreach ($feedbacks as $feedback) {
$output .= "
";
$output .= "
{$feedback['name']} ({$feedback['email']})
";
$output .= "
{$feedback['message']}
";
$output .= "{$feedback['date']}";
$output .= "
";
}
$output .= '
';
$output .= '
Social Media Links verwalten
';
$output .= '
Bild hochladen
';
return $output;
}
public function displayGalleryImages() {
$output = '
';
$files = glob("uploads/*.*");
foreach($files as $file) {
$filename = basename($file);
$extension = pathinfo($file, PATHINFO_EXTENSION);
// NUR Bilddateien anzeigen, KEINE Videos
if (in_array(strtolower($extension), ['jpg', 'jpeg', 'png', 'gif'])) {
$output .= '';
}
}
$output .= '
';
return $output;
}
public function handleSocialMediaUpdate($platform, $url) {
$socialLinks = json_decode(file_get_contents('social_links.json') ?: '{}', true);
$socialLinks[$platform] = $url;
file_put_contents('social_links.json', json_encode($socialLinks));
}
}
// Weather Bingo Manager
//require_once 'weather_bingo.php';
//$weatherBingo = new WeatherBingo();
// Neue VideoArchiveManager Klasse
class VideoArchiveManager {
private $videoDir;
private $monthNames;
public function __construct($videoDir = './image/') {
$this->videoDir = $videoDir;
$this->monthNames = [
'01' => 'Januar',
'02' => 'Februar',
'03' => 'März',
'04' => 'April',
'05' => 'Mai',
'06' => 'Juni',
'07' => 'Juli',
'08' => 'August',
'09' => 'September',
'10' => 'Oktober',
'11' => 'November',
'12' => 'Dezember'
];
}
public function getVideosGroupedByDate() {
$videos = [];
foreach (glob($this->videoDir . 'daily_video_*.mp4') as $video) {
// Dateinamenformat: daily_video_YYYYMMDD_HHMMSS.mp4
if (preg_match('/daily_video_(\d{8})_\d{6}\.mp4/', basename($video), $matches)) {
$dateStr = $matches[1]; // YYYYMMDD
$year = substr($dateStr, 0, 4);
$month = substr($dateStr, 4, 2);
$day = substr($dateStr, 6, 2);
// Gruppiere nach Jahr und Monat
$videos[$year][$month][] = [
'path' => $video,
'filename' => basename($video),
'day' => $day,
'filesize' => filesize($video),
'modified' => filemtime($video)
];
}
}
// Nach Tag sortieren
foreach ($videos as $year => $months) {
foreach ($months as $month => $days) {
usort($videos[$year][$month], function($a, $b) {
return $b['day'] - $a['day']; // Absteigend sortieren (neueste zuerst)
});
}
}
return $videos;
}
public function getAvailableYearsAndMonths() {
$videos = $this->getVideosGroupedByDate();
$result = [];
foreach ($videos as $year => $months) {
$result[$year] = array_keys($months);
}
return $result;
}
public function getVideosForYearAndMonth($year, $month) {
$videos = $this->getVideosGroupedByDate();
return isset($videos[$year][$month]) ? $videos[$year][$month] : [];
}
public function displayCalendarInterface() {
$yearsAndMonths = $this->getAvailableYearsAndMonths();
$output = '
';
$output .= '
Video-Archiv
';
if (empty($yearsAndMonths)) {
$output .= '
Keine Videos verfügbar.
';
} else {
$output .= '
';
$output .= '';
$output .= '
';
// Wenn Jahr und Monat ausgewählt wurden, zeige die Videos
if (isset($_GET['calendar_year']) && isset($_GET['calendar_month'])) {
$year = $_GET['calendar_year'];
$month = $_GET['calendar_month'];
$videos = $this->getVideosForYearAndMonth($year, $month);
if (!empty($videos)) {
$output .= '
Haben Sie Fragen, Anregungen oder möchten uns unterstützen? Wir freuen uns auf Ihre Nachricht!
displayForm(); ?>
displayGalleryImages(); ?>
Aurora Wetter Livecam ist ein Herzensprojekt von Wetterbegeisterten. Wir möchten Ihnen die Schönheit der Natur und Faszination des Wetters näher bringen.
Dazu betreiben wir seit 2010 rund um die Uhr hochauflösende Webcams. Besonders stolz sind wir auf einzigartige Einblicke, wie z.B. die Trainingsflüge der Patrouille Suisse jeden Montagmorgen.