Initial commit: OMSORG website + Mitarbeiter-App

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Felix Kemmler
2026-06-13 20:03:22 +02:00
co-authored by Claude Sonnet 4.6
commit 8beb0fcf52
103 changed files with 7384 additions and 0 deletions
+62
View File
@@ -0,0 +1,62 @@
<?php
require_once __DIR__ . '/../lib/auth.php';
require_once __DIR__ . '/../lib/mail.php';
require_login();
if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
header('Location: ../pages/werben.php');
exit;
}
$back = '../pages/werben.php';
$name = trim($_POST['name'] ?? '');
$email = trim($_POST['email'] ?? '');
$qualifikation = trim($_POST['qualifikation'] ?? '');
$nachricht = trim($_POST['nachricht'] ?? '');
if ($name === '' || $email === '' || $qualifikation === '') {
header('Location: ' . $back . '?error=' . urlencode('Name, E-Mail und Qualifikation sind Pflichtfelder.'));
exit;
}
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
header('Location: ' . $back . '?error=' . urlencode('Bitte eine gültige E-Mail-Adresse eingeben.'));
exit;
}
$allowed_qual = ['1jahr', '3jahr'];
if (!in_array($qualifikation, $allowed_qual, true)) {
header('Location: ' . $back . '?error=' . urlencode('Ungültige Qualifikation.'));
exit;
}
$user_id = current_user()['id'];
$now = date('c');
db()->prepare(
'INSERT INTO requests_werben (user_id, status, admin_note, created_at, updated_at, name, email, qualifikation, nachricht)
VALUES (?, \'pending\', \'\', ?, ?, ?, ?, ?, ?)'
)->execute([$user_id, $now, $now, $name, $email, $qualifikation, $nachricht]);
$qual_labels = [
'1jahr' => '1 Jährige Examinierte Pflegekraft',
'3jahr' => '3 Jährige Examinierte Pflegekraft',
];
$config = require __DIR__ . '/../lib/config.php';
smtp_send(
$config,
$config['mail_info'],
'Mitarbeiter werben: ' . current_name(),
"Ein Mitarbeiter wurde empfohlen.\n\n"
. 'Empfohlen von: ' . current_name() . "\n"
. 'Name der empfohlenen Person: ' . $name . "\n"
. 'E-Mail: ' . $email . "\n"
. 'Art der Stelle: ' . ($qual_labels[$qualifikation] ?? $qualifikation) . "\n"
. 'Nachricht: ' . ($nachricht ?: '—') . "\n\n"
. "---\nGesendet über OMSORG Connect"
);
header('Location: ' . $back . '?success=1');
exit;