dialog changed

This commit is contained in:
Walter Hupfeld 2024-03-11 17:36:02 +01:00
parent e16939b233
commit 913ffd2000
4 changed files with 59 additions and 70 deletions

View File

@ -11,7 +11,7 @@ $strAge = (isset($_POST['ext_age'])) ? $_POST['ext_age'] : "";
$strTransport = (isset($_POST['ext_transport'])) ? $_POST['ext_transport'] : "";
$strDescription = htmlentities(trim($_POST['description']));
$strDescription = addslashes($strDescription);
$numTopic = (isset($_POST['topic'])) ? $_POST['topic'] : 1;
$numTopic = (isset($_POST['topic'])) ? $_POST['topic'] : 2;
$numDefect = (isset($_POST['defect'])) ? $_POST['defect'] : 0;
$numLng = $_POST['lng'];
$numLat = $_POST['lat'];
@ -85,8 +85,4 @@ if ($row = $result->fetch(PDO::FETCH_ASSOC)) {
$markerText=generate_tooltip_description($row);
$markerText=stripcslashes($markerText);
}
echo ($markerText);
echo ($markerText);

View File

@ -11,6 +11,8 @@
require_once("config.db.php");
$boolTopics=false;
$strSQL = "select * from config";
$result = $db->query($strSQL);
@ -114,9 +116,6 @@ while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
$arrDistrict[$row['district']]=$row['title'];
}
$arrTopic = array (
2 => "Radverkehr",
// 1 => "Fußverkehr",

View File

@ -318,7 +318,8 @@
$("#lat").val(lat);
$("#lng").val(lng);
$("#district").val("<?=$strDistrict?>");
topic=$('input[name=topic]:checked').val();
//topic=$('input[name=topic]:checked').val();
topic=2; // Keine Eingabe als Auswahlfeld in ADFC-Hindernis-Melder
newMarker = getMarker(topic);
event.preventDefault();

View File

@ -1,92 +1,84 @@
<?php
function print_username() {
echo <<<EOT
<!-- 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>
EOT;
echo <<<EOT
<!-- 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>
EOT;
}
function print_userinfo() {
global $arrAge;
global $arrTransport;
echo <<<EOT
<!-- 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">
EOT;
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;
foreach ($arrAge as $age) {
echo " <option value='$age'>$age</option>";
}
echo '
</select>
<br>
<label for="ext_transport">Ihr hauptsächlich genutztes Verkehrsmittel:</label>
<select name="ext_transport" id="ext_transport">';
foreach ($arrTransport as $transport) {
echo " <option value='$transport'>$transport</option>";
}
echo "</select><br>";
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>";
}
function print_category(){
global $arrDefect;
echo <<<EOT
<!-- Mängelkategorie -------------------------------- -->
<p>
<label for="defect"><strong>Art des Hindernisses:</strong></label>
<select name="defect" id="defect">
EOT;
foreach ($arrDefect as $defectKey => $defectVal) {
echo " <option value='$defectKey'>$defectVal</option>";
}
echo "</select></p>";
echo <<<HEREDOC
<!-- Mängelkategorie -------------------------------- -->
<label for="defect"><strong>Art des Hindernisses:</strong></label>
<select name="defect" id="defect">
HEREDOC;
foreach ($arrDefect as $defectKey => $defectVal) {
echo " <option value='$defectKey'>$defectVal</option>";
}
echo "</select><br>";
}
function print_description(){
echo <<<EOT
<!-- Beschreibung ---------------------------------- -->
<label for="description"><strong>Beschreibung:</strong></label><br>
<textarea name="description" id="description" maxlength="1001" placeholder="Beschreiben Sie Ihren Eintrag" required="required"></textarea>
EOT;
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;
}
function print_topics(){
global $arrTopic;
echo <<<EOT
echo <<<HEREDOC
<!-- Themenfelder ---------------------------------- -->
<strong>Wählen Sie ein Themenfeld aus:</strong></br>
<div class="row">
EOT;
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 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 -->";
}
?>
<div id="dialog" class="card" title="Neuer Eintrag in die Karte">
<div class="card-header">Ihr Wunsch oder Anregung
<div class="card-header">Hindernismelder des ADFC NRW
<span id="hint"></span>
<span id="close" type="button" class="close right text-danger">
<i class="fa fa-window-close"></i>
@ -96,17 +88,18 @@ echo "</div> <!-- row -->";
<div class="card-body">
<form id="newobjectform" enctype="multipart/form-data" action="#" method="post" >
<?php
print_username();
if ($boolUserinfo) print_userinfo();
if ($boolDefect) print_category();
print_description();
print_topics();
if ($boolTopics) {
print_topics();
} else {
echo "<input type='hidden' id='topic' name='topic' value='2' />";
}
?>
<!-- Lokalisierung ---------------------------------- -->
<input type="hidden" id="lng" name="lng" value="0" />
@ -136,7 +129,7 @@ Wenn Sie ein <strong>Bild</strong> hochladen, achten Sie bitte auf
<strong>Urheber- und Persönlichkeitsrechte</strong>.
<?php endif; ?>
</label>
<input type="submit" id="submit" class="btn btn-primary" tabindex="-1">
<input type="submit" id="submit" class="btn btn-primary" value="Meldung abgeben" tabindex="-1">
</form>
</div> <!-- card-body -->