Compare commits

..
Author SHA1 Message Date
Tower 14f4143207 fix 2026-04-10 21:43:17 +02:00
Tower 53b4bd3423 fixes 2026-04-08 16:53:49 +02:00
Bruno Eckhardt 386bef9094 refresh fixes 2026-04-08 16:34:06 +02:00
Bruno Eckhardt 4e52aa468f fix: minus temperaturen 2026-03-27 06:50:19 +01:00
Bruno Eckhardt f4b65903f7 store error mails in Mailing Table 2026-03-26 08:10:57 +01:00
Bruno Eckhardt 29a1be5d22 enable and disable error logging in errorMailing 2026-03-26 07:52:59 +01:00
Bruno Eckhardt 51bc1f7876 home info htmlspecialchars and right fixes 2026-03-25 08:46:38 +01:00
8 changed files with 35 additions and 7 deletions

No files matched your search

+1
View File
@@ -31,6 +31,7 @@ if (!in_array($token, $validTokens)) {
errorMail(
"API Login failed",
$error,
true,
);
echo $error;
exit;
+1 -1
View File
@@ -3,7 +3,7 @@
class getSpecificData {
public function getWeather() {
$url = "https://api.openweathermap.org/data/2.5/weather?q=Berlin,DE&APPID=5bc3e1a438c58fca444c4370ac0517b2&units=metric";
$url = "https://api.openweathermap.org/data/2.5/weather?q=Jena,DE&APPID=5bc3e1a438c58fca444c4370ac0517b2&units=metric";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
+1
View File
@@ -65,6 +65,7 @@ function db_connect() {
errorMail(
"Database Connection failed",
$e->getMessage(),
false,
);
redirectToWebsite("https://blackpi.ipv64.net");
throw $e;
+2 -1
View File
@@ -93,7 +93,8 @@ function logging() {
} catch (mysqli_sql_exception $e) {
errorMail(
"Logging failed",
$e->getMessage()
$e->getMessage(),
true,
);
throw $e;
}
+11 -1
View File
@@ -24,7 +24,7 @@ function sendMail($subject, $message, $url, bool $log) {
}
}
function errorMail($title, $error) {
function errorMail($title, $error, bool $log) {
$headers = "From: bruno.eckhardt07@gmail.com\r\n";
mail(
"bruno.eckhardt07@gmail.com",
@@ -32,4 +32,14 @@ function errorMail($title, $error) {
$error,
$headers,
);
if ($log == true) {
DatabaseInsert(
"Mailing",
"DATUM, SUBJECT, MESSAGE, URL, CLIENT_IP",
(new getSpecificData())->getRequestTime(),
"ERROR: $title",
$error,
(new getSpecificData())->getClientIP(),
);
}
}
+2
View File
@@ -19,6 +19,7 @@ $db_res = DatabaseShow(
<h3 style="background-color: #007bff;">👤 Benutzerprofil</h3>
<div class="group-links" style="padding: 10px; color: inherit;">
<p style="margin: 5px 0;"><strong>Name:</strong> <code><?= htmlspecialchars($username) ?></code></p>
<?php if ($username != 'gast'): ?>
<p style="margin: 5px 0;"><strong>Nachname:</strong>
<code><?= htmlspecialchars($db_res[0]['NACHNAME']) ?></code>
</p>
@@ -31,6 +32,7 @@ $db_res = DatabaseShow(
<p style="margin: 5px 0;"><strong>Home IP:</strong>
<code><?= htmlspecialchars($db_res[0]['HOME_IP']) ?></code>
</p>
<?php endif ?>
</div>
</div>
+2 -2
View File
@@ -42,7 +42,7 @@ $conn->close();
data: <?php echo json_encode($data); ?>,
borderColor: 'rgba(75, 192, 192, 1)',
backgroundColor: 'rgba(75, 192, 192, 0.2)',
fill: true,
fill: false,
tension: 0
}]
},
@@ -82,7 +82,7 @@ $conn->close();
}
},
y: {
min: 0,
min: -10,
max: 40,
title: {
display: true,
+15 -2
View File
@@ -1,4 +1,7 @@
<?php
include_once __DIR__ . '/../controller/DatabaseController.php';
include_once __DIR__ . '/../controller/RoutesController.php';
$conn = db_connect();
$view = $_GET['view'] ?? 'show';
$selectedService = $_GET['service'];
@@ -8,8 +11,17 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['add_overtime'])) {
$datum = $_POST['ot_date'];
$minuten = intval($_POST['ot_minutes']);
$grund = $conn->real_escape_string($_POST['ot_reason']);
$insert_sql = "INSERT INTO Ueberstunden (DATUM, MINUTEN, GRUND) VALUES ('$datum', $minuten, '$grund')";
$conn->query($insert_sql);
DatabaseInsert(
"Ueberstunden",
"DATUM, MINUTEN, GRUND",
$datum,
$minuten,
$grund
);
redirectToWebsite((new getSpecificData())->getReferer());
exit;
}
// --- Gesamtsumme berechnen ---
@@ -59,6 +71,7 @@ $gesamt_minuten = $minuten_berichte - $minuten_abbau + $minuten_aufbau;
<option value="">Bitte wählen</option>
<option value="Abbau">Abbau</option>
<option value="Aufbau">Aufbau</option>
<option value="Anderes">Anderes</option>
</select>
</div>
<button type="submit"