forked from itchy/Dialyse-Webseite
Add multilingual support (DE default, EN under /en/)
This commit is contained in:
1 parent
01ea3bd07a
commit
1e33c525f1
21 files changed
+855
-443
No files matched your search
+30
-18
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
/* @var Session $session */
|
||||
$isEn = ($lang ?? 'de') === 'en';
|
||||
$form = $session->get('form');
|
||||
?>
|
||||
|
||||
@@ -16,61 +17,72 @@ $form = $session->get('form');
|
||||
<?php $session->remove('alert'); ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<h1>Ihre Kontaktanfrage</h1>
|
||||
<h1><?= $isEn ? 'Your Contact Inquiry' : 'Ihre Kontaktanfrage' ?></h1>
|
||||
|
||||
<p id="form-instructions" style="color: var(--text-muted); margin-bottom: 2rem;">
|
||||
Hier können Sie, unter Angabe Ihrer Kontaktdaten, eine persönliche Anfrage stellen.
|
||||
Die mit einem (<span aria-hidden="true" style="color: var(--danger); font-weight: bold;">*</span>) gekennzeichneten Felder sind Pflichtfelder.
|
||||
Bitte geben Sie entweder eine E-Mail-Adresse oder Ihre Telefonnummer an, damit wir Sie erreichen können.
|
||||
<?php if ($isEn): ?>
|
||||
Here you can submit a personal inquiry by providing your contact details.
|
||||
Fields marked with an asterisk (<span aria-hidden="true" style="color: var(--danger); font-weight: bold;">*</span>) are mandatory.
|
||||
Please provide either an email address or your phone number so that we can reach you.
|
||||
<?php else: ?>
|
||||
Hier können Sie, unter Angabe Ihrer Kontaktdaten, eine persönliche Anfrage stellen.
|
||||
Die mit einem (<span aria-hidden="true" style="color: var(--danger); font-weight: bold;">*</span>) gekennzeichneten Felder sind Pflichtfelder.
|
||||
Bitte geben Sie entweder eine E-Mail-Adresse oder Ihre Telefonnummer an, damit wir Sie erreichen können.
|
||||
<?php endif; ?>
|
||||
</p>
|
||||
|
||||
<form action="/contact.php" method="post" id="contactForm">
|
||||
<input type="hidden" name="timestamp" value="<?=time()?>">
|
||||
<input type="hidden" name="lang" value="<?=htmlspecialchars($lang ?? 'de')?>">
|
||||
<input type="hidden" name="check" id="formCheck" value="<?=(isset($form) && !empty($form['check']) ? 'send' : '0')?>">
|
||||
|
||||
<!-- Honeypot Bot Field (hidden from real users) -->
|
||||
<div style="display: none;" aria-hidden="true">
|
||||
<label for="company">Firma (Bitte freilassen)</label>
|
||||
<label for="company"><?= $isEn ? 'Company (Please leave blank)' : 'Firma (Bitte freilassen)' ?></label>
|
||||
<input type="text" name="company" id="company" tabindex="-1" autocomplete="off" value="">
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="surname">Vorname</label>
|
||||
<input type="text" class="form-control" name="surname" id="surname" autocomplete="given-name" placeholder="Ihr Vorname" value="<?=isset($form) ? htmlspecialchars($form['surname']) : ''?>">
|
||||
<label class="form-label" for="surname"><?= $isEn ? 'First Name' : 'Vorname' ?></label>
|
||||
<input type="text" class="form-control" name="surname" id="surname" autocomplete="given-name" placeholder="<?= $isEn ? 'Your first name' : 'Ihr Vorname' ?>" value="<?=isset($form) ? htmlspecialchars($form['surname']) : ''?>">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="name">Nachname <span class="required" aria-hidden="true">*</span></label>
|
||||
<input type="text" class="form-control" name="name" id="name" autocomplete="family-name" required placeholder="Ihr Nachname" value="<?=isset($form) ? htmlspecialchars($form['name']) : ''?>">
|
||||
<label class="form-label" for="name"><?= $isEn ? 'Last Name' : 'Nachname' ?> <span class="required" aria-hidden="true">*</span></label>
|
||||
<input type="text" class="form-control" name="name" id="name" autocomplete="family-name" required placeholder="<?= $isEn ? 'Your last name' : 'Ihr Nachname' ?>" value="<?=isset($form) ? htmlspecialchars($form['name']) : ''?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="email">E-Mail-Adresse <span class="required" aria-hidden="true" title="Bitte E-Mail-Adresse oder Telefonnummer angeben">*</span></label>
|
||||
<input type="email" class="form-control" name="email" id="email" autocomplete="email" aria-describedby="form-instructions" required placeholder="ihre.adresse@example.de" value="<?=isset($form) ? htmlspecialchars($form['email']) : ''?>">
|
||||
<label class="form-label" for="email"><?= $isEn ? 'Email Address' : 'E-Mail-Adresse' ?> <span class="required" aria-hidden="true" title="<?= $isEn ? 'Please provide an email address or phone number' : 'Bitte E-Mail-Adresse oder Telefonnummer angeben' ?>">*</span></label>
|
||||
<input type="email" class="form-control" name="email" id="email" autocomplete="email" aria-describedby="form-instructions" required placeholder="<?= $isEn ? 'your.email@example.com' : 'ihre.adresse@example.de' ?>" value="<?=isset($form) ? htmlspecialchars($form['email']) : ''?>">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="phone">Telefonnummer <span class="required" aria-hidden="true" title="Bitte E-Mail-Adresse oder Telefonnummer angeben">*</span></label>
|
||||
<label class="form-label" for="phone"><?= $isEn ? 'Phone Number' : 'Telefonnummer' ?> <span class="required" aria-hidden="true" title="<?= $isEn ? 'Please provide an email address or phone number' : 'Bitte E-Mail-Adresse oder Telefonnummer angeben' ?>">*</span></label>
|
||||
<input type="tel" class="form-control" name="phone" id="phone" autocomplete="tel" aria-describedby="form-instructions" required placeholder="030 12345678" value="<?=isset($form) ? htmlspecialchars($form['phone']) : ''?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="message">Ihre Mitteilung <span class="required" aria-hidden="true">*</span></label>
|
||||
<textarea class="form-control" name="message" id="message" required rows="6" placeholder="Wie können wir Ihnen weiterhelfen?"><?=isset($form) ? htmlspecialchars($form['message']) : ''?></textarea>
|
||||
<label class="form-label" for="message"><?= $isEn ? 'Your Message' : 'Ihre Mitteilung' ?> <span class="required" aria-hidden="true">*</span></label>
|
||||
<textarea class="form-control" name="message" id="message" required rows="6" placeholder="<?= $isEn ? 'How can we help you?' : 'Wie können wir Ihnen weiterhelfen?' ?>"><?=isset($form) ? htmlspecialchars($form['message']) : ''?></textarea>
|
||||
</div>
|
||||
|
||||
<div class="form-note">
|
||||
<svg aria-hidden="true" focusable="false" style="width: 16px; height: 16px; fill: currentColor; vertical-align: middle; margin-right: 4px;" viewBox="0 0 24 24"><path d="M12 1L3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5l-9-4zm0 10.99h7c-.53 4.12-3.28 7.79-7 8.94V12H5V6.3l7-3.11v8.8z"/></svg>
|
||||
Ihre persönlichen Angaben werden vertraulich behandelt, ausschließlich zur Bearbeitung Ihrer Anfrage gemäß unserer <a href="/datenschutz.html" style="text-decoration: underline;">Datenschutzerklärung</a> verarbeitet und niemals an Dritte weitergegeben.
|
||||
<?php if ($isEn): ?>
|
||||
Your personal data will be treated confidentially, processed exclusively to handle your inquiry in accordance with our <a href="<?= Helper::url('/datenschutz.html', $lang ?? 'de') ?>" style="text-decoration: underline;">Privacy Policy</a>, and never passed on to third parties.
|
||||
<?php else: ?>
|
||||
Ihre persönlichen Angaben werden vertraulich behandelt, ausschließlich zur Bearbeitung Ihrer Anfrage gemäß unserer <a href="<?= Helper::url('/datenschutz.html', $lang ?? 'de') ?>" style="text-decoration: underline;">Datenschutzerklärung</a> verarbeitet und niemals an Dritte weitergegeben.
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
<button type="button" class="btn btn-outline-primary" onclick="history.back();">Abbrechen</button>
|
||||
<button type="button" class="btn btn-outline-primary" onclick="history.back();"><?= $isEn ? 'Cancel' : 'Abbrechen' ?></button>
|
||||
<button type="submit" class="btn btn-primary" name="send">
|
||||
<svg aria-hidden="true" focusable="false" style="width: 18px; height: 18px; fill: currentColor;" viewBox="0 0 24 24"><path d="M2.01 21L23 12 2.01 3 2 10l15 2-15 2z"/></svg>
|
||||
Anfrage absenden
|
||||
<?= $isEn ? 'Send Inquiry' : 'Anfrage absenden' ?>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
@@ -101,4 +113,4 @@ $form = $session->get('form');
|
||||
$('#email, #phone').on('input change', syncContactRequirement);
|
||||
syncContactRequirement();
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
Reference in new issue
Block a user