Compare commits
7
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
14f4143207 | ||
|
|
53b4bd3423 | ||
|
|
386bef9094 | ||
|
|
4e52aa468f | ||
|
|
f4b65903f7 | ||
|
|
29a1be5d22 | ||
|
|
51bc1f7876 |
No files matched your search
@@ -31,6 +31,7 @@ if (!in_array($token, $validTokens)) {
|
||||
errorMail(
|
||||
"API Login failed",
|
||||
$error,
|
||||
true,
|
||||
);
|
||||
echo $error;
|
||||
exit;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -65,6 +65,7 @@ function db_connect() {
|
||||
errorMail(
|
||||
"Database Connection failed",
|
||||
$e->getMessage(),
|
||||
false,
|
||||
);
|
||||
redirectToWebsite("https://blackpi.ipv64.net");
|
||||
throw $e;
|
||||
|
||||
@@ -93,7 +93,8 @@ function logging() {
|
||||
} catch (mysqli_sql_exception $e) {
|
||||
errorMail(
|
||||
"Logging failed",
|
||||
$e->getMessage()
|
||||
$e->getMessage(),
|
||||
true,
|
||||
);
|
||||
throw $e;
|
||||
}
|
||||
|
||||
@@ -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(),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in new issue
Block a user