1 2 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 63 64
|
<select name="batiments"> // liste déroulante de la colonne batiment
<?php
$query = "SELECT DISTINCT descr FROM tbl_site WHERE ascendant_mission = ".$_COOKIE['cookie_mission']." ORDER BY descr;";
$result = mysql_query($query) or die ("Erreur !!<p>$query</p>");
echo "\n<option value=\"\" ></option>";
echo "\n<option value=\"Tous\" >Tous</option>";
for ($i=0 ; $i<mysql_num_rows($result) ; $i++) {
$nom_batiment=mysql_result($result,$i,0);
echo "\n<option value=\"$nom_batiment\">$nom_batiment\n";
}
?>
</select>
<select name="reference"> // Liste déroulante pour la deuxième colonne
<?php
$query = "SELECT DISTINCT ref FROM tbl_site WHERE ascendant_mission = ".$_COOKIE['cookie_mission']." ORDER BY descr;";
$result = mysql_query($query) or die ("Erreur !!<p>$query</p>");
echo "\n<option value=\"\" ></option>";
echo "\n<option value=\"Toutes\" >Toutes</option>";
for ($i=0 ; $i<mysql_num_rows($result) ; $i++) {
$refer=mysql_result($result,$i,0);
echo "\n<option value=\"$refer\">$refer\n";
}
?>
</select>
<?php
if (isset($_POST['batiments'])){
$query = "SELECT code, descr, acces_origine, acces_actualisee, depense_engagee, ref, competence, commune, secteur, typologie, utilisateur, designation, adresse, type_erp, cat, effectif, surface, proprietaire commune FROM tbl_site WHERE ascendant_mission = ".$_COOKIE['cookie_mission']." AND descr = \"".$_POST['batiments']."\" ORDER BY $order_by $asc_desc;";
$result = mysql_query($query) or die ("Erreur !!<p>$query</p>");
}
elseif (isset($_POST['reference'])){
$query = "SELECT code, descr, acces_origine, acces_actualisee, depense_engagee, ref, competence, commune, secteur, typologie, utilisateur, designation, adresse, type_erp, cat, effectif, surface, proprietaire commune FROM tbl_site WHERE ascendant_mission = ".$_COOKIE['cookie_mission']." AND ref = \"".$_POST['reference']."\" ORDER BY $order_by $asc_desc;";
$result = mysql_query($query) or die ("Erreur !!<p>$query</p>");
}
else
{
$query = "SELECT code, descr, acces_origine, acces_actualisee, depense_engagee, ref, competence, commune, secteur, typologie, utilisateur, designation, adresse, type_erp, cat, effectif, surface, proprietaire commune FROM tbl_site WHERE ascendant_mission = ".$_COOKIE['cookie_mission']." ORDER BY $order_by $asc_desc;";
$result = mysql_query($query) or die ("Erreur !!<p>$query</p>");
}
if (isset($_POST['batiments'])) {
if ($_POST['batiments'] == "Tous") {
$query = "SELECT code, descr, acces_origine, acces_actualisee, depense_engagee, ref, competence, commune, secteur, typologie, utilisateur, designation, adresse, type_erp, cat, effectif, surface, proprietaire commune FROM tbl_site WHERE ascendant_mission = ".$_COOKIE['cookie_mission']." ORDER BY $order_by $asc_desc;";
$result = mysql_query($query) or die ("Erreur !!<p>$query</p>");
}
}
elseif (isset($_POST['reference'])) {
if ($_POST['reference'] == "Toutes") {
$query = "SELECT code, descr, acces_origine, acces_actualisee, depense_engagee, ref, competence, commune, secteur, typologie, utilisateur, designation, adresse, type_erp, cat, effectif, surface, proprietaire commune FROM tbl_site WHERE ascendant_mission = ".$_COOKIE['cookie_mission']." ORDER BY $order_by $asc_desc;";
$result = mysql_query($query) or die ("Erreur !!<p>$query</p>");
}
}
?> |
Partager