| 12
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 
 |  
<p><span class="TitreTableau">Rechercher une commune: </span> </p>
<p><span class="Paragraphes"</p>
<form method="post" name="selectcommunes" action="selection_communes.php"  >
Veuillez sélectionner votre département : <br><br>
<?php
//Affichage de la liste des départements de la base dans un menu déroulant 
$resultDPT = mysql_query("SELECT DISTINCT departement FROM communesbis ORDER BY departement ") or die ("La requête ne s'est pas exécutée !". mysql_error());
 
$nbDPT = mysql_num_rows($resultDPT);
 
if ($nbDPT) {
        echo "<select class=\"Paragraphes\" name=\"departement\" onChange='ModifierListe(-1)' >";
        echo "<option value=\"vide\"></option>\n";
        while($rowDPT = mysql_fetch_array($resultDPT)) {
                echo "<option value=\"".$rowDPT["departement"]."\">".$rowDPT["departement"]."</option>\n";
        }
        echo "</select><br>";
}
//Affichage de la liste des communes de la base dans un menu déroulant 
echo "<br>Veuillez sélectionner votre commune : <br><br>";
$resultcommunes = mysql_query("SELECT * FROM communesbis ORDER BY communes ") or die ("La requête ne s'est pas exécutée !". mysql_error());
$nbcommunes = mysql_num_rows($resultcommunes);
if ($nbcommunes) {
        echo "<select class =\"Paragraphes\" name=\"communes\" onChange=\"Selectcom()\">";
        echo "<option value=\"no_choice\">Choissisez votre commune :</option>";
        echo "<SCRIPT LANGUAGE='JavaScript'>\n;ModifierListe(".$communes.");\n</SCRIPT>\n";
        echo "</select>";
}
?>
<br>
<br>
<A HREF="#" onClick="window.close()"> 
		<img src="images/Btn_Annuler.gif" alt="Annuler" border="0" align="absmiddle"> 
</A>  
<A HREF="#" onClick="Selectcom()">
        <img src="images/Btn_Envoyer.gif" alt="Valider" border="0" align="absmiddle">
</A>  
<A HREF="#" onClick="document.location.reload()">
        <img src="images/Btn_Actualiser.gif" alt="Actualiser" border="0" align="absmiddle">
</A>
 
</span>
 
<script language="JavaScript">
function Selectcom (){
        this.comField   = opener.comField;
        this.idField = opener.idField;
 
        if ((communes.options[communes.options.selectedIndex].value) != "no_choice"){
           comField.value = communes.options[communes.options.selectedIndex].text;
           idField.value = communes.options[communes.options.selectedIndex].value;
        }else{
           comField.value = communes.options[communes.options.selectedIndex].text;
           idField.value = "";
        }
 
        window.close();
}
</script>
 
</form> | 
Partager