Update: Berichtshefte ready for live

This commit is contained in:
hydrax committed 2026-01-08 18:57:09 +01:00
1 parent dac39e7608
commit 24f57ec757
9 files changed
+131 -13

No files matched your search

+1 -1
View File
@@ -5,7 +5,7 @@
}
],
"settings": {
"workbench.colorTheme": "Default Dark Modern",
"workbench.colorTheme": "Catppuccin Macchiato",
"workbench.colorCustomizations": {
"activityBar.background": "#00aeff75",
"activityBar.foreground": "#000000",
@@ -26,10 +26,6 @@ function DatabaseShow($table, $columns = "*", $where = "", ...$values) {
function DatabaseInsert($table, $columns, ...$values) {
include_once '../moduls/ConsoleLog.php';
ConsoleLog($values);
include_once 'DatabaseConnect.php';
$conn = db_connect();
-1
View File
@@ -27,5 +27,4 @@ if (in_array($clientIP, $whitelist)) {
}
$allData = (new getSpecificData())->getAllData();
ConsoleLog($allData);
logging();
@@ -1,5 +1,5 @@
<?php
include_once '../controller/LogController.php';
include_once '../../../controller/LogController.php';
logging();
?>
@@ -1,6 +1,6 @@
<?php
include_once '../controller/LogController.php';
include_once '../controller/DatabaseConnect.php';
include_once '../../../controller/LogController.php';
include_once '../../../controller/DatabaseConnect.php';
logging();
$conn = db_connect();
@@ -0,0 +1,124 @@
<?php
include_once '../../../controller/DatabaseController.php';
include_once '../../../controller/DatabaseConnect.php';
$berudata = DatabaseShowWithFK(
"Berufsschulberichte",
$fkMap
);
$fach = DatabaseShow(
"Fach",
"ID, FACH"
);
$raum = DatabaseShow(
"Raum",
"ID, RAUM_NR"
);
$lehrer = DatabaseShow(
"Lehrer",
"ID, NAME"
);
$json = json_encode([$fach, $raum, $lehrer], JSON_UNESCAPED_UNICODE);
?>
<!DOCTYPE html>
<html lang="de">
<body>
<h2>Berufsschulbericht</h2>
<form method="post">
<label for="datum">Datum:</label>
<input type="date" name="datum" id="datum_id">
<?php for ($i = 1; $i <= 8; $i++): ?>
<fieldset style="margin-bottom:20px; padding:10px;">
<legend>Stunde <?= $i ?></legend>
<label for="fach_<?= $i ?>">Fach:</label>
<select name="stunden[<?= $i ?>][fach_id]" id="fach_<?= $i ?>"></select>
<label for="raum_<?= $i ?>">Raum:</label>
<select name="stunden[<?= $i ?>][raum_id]" id="raum_<?= $i ?>"></select>
<label for="lehrer_<?= $i ?>">Lehrer:</label>
<select name="stunden[<?= $i ?>][lehrer_id]" id="lehrer_<?= $i ?>"></select>
<label for="inhalt_<?= $i ?>">Inhalt:</label>
<input type="text" name="stunden[<?= $i ?>][inhalt_text]" id="inhalt_<?= $i ?>">
</fieldset>
<?php endfor; ?>
<button type="submit">Absenden</button>
</form>
<script>
const daten = <?= $json ?>;
const faecher = daten[0];
const raeume = daten[1];
const lehrer = daten[2];
function fillSelect(selectId, data, labelKey) {
const select = document.getElementById(selectId);
select.innerHTML = '<option value="">Bitte wählen</option>';
data.forEach(item => {
const option = document.createElement('option');
option.value = item.ID;
option.textContent = item[labelKey];
select.appendChild(option);
});
}
for (let i = 1; i <= 8; i++) {
fillSelect('fach_' + i, faecher, 'FACH');
fillSelect('raum_' + i, raeume, 'RAUM_NR');
fillSelect('lehrer_' + i, lehrer, 'NAME');
}
</script>
<?php
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$datum = $_POST['datum'] ?? null;
$werte = [];
for ($i = 1; $i <= 8; $i++) {
$stunde = $_POST['stunden'][$i] ?? [];
$fach = !empty($stunde['fach_id']) ? $stunde['fach_id'] : null;
$lehrer = !empty($stunde['lehrer_id'])? $stunde['lehrer_id'] : null;
$raum = !empty($stunde['raum_id']) ? $stunde['raum_id'] : null;
$inhalt = !empty($stunde['inhalt_text']) ? $stunde['inhalt_text'] : null;
$werte[] = $fach;
$werte[] = $lehrer;
$werte[] = $raum;
$werte[] = $inhalt;
}
}
DatabaseInsert(
"Berufsschulberichte",
"DATUM,
FACH_S1, LEHRER_S1, RAUM_S1, INHALT_S1,
FACH_S2, LEHRER_S2, RAUM_S2, INHALT_S2,
FACH_S3, LEHRER_S3, RAUM_S3, INHALT_S3,
FACH_S4, LEHRER_S4, RAUM_S4, INHALT_S4,
FACH_S5, LEHRER_S5, RAUM_S5, INHALT_S5,
FACH_S6, LEHRER_S6, RAUM_S6, INHALT_S6,
FACH_S7, LEHRER_S7, RAUM_S7, INHALT_S7,
FACH_S8, LEHRER_S8, RAUM_S8, INHALT_S8",
$datum,
...$werte
);
?>
</body>
</html>
-2
View File
@@ -25,8 +25,6 @@ $lehrer = DatabaseShow(
"ID, NAME"
);
ConsoleLog([$berudata, $fach, $raum, $lehrer]);
$json = json_encode([$fach, $raum, $lehrer], JSON_UNESCAPED_UNICODE);
?>
@@ -10,7 +10,8 @@ $buttons = [
["name" => "Vertretungsplan", "link" => "$routing=https://sbsz-hsp.de/sdb/getPlan", "color" => $buttoncoloractive],
["name" => "Stundenplan Sophia", "link" => "$routing=/services/StundenplanSophia.php", "color" => $buttoncoloractive],
["name" => "Stundenplan Bruno", "link" => "$routing=/services/StundenplanBruno.php", "color" => $buttoncoloractive],
["name" => "Berichte Erstellen", "link" => "$routing=/services/BerichteErstellen.php", "color" => $buttoncoloractive],
["name" => "Arbeitsberichte Erstellen", "link" => "$routing=/services/Berichte/Arbeitsberichte/ArbeitsberichteErstellen.php", "color" => $buttoncoloractive],
["name" => "Berufsschulberichte Erstellen", "link" => "$routing=/services/Berichte/Berufsschulberichte/BerufsschulberichtErstellen.php", "color" => $buttoncoloractive],
]],
["section" => "Webserver", "buttons" => [
@@ -20,4 +21,4 @@ $buttons = [
["name" => "Blackpi-Webcam", "link" => "../../GLOBAL/routes.php/?website=/Webcam/", "color" => $buttoncolorinactive],
]],
];
];