Suchfunktion repariert

This commit is contained in:
aschwarz 2024-02-19 18:13:39 +01:00
parent 19a9bd4acb
commit f54886c481

View File

@ -42,59 +42,33 @@ select{
--> -->
</style> </style>
<script type='text/javascript' src='ajax.js'></script>
<script src='jquery-3.4.1.min.js'></script>
<script type='text/javascript'> <script type='text/javascript'>
/************************************************************************************************************ function fetch_select(){
Ajax chained select var kontinent = document.getElementById('kontinent').options[document.getElementById('kontinent').options.selectedIndex].value;
Copyright (C) 2006 DTHMLGoodies.com, Alf Magne Kalleland
$.ajax({
This library is free software; you can redistribute it and/or type: 'POST',
modify it under the terms of the GNU Lesser General Public url: 'get_land.php',
License as published by the Free Software Foundation; either data: {
version 2.1 of the License, or (at your option) any later version. 'function': 'fetch_select',
'kontinent': kontinent
This library is distributed in the hope that it will be useful, },
but WITHOUT ANY WARRANTY; without even the implied warranty of success: function(result) { //we got the response
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU document.getElementById('land').innerHTML=result;
Lesser General Public License for more details. },
error: function(xhr, status, exception) {
You should have received a copy of the GNU Lesser General Public console.log(xhr);
License along with this library; if not, write to the Free Software }
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA });
Dhtmlgoodies.com., hereby disclaims all copyright interest in this script
written by Alf Magne Kalleland.
Alf Magne Kalleland, 2006
Owner of DHTMLgoodies.com
************************************************************************************************************/
var ajax = new sack();
function getCityList(sel)
{
var countryCode = sel.options[sel.selectedIndex].value;
document.getElementById('dhtmlgoodies_city').options.length = 0; // Empty city select box
if(countryCode.length>0){
ajax.requestFile = 'getSubCat_search.php?countryCode='+countryCode; // Specifying which file to get
ajax.onCompletion = createCities; // Specify function that will be executed after file has been found
ajax.runAJAX(); // Execute AJAX function
}
} }
function createCities()
{
var obj = document.getElementById('dhtmlgoodies_city');
eval(ajax.response); // Executing the response from Ajax as Javascript code
}
</script> </script>
<link rel=\"stylesheet\" href=\"styles_pc.css\" type=\"text/css\"> <link rel=\"stylesheet\" href=\"styles_pc.css\" type=\"text/css\">
</head> </head>
<body onload=\"if(document.auswert)document.auswert.dhtmlgoodies_country.focus();if(document.auswert)document.auswert.uberschrift.focus();return false;\"> <body onload=\"if(document.auswert)document.auswert.dhtmlgoodies_country.focus();if(document.auswert)document.auswert.uberschrift.focus();return false;\">
@ -128,9 +102,9 @@ function createCities()
ORDER BY kontinent ASC"; ORDER BY kontinent ASC";
$result2 = $db->query ($query2) $result2 = $db->query ($query2)
or die ("Cannot execute query"); or die ("Cannot execute query");
echo "<select id='dhtmlgoodies_country' name='dhtmlgoodies_country' onchange='getCityList(this)' onfocus='getCityList(this)'> echo "<select id='kontinent' name='kontinent' onchange='fetch_select();'>
<option value=''>Select</option>"; <option value=''>Select</option>";
echo "<option value='%'";if($row3['kontinent'] == '%'){echo " selected";} echo">Alle&nbsp;&nbsp;&nbsp;</option>\n"; # echo "<option value='%'";if($row3['kontinent'] == '%'){echo " selected";} echo">Alle&nbsp;&nbsp;&nbsp;</option>\n";
while ($row2 = $result2->fetch_array()){ while ($row2 = $result2->fetch_array()){
echo "<option value='$row2[kid]'";if($row2['kid'] == $row3['kontinent']){echo " selected";} echo">".$row2['kontinent']."&nbsp;&nbsp;&nbsp;</option>\n"; echo "<option value='$row2[kid]'";if($row2['kid'] == $row3['kontinent']){echo " selected";} echo">".$row2['kontinent']."&nbsp;&nbsp;&nbsp;</option>\n";
} }
@ -144,7 +118,8 @@ function createCities()
Land </td> Land </td>
<td width='70%' style='border-right-style: solid; border-right-width: 2px'> <td width='70%' style='border-right-style: solid; border-right-width: 2px'>
<p style='margin-left: 3px; margin-right: 3px'> <p style='margin-left: 3px; margin-right: 3px'>
<select id='dhtmlgoodies_city' name='dhtmlgoodies_city'> <select id='land' name='land'>
</select>
</p> </p>
</td> </td>
</tr> </tr>
@ -203,17 +178,17 @@ function createCities()
break; break;
case "auswertung": case "auswertung":
if(!isset($_POST['dhtmlgoodies_country'])){ if(!isset($_POST['kontinent'])){
$kontinent=$_GET['kontinent']; $kontinent=$_GET['kontinent'];
}else{ }else{
$kontinent=$_POST['dhtmlgoodies_country']; $kontinent=$_POST['kontinent'];
} }
if(!isset($_POST['dhtmlgoodies_city'])){ if(!isset($_POST['land'])){
$land=$_GET['land']; $land=$_GET['land'];
}else{ }else{
$land=$_POST['dhtmlgoodies_city']; $land=$_POST['land'];
} }
if(!isset($_POST['jahrgang'])){ if(!isset($_POST['jahrgang'])){