diff --git a/ReportGenerator.php b/ReportGenerator.php new file mode 100644 index 0000000..d1c3dcb --- /dev/null +++ b/ReportGenerator.php @@ -0,0 +1,132 @@ +answers = $answers; + } + + public function generate() + { + $this->calculateScore(); + $this->generateRecommendations(); + + // For now, let's just return the data + return [ + 'score' => $this->score, + 'recommendations' => $this->recommendations, + 'answers' => $this->answers + ]; + } + + private function calculateScore() + { + // Simple scoring logic - this can be made more complex + // We will just assign points for certain answers + $this->score = 0; + + // Q4 - Main Goal + if (isset($this->answers['q4']) && in_array('⏱️ Zeit sparen durch Automatisierung', $this->answers['q4'])) { + $this->score += 20; + } + if (isset($this->answers['q4']) && in_array('🚀 Skalierung vorbereiten', $this->answers['q4'])) { + $this->score += 10; + } + + // Q5 - Digital Maturity + if (isset($this->answers['q5'])) { + $this->score += (5 - intval($this->answers['q5'][0])) * 5; // Less digital = more potential = higher score + } + + // Q8 - Weekly Admin Time + $admin_time_scores = ['⏱️ 0-5 Stunden' => 0, '⏰ 6-10 Stunden' => 10, '🕐 11-15 Stunden' => 20, '🕑 16-20 Stunden' => 30, '🕒 Über 20 Stunden' => 40]; + if (isset($this->answers['q8']) && isset($admin_time_scores[$this->answers['q8'][0]])) { + $this->score += $admin_time_scores[$this->answers['q8'][0]]; + } + + // Q10 - Time Saving Goal + $saving_goal_scores = ['⏱️ 2–5 Stunden' => 5, '⏰ 6–10 Stunden' => 10, '🕐 11–15 Stunden' => 15, '🕑 16–20 Stunden' => 20, '🚀 Mehr als 20 Stunden' => 25]; + if (isset($this->answers['q10']) && isset($saving_goal_scores[$this->answers['q10'][0]])){ + $this->score += $saving_goal_scores[$this->answers['q10'][0]]; + } + + // Q12 - Technology Openness + if (isset($this->answers['q12'])) { + $this->score += intval($this->answers['q12'][0]) * 2; // More open = higher score + } + + // Clamp score between 0 and 100 + $this->score = max(0, min($this->score, 100)); + } + + private function generateRecommendations() + { + $this->recommendations = []; + + if ($this->score >= 75) { + $this->recommendations[] = [ + 'title' => 'Ihr Automatisierungspotenzial ist SEHR HOCH!', + 'text' => 'Ihre Antworten deuten auf ein enormes Potenzial für Effizienzsteigerung durch KI und Automatisierung hin. Sie sind bereit, die nächsten Schritte zu gehen und könnten schnell signifikante Ergebnisse sehen.', + 'type' => 'high' + ]; + } elseif ($this->score >= 50) { + $this->recommendations[] = [ + 'title' => 'Ihr Automatisierungspotenzial ist HOCH.', + 'text' => 'Sie haben bereits einige digitale Prozesse, aber es gibt noch viel Raum für Optimierung. Eine gezielte Automatisierungsstrategie könnte Ihnen helfen, wertvolle Zeit zu sparen und Ihr Geschäft zu skalieren.', + 'type' => 'medium' + ]; + } else { + $this->recommendations[] = [ + 'title' => 'Guter Start, aber es gibt noch Potenzial.', + 'text' => 'Ihre aktuellen Prozesse sind teilweise digitalisiert, aber es gibt noch viele Möglichkeiten, manuelle Aufgaben zu reduzieren. Fangen Sie mit kleinen, gezielten Automatisierungen an, um den größten Nutzen zu erzielen.', + 'type' => 'low' + ]; + } + + // Add recommendations based on specific answers + if (isset($this->answers['q6']) && in_array('📧 E-Mails & Nachrichten beantworten', $this->answers['q6'])) { + $this->recommendations[] = [ + 'title' => 'E-Mail Flut bändigen', + 'text' => 'Ein KI-gestützter Assistent kann Ihre E-Mails vorsortieren, Standardanfragen automatisch beantworten und Ihnen helfen, den Überblick zu behalten.', + 'type' => 'specific' + ]; + } + if (isset($this->answers['q9']) && in_array('🤖 Kundenservice (Chatbot, FAQ)', $this->answers['q9'])) { + $this->recommendations[] = [ + 'title' => 'Kundenservice automatisieren', + 'text' => 'Ein Chatbot kann häufig gestellte Fragen rund um die Uhr beantworten und Anfragen an die richtigen Mitarbeiter weiterleiten, was Ihr Team entlastet.', + 'type' => 'specific' + ]; + } + } + + public function sendEmail($recipientEmail) + { + require_once __DIR__ . '/mail/MailService.php'; + + // Generate the HTML body + $htmlBody = $this->getHtmlEmailBody(); + $textBody = strip_tags($htmlBody); + + // Send the email + $subject = 'Ihr persönlicher KI-Fit Check Report'; + return MailService::sendMail($recipientEmail, $subject, $htmlBody, $textBody); + } + + private function getHtmlEmailBody() + { + // Make report data available to the template + $score = $this->score; + $recommendations = $this->recommendations; + $answers = $this->answers; + + ob_start(); + include __DIR__ . '/email_template.php'; + return ob_get_clean(); + } +} diff --git a/assets/css/custom.css b/assets/css/custom.css new file mode 100644 index 0000000..b5de9be --- /dev/null +++ b/assets/css/custom.css @@ -0,0 +1,51 @@ +body { + font-family: 'Inter', sans-serif; + background-color: #f8f9fa; +} + +.hero-section { + padding: 120px 0; + background: linear-gradient(45deg, #007bff, #6610f2); + position: relative; + margin-top: 56px; /* Adjust for fixed navbar */ +} + +.navbar-brand { + color: #007bff !important; +} + +.card { + border-radius: 0.5rem; + transition: transform 0.2s ease-in-out; +} + +.card:hover { + transform: translateY(-5px); +} + +.btn-primary { + background-color: #007bff; + border-color: #007bff; + border-radius: 0.5rem; + padding: 12px 24px; + font-weight: bold; + transition: background-color 0.2s; +} + +.btn-primary:hover { + background-color: #0056b3; + border-color: #0056b3; +} + +footer a i { + font-size: 1.5rem; + transition: color 0.2s; +} + +footer a:hover i { + color: #007bff; +} + +section { + scroll-margin-top: 70px; /* Offset for navbar */ +} diff --git a/assets/css/questionnaire.css b/assets/css/questionnaire.css new file mode 100644 index 0000000..8b46eb8 --- /dev/null +++ b/assets/css/questionnaire.css @@ -0,0 +1,414 @@ +/* --- DESIGN TOKENS (from prompt) --- */ +:root { + --bg-primary: #0A0E1A; + --bg-secondary: #0F1728; + --cyan: #00F5FF; + --purple: #A855F7; + --text-white: #FFFFFF; + --text-gray: #CBD5E1; + --font-heading: 'Space Grotesk', sans-serif; + --font-body: 'Inter', sans-serif; + --space-4: 32px; + --space-6: 48px; + --space-8: 64px; +} + +body { + margin: 0; + font-family: var(--font-body); + background-color: var(--bg-primary); + color: var(--text-white); +} + +.questionnaire-container { + min-height: 100vh; + background: var(--bg-primary); + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + position: relative; + overflow-x: hidden; + padding: 20px; +} + +.screen { + display: none; + width: 100%; + max-width: 700px; + text-align: center; +} + +.screen.active { + display: block; +} + +.screen-group { + margin-bottom: var(--space-8); +} + +.section-title { + font: 24px var(--font-heading); + color: var(--purple); + text-transform: uppercase; + letter-spacing: 0.1em; + margin-bottom: var(--space-6); + text-align: center; +} + +/* --- PROGRESS BAR --- */ +.progress-container { + width: 100%; + max-width: 700px; + position: fixed; + top: 20px; + left: 50%; + transform: translateX(-50%); + z-index: 10; + padding: 0 20px; + display: none; /* Initially hidden */ +} + +.progress-bar { + width: 100%; + background-color: var(--bg-secondary); + height: 10px; + border-radius: 5px; + overflow: hidden; +} + +.progress-bar-inner { + height: 100%; + width: 0; + background: linear-gradient(90deg, var(--cyan), var(--purple)); + transition: width 0.3s ease-in-out; +} + +.progress-text { + text-align: right; + font-size: 14px; + color: var(--text-gray); + margin-top: 5px; +} + + +/* --- WELCOME SCREEN --- */ +.welcome-screen { + min-height: 100vh; + padding: var(--space-6) var(--space-4); + display: flex; + align-items: center; + justify-content: center; +} + +.welcome-content { + max-width: 700px; + text-align: center; +} + +.welcome-badge { + display: inline-block; + padding: 8px 20px; + background: linear-gradient(135deg, var(--cyan), var(--purple)); + border-radius: 50px; + font: 14px var(--font-heading); + font-weight: bold; + text-transform: uppercase; + color: var(--bg-primary); + letter-spacing: 0.1em; + margin-bottom: var(--space-4); +} + +.welcome-title { + font: 56px var(--font-heading); + font-weight: bold; + color: var(--text-white); + line-height: 1.2; + margin-bottom: 24px; +} + +.gradient-text { + background: linear-gradient(135deg, var(--cyan), var(--purple)); + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; +} + +.welcome-description { + font: 20px var(--font-body); + color: var(--text-gray); + line-height: 1.6; + margin-bottom: var(--space-6); +} + +.welcome-benefits { + display: flex; + gap: var(--space-4); + justify-content: center; + margin-bottom: var(--space-6); + flex-wrap: wrap; +} + +.benefit-item { + display: flex; + align-items: center; + gap: 8px; + font-size: 16px; + color: var(--text-gray); +} + +.welcome-note { + font-size: 14px; + color: var(--text-gray); + margin-top: var(--space-4); +} + +/* --- QUESTION SCREENS --- */ +.question-screen h3 { + font: 36px var(--font-heading); + color: var(--text-white); + margin-bottom: var(--space-6); +} + +.options-container { + display: flex; + flex-direction: column; + gap: 15px; + margin-bottom: var(--space-6); +} + +.option-label { + display: block; + background: var(--bg-secondary); + padding: 20px; + border-radius: 10px; + border: 1px solid transparent; + cursor: pointer; + transition: all 0.2s ease-in-out; + text-align: left; +} + +.option-label:hover { + border-color: var(--cyan); +} + +.option-label input { + margin-right: 15px; + accent-color: var(--purple); +} + +.option-label input:checked + span { + color: var(--cyan); +} + +input[type="text"], +textarea { + width: 100%; + background: var(--bg-secondary); + border: 1px solid var(--text-gray); + border-radius: 10px; + padding: 15px; + color: var(--text-white); + font-family: var(--font-body); + font-size: 16px; + box-sizing: border-box; +} + +textarea { + min-height: 120px; +} + +.hint { + font-size: 14px; + color: var(--text-gray); + text-align: left; + margin-top: 10px; +} + +.scale-container { + display: flex; + justify-content: space-between; + align-items: center; + gap: 10px; +} + +.scale-container > span { + font-size: 14px; + color: var(--text-gray); + flex: 1; + text-align: center; +} + +.scale-label { + display: flex; + flex-direction: column; + align-items: center; + cursor: pointer; +} + +.scale-label input { + accent-color: var(--purple); +} + +.scale-label span { + margin-top: 5px; +} + +/* --- NAVIGATION --- */ +.navigation-buttons { + display: flex; + justify-content: center; + gap: 20px; + margin-top: var(--space-4); +} + +.btn-start, .btn-next, .btn-prev, .btn-submit { + padding: 15px 30px; + border-radius: 50px; + border: 1px solid var(--cyan); + background: transparent; + color: var(--cyan); + font-family: var(--font-heading); + font-size: 16px; + cursor: pointer; + transition: all 0.3s ease; +} + +.btn-start, .btn-next, .btn-submit { + background: var(--cyan); + color: var(--bg-primary); +} + +.btn-start:hover, .btn-next:hover, .btn-submit:hover { + background: var(--purple); + border-color: var(--purple); + color: var(--text-white); + transform: translateY(-2px); + box-shadow: 0 5px 15px rgba(168, 85, 247, 0.3); +} + +.btn-prev { + color: var(--text-gray); + border-color: var(--text-gray); +} + +.btn-prev:hover { + background: var(--bg-secondary); + color: var(--text-white); + border-color: var(--text-white); +} + +.consent-label { + display: flex; + align-items: flex-start; /* Align items to the top */ + text-align: left; + gap: 15px; /* Space between checkbox and text */ +} + +.consent-label input[type="checkbox"] { + margin-top: 5px; /* Align checkbox with the first line of text */ + flex-shrink: 0; /* Prevent checkbox from shrinking */ +} + +.consent-label a { + color: var(--cyan); + text-decoration: underline; +} + +/* --- Final Screens --- */ +#email-screen h3, #consent-screen h3 { + font-size: 24px; + color: var(--text-gray); + font-weight: 400; + margin-bottom: var(--space-6); +} + +#email-screen .options-container, #consent-screen .options-container { + max-width: 500px; /* Narrower container for these steps */ + margin-left: auto; + margin-right: auto; +} + +#thank-you-screen h2 { + font: 48px var(--font-heading); + color: var(--text-white); + margin-bottom: 24px; + background: linear-gradient(135deg, var(--cyan), var(--purple)); + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; +} + +#thank-you-screen p { + font-size: 20px; + color: var(--text-gray); + line-height: 1.6; + margin-bottom: var(--space-4); +} + +#email-input, #consent-checkbox { + margin-bottom: var(--space-4); +} + +#email-input { + width: 100%; + padding: 15px; + background: var(--bg-secondary); + border: 1px solid var(--text-gray); + border-radius: 10px; + color: var(--text-white); + font-size: 16px; +} + +/* --- RESPONSIVE --- */ +@media (max-width: 768px) { + :root { + --space-4: 24px; + --space-6: 32px; + --space-8: 48px; + } + + .welcome-title { + font-size: 40px; + } + + .welcome-description { + font-size: 18px; + } + + .question-screen h3 { + font-size: 28px; + } + + #email-screen h3, #consent-screen h3 { + font-size: 20px; + } + + #thank-you-screen h2 { + font-size: 36px; + } + + #thank-you-screen p { + font-size: 18px; + } + + .progress-container { + padding: 0 15px; + } + + .navigation-buttons { + flex-direction: column; + gap: 15px; + } + + .btn-start, .btn-next, .btn-prev, .btn-submit { + width: 100%; + } + + .scale-container { + flex-direction: column; + gap: 20px; + } + + .scale-container > span { + text-align: center; + } +} diff --git a/assets/js/main.js b/assets/js/main.js new file mode 100644 index 0000000..97c0523 --- /dev/null +++ b/assets/js/main.js @@ -0,0 +1,32 @@ +// Bootstrap 5 form validation +(function () { + 'use strict' + + // Fetch all the forms we want to apply custom Bootstrap validation styles to + var forms = document.querySelectorAll('.needs-validation') + + // Loop over them and prevent submission + Array.prototype.slice.call(forms) + .forEach(function (form) { + form.addEventListener('submit', function (event) { + if (!form.checkValidity()) { + event.preventDefault() + event.stopPropagation() + } + + form.classList.add('was-validated') + }, false) + }) + + const contactForm = document.getElementById('contactForm'); + if(contactForm) { + contactForm.addEventListener('submit', function(e) { + if (!contactForm.checkValidity()) { + e.preventDefault(); + e.stopPropagation(); + } + contactForm.classList.add('was-validated'); + }); + } + +})() diff --git a/assets/js/questionnaire.js b/assets/js/questionnaire.js new file mode 100644 index 0000000..cd31075 --- /dev/null +++ b/assets/js/questionnaire.js @@ -0,0 +1,151 @@ +document.addEventListener('DOMContentLoaded', () => { + const screens = Array.from(document.querySelectorAll('.screen')); + const progressBar = document.getElementById('progressBar'); + const progressText = document.getElementById('progressText'); + const progressContainer = document.querySelector('.progress-container'); + const form = document.getElementById('questionnaire-form'); + const totalQuestions = 15; // Only count the actual questions + + let currentScreenIndex = 0; + + // --- Core Navigation --- + window.startQuestionnaire = () => { + const welcomeScreen = document.getElementById('welcome-screen'); + const firstQuestion = document.getElementById('question-1'); + if (welcomeScreen) welcomeScreen.classList.remove('active'); + if (firstQuestion) firstQuestion.classList.add('active'); + currentScreenIndex = screens.indexOf(firstQuestion); + progressContainer.style.display = 'flex'; + updateProgress(); + }; + + window.navigate = (direction) => { + if (direction > 0 && !validateCurrentScreen()) { + // You can add a user-facing warning here if you like + console.warn("Validation failed for the current screen."); + return; + } + + const nextIndex = currentScreenIndex + direction; + if (nextIndex >= 0 && nextIndex < screens.length) { + screens[currentScreenIndex].classList.remove('active'); + currentScreenIndex = nextIndex; + screens[currentScreenIndex].classList.add('active'); + updateProgress(); + } + }; + + const updateProgress = () => { + const activeScreen = screens[currentScreenIndex]; + let currentQuestionNumber = 0; + + if (activeScreen && activeScreen.dataset.questionId) { + const id = parseInt(activeScreen.dataset.questionId); + if (id <= totalQuestions) { + currentQuestionNumber = id; + } else { + // For email/consent screens, show progress as 15/15 + currentQuestionNumber = totalQuestions; + } + } else if (activeScreen.id === 'welcome-screen') { + currentQuestionNumber = 0; + } + + const progressPercentage = (currentQuestionNumber / totalQuestions) * 100; + progressBar.style.width = `${progressPercentage}%`; + progressText.textContent = currentQuestionNumber; + }; + + const validateCurrentScreen = () => { + const activeScreen = screens[currentScreenIndex]; + const questionId = activeScreen.dataset.questionId; + + // No validation needed for welcome screen or thank you screen + if (!questionId) return true; + + if (questionId <= totalQuestions) { + const inputs = activeScreen.querySelectorAll('input, textarea'); + if (inputs.length === 0) return true; + + if (inputs[0].type === 'radio' || inputs[0].type === 'checkbox') { + return Array.from(inputs).some(input => input.checked); + } + return inputs[0].value.trim() !== ''; + } + + if (questionId == 16) { // Email screen + const emailInput = document.getElementById('email-input'); + // Basic regex for email validation + const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; + return emailInput && emailInput.value.trim() !== '' && emailRegex.test(emailInput.value); + } + + if (questionId == 17) { // Consent screen + const consentCheckbox = document.getElementById('consent-checkbox'); + return consentCheckbox && consentCheckbox.checked; + } + + return true; + }; + + document.querySelectorAll('input.auto-advance').forEach(input => { + input.addEventListener('change', () => { + if (input.checked) { + setTimeout(() => navigate(1), 300); + } + }); + }); + + form.addEventListener('submit', (e) => { + e.preventDefault(); + if (!validateCurrentScreen()) { + alert('Bitte überprüfen Sie Ihre Eingabe und stimmen Sie den Datenschutzbestimmungen zu.'); + return; + } + + const submitButton = form.querySelector('button[type="submit"]'); + submitButton.disabled = true; + submitButton.textContent = 'Wird gesendet...'; + + const formData = new FormData(form); + + fetch('submit.php', { + method: 'POST', + body: formData + }) + .then(response => response.json()) + .then(data => { + if (data.success) { + // Show thank you screen + const thankYouScreen = document.getElementById('thank-you-screen'); + screens[currentScreenIndex].classList.remove('active'); + if(thankYouScreen) { + thankYouScreen.classList.add('active'); + currentScreenIndex = screens.indexOf(thankYouScreen); + progressContainer.style.display = 'none'; // Hide progress on thank you + } + } else { + alert('Fehler: ' + data.error); + submitButton.disabled = false; + submitButton.textContent = 'Absenden & Report erhalten →'; + } + }) + .catch(error => { + console.error('Fetch Error:', error); + alert('Ein unerwarteter Fehler ist aufgetreten. Bitte versuchen Sie es später erneut.'); + submitButton.disabled = false; + submitButton.textContent = 'Absenden & Report erhalten →'; + }); + }); + + // Initial setup + const firstScreen = document.getElementById('welcome-screen'); + if(firstScreen) { + currentScreenIndex = screens.indexOf(firstScreen); + firstScreen.classList.add('active'); + } else { + screens[0].classList.add('active'); + } + progressContainer.style.display = 'none'; + updateProgress(); +}); \ No newline at end of file diff --git a/assets/pasted-20251207-225037-0f07b2e1.png b/assets/pasted-20251207-225037-0f07b2e1.png new file mode 100644 index 0000000..f2c1702 Binary files /dev/null and b/assets/pasted-20251207-225037-0f07b2e1.png differ diff --git a/email_template.php b/email_template.php new file mode 100644 index 0000000..e6ed3fe --- /dev/null +++ b/email_template.php @@ -0,0 +1,52 @@ + + + + + + + Ihr KI-Fit Check Report + + + +
+
+

Ihr KI-Potenzial Score

+
/ 100
+
+
+

Vielen Dank für Ihre Teilnahme am KI-Fit Check. Basierend auf Ihren Antworten haben wir eine erste Einschätzung und Empfehlungen für Sie erstellt.

+ +

Ihre Top-Empfehlungen

+ +
+

+

+
+ + +

Nächste Schritte

+

Möchten Sie eine detaillierte Analyse und einen konkreten Umsetzungsplan? Vereinbaren Sie ein kostenloses Erstgespräch mit einem unserer KI-Experten.

+

+ Jetzt Termin vereinbaren +

+
+ +
+ + diff --git a/index.php b/index.php index 7205f3d..673bba5 100644 --- a/index.php +++ b/index.php @@ -1,150 +1,195 @@ - - - New Style - - - - - - - - - - - - - - - - - - - + + + Future Now - AI Potential Unlocked + + + + + + + + + + + + + + + + + + -
-
-

Analyzing your requirements and generating your website…

-
- Loading… -
-

AI is collecting your requirements and applying the first changes.

-

This page will update automatically as the plan is implemented.

-

Runtime: PHP — UTC

-
-
- + + + +
+
+

Unlock Your Business's AI Potential

+

Take our free 5-minute AI-Check and get a personalized blueprint for success.

+ Start AI-Check Now +
+
+ +
+
+
+
+

What is the AI-Check?

+

Our AI-Check is a quick and easy questionnaire designed to assess your company's current AI integration status. In just 5 minutes, we can provide you with a personalized blueprint, a clear roadmap, and concrete AI use cases for your industry.

+
+
+ +
+
+
+ +
+
+

Your Personalized AI Blueprint

+

Actionable recommendations for immediate implementation.

+
+
+
+
+
+ +
Clear Roadmap
+

A step-by-step guide to integrating AI into your business.

+
+
+
+
+
+
+ +
Concrete Use-Cases
+

Discover AI applications specific to your industry and needs.

+
+
+
+
+
+
+ +
Immediate Implementation
+

Actionable advice you can use right away to gain an AI advantage.

+
+
+
+
+
+ +
+
+
+
+

Contact Us

+

Have questions? We'd love to hear from you.

+
+ + + + + + + + +
+
+ + +
A name is required.
+
+
+ + +
A valid email is required.
+
+
+ + +
A message is required.
+
+
+ +
+
+
+
+
+
+ + + + + - + \ No newline at end of file diff --git a/privacy.php b/privacy.php new file mode 100644 index 0000000..f2c30b4 --- /dev/null +++ b/privacy.php @@ -0,0 +1,22 @@ + + + + + + + Datenschutzerklärung + + + +

Datenschutzerklärung

+

Hier wird in Kürze eine ausführliche Datenschutzerklärung stehen.

+

Wir nehmen den Schutz Ihrer persönlichen Daten sehr ernst. Die Nutzung unserer Webseite ist in der Regel ohne Angabe personenbezogener Daten möglich. Soweit auf unseren Seiten personenbezogene Daten (beispielsweise Name, Anschrift oder E-Mail-Adressen) erhoben werden, erfolgt dies, soweit möglich, stets auf freiwilliger Basis.

+

Diese Daten werden ohne Ihre ausdrückliche Zustimmung nicht an Dritte weitergegeben. Wir weisen darauf hin, dass die Datenübertragung im Internet (z.B. bei der Kommunikation per E-Mail) Sicherheitslücken aufweisen kann. Ein lückenloser Schutz der Daten vor dem Zugriff durch Dritte ist nicht möglich.

+ Zurück zur Startseite + + diff --git a/questionnaire.php b/questionnaire.php new file mode 100644 index 0000000..a634643 --- /dev/null +++ b/questionnaire.php @@ -0,0 +1,164 @@ + [ + 1 => ['type' => 'single', 'text' => 'Wie groß ist dein Unternehmen?', 'options' => ['👤 1 Person', '👥 2–5 Mitarbeiter', '👨‍👩‍👧‍👦 6–20 Mitarbeiter', '🏢 21–50 Mitarbeiter', '🏭 50+ Mitarbeiter'], 'auto-advance' => true], + 2 => ['type' => 'text', 'text' => 'In welcher Branche bist du tätig?', 'placeholder' => 'z.B. Marketing, E-Commerce, Beratung, Handwerk, Immobilien, Gesundheitswesen', 'maxLength' => 100], + 3 => ['type' => 'multiple', 'text' => 'Welches Geschäftsmodell nutzt du? (Mehrfachauswahl)', 'options' => ['💼 Dienstleistung', '🛒 Handel', '💡 Coaching / Beratung', '📢 Agentur', '🖥️ E-Commerce', '📋 Sonstiges']], + 4 => ['type' => 'single', 'text' => 'Was ist dein wichtigstes Ziel in den nächsten 3 Monaten?', 'options' => ['📈 Mehr Leads generieren', '💰 Umsatz steigern', '⏱️ Zeit sparen durch Automatisierung', '📊 Besseren Überblick über Prozesse', '🚀 Skalierung vorbereiten'], 'auto-advance' => true], + 5 => ['type' => 'scale', 'text' => 'Wie digital sind deine aktuellen Abläufe?', 'min' => 1, 'max' => 5, 'labels' => ['Sehr gering (meist analog/manuell)', 'Sehr hoch (vollständig digital)'], 'auto-advance' => true], + ], + "ENGPÄSSE & AUTOMATISIERUNG" => [ + 6 => ['type' => 'multiple', 'text' => 'Welche Aufgaben kosten dich am meisten Zeit? (Mehrfachauswahl)', 'options' => ['📧 E-Mails & Nachrichten beantworten', '📅 Terminverwaltung', '📝 Angebote & Rechnungen erstellen', '📱 Social Media & Content', '🤝 Kundenanfragen bearbeiten', '📊 Verwaltung & Backoffice', '📄 Dokumentation']], + 7 => ['type' => 'textarea', 'text' => 'Beschreibe deinen größten "Flaschenhals" im Tagesgeschäft:', 'placeholder' => 'z.B. Ich verliere täglich 3 Stunden mit manueller Dateneingabe in verschiedene Systeme. Kundenanfragen kommen über 5 Kanäle und ich verliere den Überblick.', 'maxLength' => 300, 'hint' => 'Tipp: Drücken Sie Strg+Enter für schnelle Eingabe'], + 8 => ['type' => 'single', 'text' => 'Wie viel Zeit verbringst du pro Woche mit Admin-Aufgaben?', 'options' => ['⏱️ 0-5 Stunden', '⏰ 6-10 Stunden', '🕐 11-15 Stunden', '🕑 16-20 Stunden', '🕒 Über 20 Stunden'], 'auto-advance' => true], + 9 => ['type' => 'multiple', 'text' => 'Welche Bereiche möchtest du automatisieren? (Mehrfachauswahl)', 'options' => ['🤖 Kundenservice (Chatbot, FAQ)', '📧 E-Mail-Marketing & Follow-ups', '📱 Social Media Posting', '📊 Leadqualifizierung & CRM', '📄 Dokumentenerstellung', '📅 Terminbuchung', '💰 Rechnungen & Buchhaltung', '📈 Datenanalyse & Reporting']], + 10 => ['type' => 'single', 'text' => 'Wie viel Zeit möchtest du pro Woche durch KI einsparen?', 'options' => ['⏱️ 2–5 Stunden', '⏰ 6–10 Stunden', '🕐 11–15 Stunden', '🕑 16–20 Stunden', '🚀 Mehr als 20 Stunden'], 'auto-advance' => true], + ], + "BEREITSCHAFT & UMSETZUNG" => [ + 11 => ['type' => 'multiple', 'text' => 'Welche KI-Tools nutzt du bereits? (Mehrfachauswahl)', 'options' => ['ChatGPT', 'Google Gemini', 'Claude', 'Midjourney / Bildgeneratoren', 'Automatisierungstools (Zapier, Make)', '❌ Noch keine KI-Tools']], + 12 => ['type' => 'scale', 'text' => 'Wie offen bist du für neue Technologien?', 'min' => 1, 'max' => 5, 'labels' => ['Sehr skeptisch', 'Sehr aufgeschlossen & experimentierfreudig'], 'auto-advance' => true], + 13 => ['type' => 'single', 'text' => 'Wie schnell möchtest du mit KI-Automatisierung starten?', 'options' => ['🚀 Sofort (innerhalb 1 Woche)', '⚡ Sehr bald (1-2 Wochen)', '📅 Innerhalb 1 Monat', '🗓️ In 1-3 Monaten', '💭 Erstmal nur informieren'], 'auto-advance' => true], + 14 => ['type' => 'multiple', 'text' => 'Was hält dich aktuell von KI ab? (Mehrfachauswahl)', 'options' => ['🤔 Zu kompliziert / fehlendes Know-how', '💰 Unklare Kosten', '⏰ Keine Zeit für Implementierung', '🔒 Datenschutz-Bedenken', '🎯 Weiß nicht, wo ich anfangen soll', '✅ Nichts, ich bin bereit!']], + 15 => ['type' => 'single', 'text' => 'Wie fühlst du dich gerade?', 'options' => ['😰 Überfordert mit allem', '😐 Neutral / Abwartend', '😊 Motiviert, etwas zu ändern', '🚀 Sehr motiviert & bereit loszulegen'], 'auto-advance' => true], + ] +]; +$total_questions = 17; +?> + + + + + + KI-Fit Check + + + + + + +
+ +
+
+
0/15
+
+ + +
+
+
KI-FIT CHECK
+

Ihre 3-Minuten KI-Analyse

+

Beantworten Sie 15 kurze Fragen zu Ihrem Unternehmen. Unsere KI analysiert Ihre Antworten und erstellt einen personalisierten Fahrplan zur Automatisierung.

+
+
100% kostenlos
+
⏱️ Nur 3 Minuten
+
📊 Sofortiger Report
+
+ +

Ihre Daten werden vertraulich behandelt und DSGVO-konform verarbeitet.

+
+
+ + +
+ $questions) { + echo "
"; + echo "

{$section_title}

"; + foreach ($questions as $id => $q) { + echo "
"; + echo "

{$q['text']}

"; + echo "
"; + + switch ($q['type']) { + case 'single': + case 'multiple': + $inputType = $q['type'] == 'single' ? 'radio' : 'checkbox'; + foreach ($q['options'] as $option) { + echo ""; + } + break; + case 'text': + echo ""; + break; + case 'textarea': + echo ""; + if (isset($q['hint'])) { + echo "

{$q['hint']}

"; + } + break; + case 'scale': + echo "
"; + echo "{$q['labels'][0]}"; + for ($i = $q['min']; $i <= $q['max']; $i++) { + echo ""; + } + echo "{$q['labels'][1]}"; + echo "
"; + break; + } + + echo "
"; // .options-container + echo ""; // .navigation-buttons + echo "
"; // .question-screen + $q_number++; + } + echo "
"; // .screen-group + } + ?> + + +
+

Fast geschafft!

+

Geben Sie Ihre E-Mail-Adresse ein, um Ihren personalisierten Report zu erhalten.

+
+ +
+ +
+ + + + + +
+

Vielen Dank!

+

Ihr personalisierter KI-Fahrplan wird jetzt erstellt und Ihnen in Kürze per E-Mail zugesendet.

+
+
+
+ + + \ No newline at end of file diff --git a/submit.php b/submit.php new file mode 100644 index 0000000..8185435 --- /dev/null +++ b/submit.php @@ -0,0 +1,63 @@ + 'Invalid request method.']); + exit; +} + +$post_data = $_POST; + +// Basic validation +if (!isset($post_data['email']) || !filter_var($post_data['email'], FILTER_VALIDATE_EMAIL)) { + http_response_code(400); // Bad Request + echo json_encode(['error' => 'Invalid or missing email address.']); + exit; +} + +if (!isset($post_data['consent']) || $post_data['consent'] !== 'on') { + http_response_code(400); // Bad Request + echo json_encode(['error' => 'Consent is required.']); + exit; +} + +// Generate the report +$generator = new ReportGenerator($post_data); +$report_data = $generator->generate(); + +// Check for mail configuration before attempting to send +$mailConfig = require __DIR__ . '/mail/config.php'; +if (empty($mailConfig['smtp_host']) || empty($mailConfig['smtp_user']) || empty($mailConfig['smtp_pass'])) { + http_response_code(500); + echo json_encode([ + 'success' => false, + 'error' => 'Mail service is not configured. Please set SMTP_HOST, SMTP_USER, and SMTP_PASS in your .env file.', + 'details' => 'Mail service is not configured.' + ]); + exit; +} + +// Send the email +$email_result = $generator->sendEmail($post_data['email']); + +if (!empty($email_result['success'])) { + echo json_encode([ + 'success' => true, + 'message' => 'Report successfully sent to ' . $post_data['email'], + 'report' => $report_data // Optionally return report data to the frontend + ]); +} else { + http_response_code(500); // Internal Server Error + $error_detail = $email_result['error'] ?? 'Unknown error'; + error_log('MailService Error: ' . $error_detail); + echo json_encode([ + 'success' => false, + 'error' => 'Failed to send email. Please check your SMTP credentials in the .env file.', + 'details' => $error_detail // for debugging + ]); +} + +?>