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
|
$critere = $_GET['critere'];
$table = "GEST";
$annee = $_GET['annee'];
if ($critere == "cotisant")
{
$html = "
<table border=\"1\" width=\"740\">
<TR>
<TD bgcolor=\"#000000\" align=\"center\"><font face=\"arial\" size=\"6\" color=\"#FFFFFF\">LISTING DES COTISANTS ".$annee;
$html .=" </font>
</TD>
</tr>
</table>";
$requete = "SELECT * FROM GESTIONNAIRES WHERE appel_coti LIKE 'O' order by type_AG asc,cp asc";
//echo $requete;
$result = mysql_query($requete); //or die('Erreur SQL !<br>'.$result.'<br>'.mysql_error());
// echo $result;
//echo"<BR>";
while ($data = mysql_fetch_array($result))
{
//On prend annee du critere de selection
$requete2 = "SELECT * FROM $table WHERE code_gest=".$data['code_gest']." && annee=".$annee." order by annee DESC";
//$requete2 = "SELECT * FROM $table WHERE code_gest=".$data['code_gest']." order by annee DESC";
$result2 = mysql_query($requete2); //or die('Erreur SQL !<br>'.$result.'<br>'.mysql_error());
//echo $result2;
if ($nb_paiements_effectues = mysql_num_rows($result2))
{
// on prend la dernière année où a eu lieu la cotisation
$data2 = mysql_fetch_array($result2);
//echo $data2;
$date_cotis = $data2['date'];
$montant_cotis = $data2['montant'];
$typepaiement_cotis = $data2['type_paiement'];
$annee = $data['annee'];
}
else
{
$date_cotis = "";
$montant_cotis = "";
$typepaiement_cotis = "";
}
$html .=" <table border=\"1\" width=\"740\" bordercolor=\"white\">
<TR>
<TD bgcolor=\"#444444\" align=\"left\"><font face=\"times\" size=\"3\" color=\"#FFFFFF\"><B>";
$html .= $data['code_gest']." * ".$data['rais_soc1']." ".$data['rais_soc2']."[".$data['cp']."]";;
$html .="</B></FONT></TD></TR>";
$html .="
<TR>
<TD align=\"left\"><font face=\"times\" size=\"1\" color=\"#000000\">";
$html .= $data['directeur']."<BR>".$data['adr1']." - ".$data['adr2']."<BR>".$data['cp']." ".$data['ville']."<BR>";
$html .= "<font color=\"blue\">Pour ".$data2['annee']." - Dernière cotisation le ".$data2['date']." [".$data2['montant']." ]</font>";
$compteur_stop = 0;
//autre cotisation
//$html .= "<font color=\"blue\">.$annee.</font>";
// fin autre cotisation
$html .= "<font color=\"red\"> - Type AG : ".$data['type_AG']."</font> ";
$html .= "<font color=\"red\"> - BI : ".$data['BI_etat']."</font><BR>";
if ($nb_paiements_effectues>=2)
{
while ($data2 = mysql_fetch_array($result2))
{
if ($compteur_stop<=3)
{
if ($compteur_stop % 2 == 0) $tampon_couleur = "#DF01D7"; else $tampon_couleur = "#FF8000";
$html .= "<font color=\"".$tampon_couleur."\">[".$data2['annee']." : ".$data2['montant']." ]</font> - ";
$compteur_stop++;
}
}
}
$html .="</FONT></TD></TR></TABLE>";
}
} |
Partager