melder/lib/dialog_karte.php

132 lines
4.7 KiB
PHP
Raw Normal View History

2024-03-11 16:12:39 +01:00
<?php
function print_username() {
2024-03-11 23:06:15 +01:00
echo <<<HEREDOC
2024-03-11 17:36:02 +01:00
<!-- Username ---------------------------------- -->
<label for="username"><strong>Ihr Name oder Pseudonym:</strong></label>
<input type="text" name="username" maxlength="16" id="username" placeholder="Name" class="text" required="required">
<br>
2024-03-11 23:06:15 +01:00
HEREDOC;
2024-03-11 16:12:39 +01:00
}
2024-02-16 15:35:01 +01:00
2024-03-11 16:12:39 +01:00
function print_userinfo() {
global $arrAge;
global $arrTransport;
2024-03-11 17:36:02 +01:00
echo <<<HEREDOC
<!-- Userinfo ---------------------------------- -->
<label><strong>Die Fragen nach Alter und Verkehrsmittel können Sie freiwillig beantworten:</strong></label>
<br>
<label for="ext_age">Ihr Alter:</label>
<select name="ext_age" id="ext_age">
HEREDOC;
2024-03-11 16:12:39 +01:00
foreach ($arrAge as $age) {
2024-03-11 17:36:02 +01:00
echo "<option value='$age'>$age</option>";
}
echo <<<HEREDOC
</select>
<br>
<label for="ext_transport">Ihr hauptsächlich genutztes Verkehrsmittel:</label>
<select name="ext_transport" id="ext_transport">
HEREDOC;
foreach ($arrTransport as $transport) {
echo " <option value='$transport'>$transport</option>";
}
echo "</select><br>";
2024-03-11 16:12:39 +01:00
}
2024-02-16 15:35:01 +01:00
2024-03-11 16:12:39 +01:00
function print_category(){
global $arrDefect;
2024-03-11 17:36:02 +01:00
echo <<<HEREDOC
<!-- Mängelkategorie -------------------------------- -->
<label for="defect"><strong>Art des Hindernisses:</strong></label>
2024-03-12 08:19:43 +01:00
<select name="defect" id="defect" required="required">
2024-03-11 17:36:02 +01:00
HEREDOC;
foreach ($arrDefect as $defectKey => $defectVal) {
echo " <option value='$defectKey'>$defectVal</option>";
}
echo "</select><br>";
2024-03-11 16:12:39 +01:00
}
function print_description(){
2024-03-11 17:36:02 +01:00
echo <<<HEREDOC
<!-- Beschreibung ---------------------------------- -->
<label for="description"><strong>Beschreibung:</strong></label><br>
<textarea name="description" id="description" maxlength="1001" placeholder="Beschreiben Sie Ihren Eintrag" required="required"></textarea>
HEREDOC;
2024-03-11 16:12:39 +01:00
}
function print_topics(){
2024-03-11 23:06:15 +01:00
global $arrTopic;
echo <<<HEREDOC
<!-- Themenfelder ---------------------------------- -->
<strong>Wählen Sie ein Themenfeld aus:</strong></br>
<div class="row">
HEREDOC;
$first=true;
foreach ($arrTopic as $keyTopic => $valTopic) {
$checked = ($first) ? "checked=\"checked\"" : "";
$first=false;
echo '<div class="col-6-md col-6">
<input type="radio" id="topic'.$keyTopic.'" name="topic" value="'.$keyTopic.'" $checked/>
<label for="topic$keyTopic">'.$valTopic.'</label>
</div>';
};
echo "</div> <!-- row -->";
2024-03-11 16:12:39 +01:00
}
2024-02-16 15:35:01 +01:00
?>
2024-03-11 16:12:39 +01:00
<div id="dialog" class="card" title="Neuer Eintrag in die Karte">
2024-03-11 17:36:02 +01:00
<div class="card-header">Hindernismelder des ADFC NRW
2024-03-11 16:12:39 +01:00
<span id="hint"></span>
<span id="close" type="button" class="close right text-danger">
<i class="fa fa-window-close"></i>
</span>
2024-02-16 15:35:01 +01:00
</div>
2024-03-11 16:12:39 +01:00
<div class="card-body">
2024-03-11 23:06:15 +01:00
<form id="newobjectform" enctype="multipart/form-data" action="#" method="post" >
2024-03-11 16:12:39 +01:00
<?php
print_username();
if ($boolUserinfo) print_userinfo();
if ($boolDefect) print_category();
print_description();
2024-03-11 23:06:15 +01:00
if ($boolTopics) print_topics();
2024-03-11 16:12:39 +01:00
?>
2024-02-16 15:35:01 +01:00
<!-- Lokalisierung ---------------------------------- -->
<input type="hidden" id="lng" name="lng" value="0" />
<input type="hidden" id="lat" name="lat" value="0" />
2024-02-18 13:37:18 +01:00
<input type="hidden" id="district" name="district" value="<?=$strDistrict?>" />
2024-02-16 15:35:01 +01:00
<!-- Dateiupload ---------------------------------- -->
<?php if ($boolUpload): ?>
<label>Bildupload:</label>
<input type="file" id="photo" name="uploadfile" size="60" maxlength="255" />
<?php endif; ?>
<!-- Einverständnis ---------------------------------- -->
<strong>Einverständnis:</strong><br>
<label for="consent">
<input type="checkbox" id="consent" name="consent" value="1" required="required" />
Ich bin einverstanden, dass die von mir eingegebenen Daten in der
Karte veröffentlicht
<?= $boolUserinfo ? " (außer Alter und Verkehrsmittel) " : ""?>und im Rahmen der
2024-03-11 16:12:39 +01:00
<a href="https://nrw.adfc.de/datenschutz" target="_blank">Datenschutzerklärung</a>
2024-02-16 15:35:01 +01:00
verarbeitet werden dürfen.<br>
<?php if ($boolUpload): ?>
Wenn Sie ein <strong>Bild</strong> hochladen, achten Sie bitte auf
<strong>Urheber- und Persönlichkeitsrechte</strong>.
<?php endif; ?>
</label>
2024-03-11 17:36:02 +01:00
<input type="submit" id="submit" class="btn btn-primary" value="Meldung abgeben" tabindex="-1">
2024-02-16 15:35:01 +01:00
</form>
</div> <!-- card-body -->
</div> <!-- card -->