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

View File

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

View File

@ -318,7 +318,8 @@
$("#lat").val(lat); $("#lat").val(lat);
$("#lng").val(lng); $("#lng").val(lng);
$("#district").val("<?=$strDistrict?>"); $("#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); newMarker = getMarker(topic);
event.preventDefault(); event.preventDefault();

View File

@ -1,75 +1,68 @@
<?php <?php
function print_username() { function print_username() {
echo <<<EOT echo <<<EOT
<!-- Username ---------------------------------- --> <!-- Username ---------------------------------- -->
<label for="username"><strong>Ihr Name oder Pseudonym:</strong></label>
<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">
<input type="text" name="username" maxlength="16" id="username" placeholder="Name" class="text" required="required"> <br>
<br> EOT;
EOT;
} }
function print_userinfo() { function print_userinfo() {
global $arrAge; global $arrAge;
global $arrTransport; global $arrTransport;
echo <<<EOT echo <<<HEREDOC
<!-- Userinfo ---------------------------------- --> <!-- Userinfo ---------------------------------- -->
<label><strong>Die Fragen nach Alter und Verkehrsmittel können Sie freiwillig beantworten:</strong></label> <label><strong>Die Fragen nach Alter und Verkehrsmittel können Sie freiwillig beantworten:</strong></label>
<br> <br>
<label for="ext_age">Ihr Alter:</label> <label for="ext_age">Ihr Alter:</label>
<select name="ext_age" id="ext_age"> <select name="ext_age" id="ext_age">
EOT; HEREDOC;
foreach ($arrAge as $age) { foreach ($arrAge as $age) {
echo " <option value='$age'>$age</option>"; echo "<option value='$age'>$age</option>";
} }
echo <<<HEREDOC
echo '
</select> </select>
<br> <br>
<label for="ext_transport">Ihr hauptsächlich genutztes Verkehrsmittel:</label> <label for="ext_transport">Ihr hauptsächlich genutztes Verkehrsmittel:</label>
<select name="ext_transport" id="ext_transport">'; <select name="ext_transport" id="ext_transport">
HEREDOC;
foreach ($arrTransport as $transport) { foreach ($arrTransport as $transport) {
echo " <option value='$transport'>$transport</option>"; echo " <option value='$transport'>$transport</option>";
} }
echo "</select><br>"; echo "</select><br>";
} }
function print_category(){ function print_category(){
global $arrDefect; global $arrDefect;
echo <<<EOT echo <<<HEREDOC
<!-- Mängelkategorie -------------------------------- --> <!-- Mängelkategorie -------------------------------- -->
<p>
<label for="defect"><strong>Art des Hindernisses:</strong></label> <label for="defect"><strong>Art des Hindernisses:</strong></label>
<select name="defect" id="defect"> <select name="defect" id="defect">
EOT; HEREDOC;
foreach ($arrDefect as $defectKey => $defectVal) { foreach ($arrDefect as $defectKey => $defectVal) {
echo " <option value='$defectKey'>$defectVal</option>"; echo " <option value='$defectKey'>$defectVal</option>";
} }
echo "</select></p>"; echo "</select><br>";
} }
function print_description(){ function print_description(){
echo <<<EOT echo <<<HEREDOC
<!-- Beschreibung ---------------------------------- --> <!-- Beschreibung ---------------------------------- -->
<label for="description"><strong>Beschreibung:</strong></label><br>
<label for="description"><strong>Beschreibung:</strong></label><br> <textarea name="description" id="description" maxlength="1001" placeholder="Beschreiben Sie Ihren Eintrag" required="required"></textarea>
<textarea name="description" id="description" maxlength="1001" placeholder="Beschreiben Sie Ihren Eintrag" required="required"></textarea> HEREDOC;
EOT;
} }
function print_topics(){ function print_topics(){
global $arrTopic; global $arrTopic;
echo <<<EOT echo <<<HEREDOC
<!-- Themenfelder ---------------------------------- --> <!-- Themenfelder ---------------------------------- -->
<strong>Wählen Sie ein Themenfeld aus:</strong></br> <strong>Wählen Sie ein Themenfeld aus:</strong></br>
<div class="row"> <div class="row">
EOT; HEREDOC;
$first=true; $first=true;
foreach ($arrTopic as $keyTopic => $valTopic) { foreach ($arrTopic as $keyTopic => $valTopic) {
$checked = ($first) ? "checked=\"checked\"" : ""; $checked = ($first) ? "checked=\"checked\"" : "";
@ -82,11 +75,10 @@ EOT;
}; };
echo "</div> <!-- row -->"; echo "</div> <!-- row -->";
} }
?> ?>
<div id="dialog" class="card" title="Neuer Eintrag in die Karte"> <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="hint"></span>
<span id="close" type="button" class="close right text-danger"> <span id="close" type="button" class="close right text-danger">
<i class="fa fa-window-close"></i> <i class="fa fa-window-close"></i>
@ -96,17 +88,18 @@ echo "</div> <!-- row -->";
<div class="card-body"> <div class="card-body">
<form id="newobjectform" enctype="multipart/form-data" action="#" method="post" > <form id="newobjectform" enctype="multipart/form-data" action="#" method="post" >
<?php <?php
print_username(); print_username();
if ($boolUserinfo) print_userinfo(); if ($boolUserinfo) print_userinfo();
if ($boolDefect) print_category(); if ($boolDefect) print_category();
print_description(); print_description();
if ($boolTopics) {
print_topics(); print_topics();
} else {
echo "<input type='hidden' id='topic' name='topic' value='2' />";
}
?> ?>
<!-- Lokalisierung ---------------------------------- --> <!-- Lokalisierung ---------------------------------- -->
<input type="hidden" id="lng" name="lng" value="0" /> <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>. <strong>Urheber- und Persönlichkeitsrechte</strong>.
<?php endif; ?> <?php endif; ?>
</label> </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> </form>
</div> <!-- card-body --> </div> <!-- card-body -->