Gesamt: 65 €
@@ -570,6 +646,7 @@
const summaryBadgePhotos = document.getElementById('summary-badge-photos');
const summaryBadgeBg = document.getElementById('summary-badge-bg');
const summaryBadgeTripod = document.getElementById('summary-badge-tripod');
+ const summaryBadgeCloud = document.getElementById('summary-badge-cloud');
const summaryBadgeTotal = document.getElementById('summary-badge-total');
// Tripod Elements
@@ -581,6 +658,16 @@
const breakdownTripodLabel = document.getElementById('breakdown-tripod-label');
const breakdownTripodCost = document.getElementById('breakdown-tripod-cost');
+ // Cloud Elements
+ const sectionCloudSelect = document.getElementById('section-cloud-select');
+ const statusBadgeCloud = document.getElementById('status-badge-cloud');
+ const cloudRadios = document.querySelectorAll('input[name="selected_cloud"]');
+ const cardWithCloud = document.getElementById('card-with-cloud');
+ const cardWithoutCloud = document.getElementById('card-without-cloud');
+ const breakdownCloudLabel = document.getElementById('breakdown-cloud-label');
+ const breakdownCloudCost = document.getElementById('breakdown-cloud-cost');
+ const calcNonsenseWarning = document.getElementById('calc-nonsense-warning');
+
// Lightbox Elements
const bgImgContainer = document.getElementById('bg-img-container');
const lightboxModal = document.getElementById('bg-lightbox-modal');
@@ -630,6 +717,19 @@
let currentTotalPrice = 65;
let currentBackground = null;
let currentTripod = null;
+ let currentCloud = null;
+
+ function checkNonsenseState() {
+ const isNonsense = (currentPhotos === 0 && currentCloud && currentCloud.includes('Ohne'));
+ if (calcNonsenseWarning) {
+ if (isNonsense) {
+ calcNonsenseWarning.classList.add('visible');
+ } else {
+ calcNonsenseWarning.classList.remove('visible');
+ }
+ }
+ return isNonsense;
+ }
// Calculate upcoming Saturday dynamically
function getUpcomingSaturdayFormatted() {
@@ -727,12 +827,17 @@
// Update Price Breakdown & Capacity Box
if (numPhotos === 0) {
- breakdownPrintLabel.innerHTML = '
Druckmaterial (0 Fotos / rein digital)';
+ breakdownPrintLabel.innerHTML = '
Druckmaterial (0 Fotos / keine Ausdrucke)';
breakdownPrintCost.textContent = '0 €';
- calloutTitle.innerHTML = '
Rein digitale Fotobox-Nutzung';
- calloutDesc.innerHTML = 'Du mietest die Box ohne Fotodrucke. Alle Fotos werden während deines Events digital auf dem Tablet gespeichert und stehen dir anschließend in der Cloud zur Verfügung.';
- summaryBadgePhotos.textContent = '0 Fotos (rein digital)';
+ if (currentCloud && currentCloud.includes('Ohne')) {
+ calloutTitle.innerHTML = '
Keine Fotos ausgewählt!';
+ calloutDesc.innerHTML = '
Achtung: Du hast 0 Ausdrucke und die Cloud-Galerie abgewählt. Bei dieser Buchung erhältst du keinerlei Fotos von deinem Event!';
+ } else {
+ calloutTitle.innerHTML = '
Rein digitale Fotobox-Nutzung';
+ calloutDesc.innerHTML = 'Du mietest die Box ohne Fotodrucke vor Ort. Alle Fotos werden während deines Events digital auf dem Tablet gespeichert und stehen dir anschließend in der Cloud zur Verfügung.';
+ }
+ summaryBadgePhotos.textContent = '0 Fotos (keine Ausdrucke)';
} else {
const packWord = packs === 1 ? 'Paket' : 'Pakete';
breakdownPrintLabel.innerHTML = `
Druckmaterial (${packs} × 54er ${packWord} = ${roundedPhotos} Fotos)`;
@@ -773,6 +878,7 @@
badge.classList.remove('is-snapped');
}
+ checkNonsenseState();
updateDirectMailLink();
}
@@ -797,10 +903,43 @@
updateDirectMailLink();
}
+ function updateCloud(cloudName) {
+ currentCloud = cloudName;
+ if (statusBadgeCloud) {
+ statusBadgeCloud.className = 'selection-status-badge selected';
+ statusBadgeCloud.innerHTML = '
Ausgewählt';
+ }
+ if (breakdownCloudLabel) {
+ if (cloudName.includes('Ohne')) {
+ breakdownCloudLabel.innerHTML = '
Digitale Cloud-Galerie: Abgewählt (kein Online-Speicher)';
+ } else {
+ breakdownCloudLabel.innerHTML = '
Digitale Cloud-Galerie (alle Fotos, inkl. ungedruckte Bilder)';
+ }
+ }
+ if (breakdownCloudCost) {
+ if (cloudName.includes('Ohne')) {
+ breakdownCloudCost.textContent = '0 € (Abgewählt)';
+ breakdownCloudCost.style.color = 'var(--text-muted)';
+ breakdownCloudCost.style.fontWeight = 'normal';
+ } else {
+ breakdownCloudCost.textContent = '0 € (Inklusive)';
+ breakdownCloudCost.style.color = '#10b981';
+ breakdownCloudCost.style.fontWeight = '600';
+ }
+ }
+ if (summaryBadgeCloud) {
+ summaryBadgeCloud.textContent = cloudName.includes('Ohne') ? 'Ohne Cloud' : 'Mit Cloud';
+ summaryBadgeCloud.style.color = '#fff';
+ }
+ checkNonsenseState();
+ updateDirectMailLink();
+ }
+
function updateDirectMailLink() {
if (directMailLink) {
const bgText = currentBackground || 'Noch nicht ausgewählt (bitte abstimmen)';
const tripodText = currentTripod || 'Noch nicht ausgewählt (bitte abstimmen)';
+ const cloudText = currentCloud || 'Noch nicht ausgewählt (bitte abstimmen)';
const subject = encodeURIComponent('Unverbindliche Anfrage Fotobox (Schnappix)');
const body = encodeURIComponent(
`Hallo Jannik,\n\nich habe eine unverbindliche Anfrage zum Verleih deiner Fotobox.\n\n` +
@@ -808,6 +947,7 @@
`- Drucke: ${currentRoundedPhotos} Fotos (${currentPacks} Paket(e) à 54 Fotos)\n` +
`- Hintergrund: ${bgText}\n` +
`- Aufstellung: ${tripodText}\n` +
+ `- Cloud-Galerie: ${cloudText}\n` +
`- Voraussichtlicher Preis: ${currentTotalPrice} €\n\n` +
`Meine Frage / Wünsche:\n`
);
@@ -967,12 +1107,23 @@
});
});
+ // Cloud Radio selection handler
+ cloudRadios.forEach(radio => {
+ radio.addEventListener('change', (e) => {
+ if (cardWithCloud) cardWithCloud.classList.remove('selected');
+ if (cardWithoutCloud) cardWithoutCloud.classList.remove('selected');
+ const parentCard = e.target.closest('.bg-card');
+ if (parentCard) parentCard.classList.add('selected');
+ updateCloud(e.target.value);
+ });
+ });
+
// Handle Booking Form Submit
if (bookingForm) {
bookingForm.addEventListener('submit', async (e) => {
e.preventDefault();
- // Validation for Background & Tripod selection
+ // Validation for Background, Tripod & Cloud selection
if (!currentBackground) {
if (statusBadgeBg) {
statusBadgeBg.classList.add('error-shake');
@@ -997,6 +1148,29 @@
return;
}
+ if (!currentCloud) {
+ if (statusBadgeCloud) {
+ statusBadgeCloud.classList.add('error-shake');
+ setTimeout(() => statusBadgeCloud.classList.remove('error-shake'), 600);
+ }
+ if (sectionCloudSelect) {
+ sectionCloudSelect.scrollIntoView({ behavior: 'smooth', block: 'center' });
+ }
+ alert('Bitte wähle zuerst aus, ob du die kostenlose digitale Cloud-Galerie wünschst oder abbestellst.');
+ return;
+ }
+
+ // Nonsense configuration validation: 0 prints + declined cloud
+ if (checkNonsenseState()) {
+ if (calcNonsenseWarning) {
+ calcNonsenseWarning.classList.add('error-shake');
+ setTimeout(() => calcNonsenseWarning.classList.remove('error-shake'), 600);
+ calcNonsenseWarning.scrollIntoView({ behavior: 'smooth', block: 'center' });
+ }
+ alert('Diese Konfiguration macht keinen Sinn: Bei 0 gedruckten Fotos und ohne Cloud-Galerie erhältst du überhaupt keine Fotos von deinem Event! Bitte wähle entweder Fotodrucke oder die kostenlose Cloud-Galerie aus.');
+ return;
+ }
+
const custName = document.getElementById('cust-name').value.trim();
const custEmail = document.getElementById('cust-email').value.trim();
const custPhone = document.getElementById('cust-phone').value.trim();
@@ -1024,6 +1198,7 @@
packages: currentPacks,
background: currentBackground,
tripod: currentTripod,
+ cloud: currentCloud,
total_price: `${currentTotalPrice} €`,
notes: custNotes
};
@@ -1045,16 +1220,19 @@
bookingAlert.style.display = 'block';
bookingAlertTitle.innerHTML = '
Anfrage erfolgreich übermittelt!';
bookingAlertMsg.innerHTML = `
- Vielen Dank,
${custName}! Deine unverbindliche Anfrage für den
${custDate} (${currentRoundedPhotos} Fotos, Hintergrund: "${currentBackground}", ${currentTripod}) wurde erfolgreich übermittelt.
+ Vielen Dank,
${custName}! Deine unverbindliche Anfrage für den
${custDate} (${currentRoundedPhotos} Fotos, Hintergrund: "${currentBackground}", ${currentTripod}, ${currentCloud}) wurde erfolgreich übermittelt.
Ich prüfe die Verfügbarkeit zum Wunschtermin und melde mich zeitnah persönlich bei dir unter
${custEmail} oder
${custPhone} zur Abstimmung!
`;
bookingForm.reset();
currentBackground = null;
currentTripod = null;
+ currentCloud = null;
bgCards.forEach(c => c.classList.remove('selected'));
if (tripodCardWith) tripodCardWith.classList.remove('selected');
if (tripodCardTable) tripodCardTable.classList.remove('selected');
+ if (cardWithCloud) cardWithCloud.classList.remove('selected');
+ if (cardWithoutCloud) cardWithoutCloud.classList.remove('selected');
if (statusBadgeBg) {
statusBadgeBg.className = 'selection-status-badge';
statusBadgeBg.innerHTML = '
Bitte auswählen';
@@ -1063,12 +1241,20 @@
statusBadgeTripod.className = 'selection-status-badge';
statusBadgeTripod.innerHTML = '
Bitte auswählen';
}
+ if (statusBadgeCloud) {
+ statusBadgeCloud.className = 'selection-status-badge';
+ statusBadgeCloud.innerHTML = '
Bitte auswählen';
+ }
if (breakdownBgLabel) breakdownBgLabel.innerHTML = '
Hintergrund:
Noch nicht ausgewählt';
if (breakdownBgCost) { breakdownBgCost.textContent = 'Auswahl erforderlich'; breakdownBgCost.style.color = '#fbbf24'; breakdownBgCost.style.fontWeight = '500'; }
if (breakdownTripodLabel) breakdownTripodLabel.innerHTML = '
Fotobox-Aufstellung:
Noch nicht ausgewählt';
if (breakdownTripodCost) { breakdownTripodCost.textContent = 'Auswahl erforderlich'; breakdownTripodCost.style.color = '#fbbf24'; breakdownTripodCost.style.fontWeight = '500'; }
+ if (breakdownCloudLabel) breakdownCloudLabel.innerHTML = '
Digitale Cloud-Galerie:
Noch nicht ausgewählt';
+ if (breakdownCloudCost) { breakdownCloudCost.textContent = 'Auswahl erforderlich'; breakdownCloudCost.style.color = '#fbbf24'; breakdownCloudCost.style.fontWeight = '500'; }
if (summaryBadgeBg) { summaryBadgeBg.textContent = 'Bitte wählen'; summaryBadgeBg.style.color = '#fbbf24'; }
if (summaryBadgeTripod) { summaryBadgeTripod.textContent = 'Bitte wählen'; summaryBadgeTripod.style.color = '#fbbf24'; }
+ if (summaryBadgeCloud) { summaryBadgeCloud.textContent = 'Bitte wählen'; summaryBadgeCloud.style.color = '#fbbf24'; }
+ checkNonsenseState();
// Reset slider to default 54
updateCalculator(54);
// Scroll smoothly to alert
@@ -1085,7 +1271,7 @@
Die Anfrage konnte leider nicht automatisch zugestellt werden (${error.message}).
Bitte klicke hier, um deine Anfrage direkt per E-Mail zu senden:
Jetzt per Mail an jannik.schnappix@gmail.com senden
.
diff --git a/verleih_backend.php b/verleih_backend.php
index a0f56f8..950d524 100644
--- a/verleih_backend.php
+++ b/verleih_backend.php
@@ -28,6 +28,7 @@ $requestedPhotos = isset($inputData['requested_photos']) ? intval($inputData['re
$packages = isset($inputData['packages']) ? intval($inputData['packages']) : 0;
$background = isset($inputData['background']) ? trim(htmlspecialchars($inputData['background'])) : '';
$tripod = isset($inputData['tripod']) ? trim(htmlspecialchars($inputData['tripod'])) : '';
+$cloud = isset($inputData['cloud']) ? trim(htmlspecialchars($inputData['cloud'])) : '';
$totalPrice = isset($inputData['total_price']) ? trim(htmlspecialchars($inputData['total_price'])) : '50 €';
$notes = isset($inputData['notes']) ? trim(htmlspecialchars($inputData['notes'])) : 'Keine Anmerkungen';
@@ -59,6 +60,24 @@ if (empty($tripod) || $tripod === 'null') {
exit;
}
+if (empty($cloud) || $cloud === 'null') {
+ http_response_code(400);
+ echo json_encode([
+ 'success' => false,
+ 'error' => 'Bitte wähle aus, ob du die digitale Cloud-Galerie wünschst oder abbestellst.'
+ ]);
+ exit;
+}
+
+if ($photos === 0 && (strpos($cloud, 'Ohne') !== false || stripos($cloud, 'kein') !== false)) {
+ http_response_code(400);
+ echo json_encode([
+ 'success' => false,
+ 'error' => 'Diese Konfiguration macht keinen Sinn: Bei 0 gedruckten Fotos und ohne Cloud-Galerie erhältst du überhaupt keine Fotos von deinem Event.'
+ ]);
+ exit;
+}
+
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
http_response_code(400);
echo json_encode([
@@ -86,7 +105,7 @@ $ntfyMessage = "🎉 NEUE FOTOBOX-ANFRAGE (KOSTENSCHÄTZUNG)!\n\n"
. "📸 Ausdrucke: $photoLine\n"
. "🖼️ Hintergrund: $background (0 € inklusive)\n"
. "📐 Aufstellung: $tripod (0 €)\n"
- . "☁️ Cloud-Galerie: Inklusive (alle Fotos digital, auch ungedruckte)\n"
+ . "☁️ Cloud-Galerie: $cloud (0 €)\n"
. "💰 Geschätzter Gesamtpreis: $totalPrice (Privatverleih)\n"
. "⚖️ Haftung bei Beschädigung: Vom Kunden bestätigt\n\n"
. "📝 Anmerkungen:\n$notes";
@@ -135,6 +154,7 @@ $newBooking = [
'packages' => $packages,
'background' => $background,
'tripod' => $tripod,
+ 'cloud' => $cloud,
'total_price' => $totalPrice,
'notes' => $notes,
'ntfy_status' => ($ntfyHttpCode >= 200 && $ntfyHttpCode < 300) ? 'sent' : 'failed'