strtotime($bis)) { header('Location: ' . $back . '?error=' . urlencode('Das Startdatum muss vor dem Enddatum liegen.')); exit; } $user_id = current_user()['id']; $now = date('c'); db()->prepare( 'INSERT INTO requests_urlaubsantrag (user_id, status, admin_note, created_at, updated_at, von, bis, vertretung, nachricht) VALUES (?, \'pending\', \'\', ?, ?, ?, ?, ?, ?)' )->execute([$user_id, $now, $now, $von, $bis, $vertretung, $nachricht]); $config = require __DIR__ . '/../lib/config.php'; smtp_send( $config, $config['mail_sabrina'], 'Neuer Urlaubsantrag: ' . current_name(), "Ein Urlaubsantrag wurde eingereicht.\n\n" . 'Mitarbeiter: ' . current_name() . "\n" . 'Von: ' . $von . "\n" . 'Bis: ' . $bis . "\n" . 'Vertretung: ' . ($vertretung ?: '—') . "\n" . 'Nachricht: ' . ($nachricht ?: '—') . "\n\n" . "---\nGesendet über OMSORG Connect" ); header('Location: ' . $back . '?success=1'); exit;