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 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155
| <?php
include("_connect.php");// echo "stop Debut index.php"; // à Décocher pour vérifier que la connexion par include a fonctionnée
$table="xxxxx_cotis"; // Nom de des tables
// combobox Affichage des champs d'une table de choix
include("fonctions.php");// On inclut dans la page les Fonctions nécéssaire au bon fonctionnement du script
//Déclaration du tableau contenant les combo
echo'<table align=center cellspacing=2 cellpadding=2 border=1 width=90%>';
echo'<tr>';
echo '<td><h4>Ajout Cotisation: </h4></td>' ;
echo'<td><a href="ajout_cotis.php"> <img alt="Ajout Cotis" src="../image/ok.png"> </a></td>';
echo '<td><h4>Liste par Type Réglement: </h4></td>' ;
echo'<td><a href="liste_cotis_reglt.php"> <img alt="Ajout Cotis" src="../image/ok.png"> </a></td>';
echo'<td>';
//fonction liste deroulante
echo'<form action="liste_cotis.php" methode="post" name="form_reglt"';
echo "<h4>Type De Cotisation :</h4>" ;
echo'</td>';
echo'<td>';
echo liste_choix('SELECT `id_type_cotis`, `libelle_type_cotis` FROM `galette2_types_cotisation`', 'liste_type_cotis');
echo'<input type=submit value= GO>';
echo'</form>';
echo'</td>';
echo'<td>';
//fonction liste deroulante
echo'<form action="liste_cotis.php" method="post" name="form_reglt"';
//echo'<form action=liste_cotis.php methode=post name=form_reglt';
echo "<h4>Type De Réglement :</h4>" ;
echo'</td>';
echo'<td>';
echo liste_choix('SELECT `type_reglt`, `libelle_type_reglt` FROM `galette2_types_reglt`', 'liste_type_reglt');
echo'<input type=submit value= GO>';
echo'</form>';
echo'</td>';
echo'<td>';
// Récupération du $postwhere reglt_type=$indice_reglt
//echo "Vous avez choisi : <b>" . $_POST[liste_type_reglt] . "</b><br>";
$indice_reglt=$_POST['liste_type_reglt'];
$indice_cotis=$_POST['liste_type_cotis'];
//$indice_reglt=1; //essai qui fonctionne avec le where
// sélectionne toutes les fiches de la table $table
$requete = "SELECT *
FROM $table
order by 'date_enreg'asc ";
$valeur = mysql_query($requete);
// Décocher echo Pour voir combien cette requête retourne d'enregistrements
echo "Nombre d'adhésion / Ré-adhésion : ".mysql_num_rows($valeur)."<br/>";
echo'</td>';
echo'</tr>';
echo'</table>';
?>
<?php
//where reglt_type=$indice_reglt OR id_type_cotis=$indice_cotis
// déclaration de tableau
$tri=@$_GET['tri'];
if($tri==''){$tri="id_cotis DESC";} // on met le tri par défaut ASC ou DESC
if($tri==''){$tri="Il n'y a pas d'Enregistrement sur la Base";} //message QUAND IL N'Y A RIEN DE RÉCUPÉRÉ PAR GET
$critere = array();
if (isset($_POST['reglt_type'])) {
$critere[] = "reglt_type=" . intval($_POST['reglt_type']);
}
echo $critere;
if (isset($_POST['indice_cotis'])) {
$critere[] = " id_type_cotis=" . intval($_POST['indice_cotis']);
}
echo $critere;
$requete = "SELECT * FROM $table";
if (!empty($critere)) { $requete .= " WHERE " . implode($critere, " OR "); }
$requete .= " order by ".$tri;
echo "$critere";
$valeur = mysql_query($requete);
echo "$valeur";
echo "$requete";
// puis :
//$requete = "SELECT * FROM $table
//where reglt_type=$indice_reglt OR id_type_cotis=$indice_cotis
//order by ".$tri;
?>
<? // Déclaration des Colonnes et entetes de tri ?>
<table cellspacing="2" cellpadding="2" border="1" bgcolor="#f8f0d9" align="center" weight= "90%" height="10">
<tr>
<th><a href="?tri=id_cotis ASC"><</a>-ID- <a href="?tri=id_cotis DESC">></a></th>
<th><a href="?tri=numero_adh ASC"><</a>-N° Adh-<a href="?tri=numero_adh DESC">></a></th>
<th><a href="?tri=nom_adh ASC"><</a>--NOM--<a href="?tri=nom_adh DESC">></a></th>
<th><a href="?tri=prenom_adh ASC"><</a>--Prénom--<a href="?tri=prenom_adh DESC">></a></th>
<th><a href="?tri=id_type_cotis ASC"><</a>--type_cotis--<a href="?tri=id_type_cotis DESC">></a></th>
<th><a href="?tri=montant_cotis ASC"><</a>--Cotis--<a href="?tri=montant_cotis DESC">></a></th>
<th><a href="?tri=reglt_type ASC"><</a>--Type Reglt--<a href="?tri=reglt_type DESC">></a></th>
<th><a href="?tri=info_reglt">Info Reglt</a></th>
<th><a href="?tri=date_enreg ASC"><</a>--date Enreg--<a href="?tri=date_enreg DESC">></a></th>
<th><a href="?tri=date_debut ASC"><</a>--date Debut--<a href="?tri=date_debut DESC">></a></th>
<th><a href="?tri=date_fin ASC"><</a>--date Fin--<a href="?tri=date_fin DESC">></a></th>
<th><a href="?tri=commentaire_cotis">Commentaires</a></th>
</tr>
<?php //Affichage des resultats
while($row = mysql_fetch_assoc($valeur))
{
echo "<tr><td>"; // rien dans la ligne entete
if(!empty($row['id_cotis'])) {echo $row['id_cotis'];} else {echo " ";}// le else sert dans le cas ou la cellule est vide
echo "</td><td>";
if(!empty($row['numero_adh'])) {echo $row['numero_adh'];} else {echo " ";}
echo "</td><td>";
if(!empty($row['nom_adh'])) {echo $row['nom_adh'];} else {echo " ";}
echo "</td><td>";
if(!empty($row['prenom_adh'])) {echo $row['prenom_adh'];} else {echo " ";}
echo "</td><td>";
if(!empty($row['id_type_cotis'])) {echo $row['id_type_cotis'];} else {echo ' ';}
echo "</td><td>";
if(!empty($row['montant_cotis'])) {echo $row['montant_cotis'];} else {echo " ";}
echo "</td><td>";
if(!empty($row['reglt_type'])) {echo $row['reglt_type'];} else {echo " ";}
echo "</td><td>";
if(!empty($row['info_reglt'])) {echo $row['info_reglt'];} else {echo " ";}
echo "</td><td>";
if(!empty($row['date_enreg'])) {echo $row['date_enreg'];} else {echo " ";}
echo "</td><td>";
if(!empty($row['date_debut'])) {echo $row['date_debut'];} else {echo " ";}
echo "</td><td>";
if(!empty($row['date_fin'])) {echo $row['date_fin'];} else {echo " ";}
echo "</td><td>";
if(!empty($row['commentaire_cotis'])) {echo $row['commentaire_cotis'];} else {echo " ";}
echo "</td>";
echo '<td><a href="recherche_cotis.php?numero_adh='.$row['numero_adh'].'"> <img alt="Modif Cotis" src="../image/modifier.gif"/></a></td>'; //Petit lien permettant de traiter la ligne que l'on souhaite
//echo '<td><a href="./ecrire_un_email.php ?email_adh='.$row['email_adh'].'"> <img alt="Retour vers Site CG-aisne" src="../image/email.gif"/></a></td>';
echo '<td><a href="http://cg-aisne.org/"><img alt="Retour vers Site CG-aisne" src="../image/supprimer.gif"/></a></td>';
echo '</tr>';
}
echo "</table>\n";
?> |