| COMPARATIF SUR 2 ANNEES |
| par mois d'inscription | 2007 |
|---|
| JANVIER | 14 | | FEVIER | 12 | | MARS | 14 | | AVRIL | 8 | | MAI | 8 | | JUIN | 3 | | JUILLET | 4 | | AOUT | 3 | | SEPTEMBRE | 5 | | OCTOBRE | 9 | | NOVEMBRE | 4 | | DECEMBRE | 2 |
|
| | | age - 20 ans | 0 | | age 20 à 29 ans | 12 | | age 30 à 39 ans | 26 | | age 40 à 49 ans | 39 | | age 50 ans & + | 43 |
|
|---|
| par niveau de formation | 2007 |
|---|
| niveau I | 13 |
| niveau II | 17 |
| niveau III | 28 |
| niveau IV | 19 |
| niveau V | 29 |
| niveau Vbis | 3 |
| niveau VI | 11 |
| actif | 103 |
| associé | 10 |
| donateur | 7 |
|
voici le script ci dessous pour les mois écriture en bleu
//ouverture base et calcul nbre total adhérent
$db = mysql_connect('localhost', 'root', '');
$reqsql="select count(*) from ".$membres;
$result = mysql_db_query(membres3e,$reqsql);
$resultattotal = mysql_fetch_row($result);
$reqtot="select count(*)from ".$membres;
mysql_select_db("membres3e");
$resulta = mysql_query($reqtot);
$totalres = mysql_result($resulta, $lig, $col);
$reqsqlc="select count(*) from ".$membresc;
$resultc = mysql_db_query(membres3e,$reqsqlc);
$resultattotalc = mysql_fetch_row($resultc);
$reqtotc="select count(*)from ".$membresc;
mysql_select_db("membres3e");
$resultac = mysql_query($reqtotc);
$totalresc = mysql_result($resultac, $lig, $col);
echo " <font color ='#99FFCC' font size ='7'><p align ='center'> STATISTIQUES 3e";
echo"<br><br>";
echo "<body bgcolor =#0000CC>";
echo "<table align=center border=7 CELLSPaCING=5>";
for ($lig = 0; $lig < 1; $lig++)
{
echo "<tr>";
for ($col = 0; $col <1; $col++)
echo"<td WIDTH='772' align=center BGCOLOR= #CC0000 BORDERCOLOR=#006600# ><font color ='WHITE' font size ='5'>COMPARATIF SUR 2 ANNEES</td>";
echo "</tr>";
}
echo"<table>";
//col 1
echo"<table align=center border=7 CELLSPaCING=1 BGCOLOR= #6699FF width =800><th width=280>";
echo "<br>";
echo "<table border=5 CELLPaDDING=1 CELLSPaCING=1 BORDERCOLOR=#FFFF00 BGCOLOR= #FFFF99 width =280><th >année</th><th width = 70>".$annee."</th>";
echo "</table>";
echo "<table border=5 CELLPaDDING=1 CELLSPaCING=1 BORDERCOLOR=#FFFF00 BGCOLOR= #FFFF99 width =280><th >total</th><th width = 70>".$totalres."</th>";
echo "</table>";
//calcul réppartion par sexe
echo "<br>";
echo "<table border=5 CELLPaDDING=1 CELLSPaCING=1 BORDERCOLOR=#9933CC BGCOLOR= #CCCCFF width =280><th >par sexe</th><th width = 70>".$annee."</th>";
echo "</table>";
mysql_select_db('membres3e');
$rquerysexe = mysql_query('SELECT SEXE_TOTAL, COUNT(*)from '.$membres.', civilité where titre = civilité_titre GROUP BY titre');
$rquerysexec = mysql_query('SELECT SEXE_TOTAL, COUNT(*)from '.$membresc.', civilité where titre = civilité_titre GROUP BY titre');
?><table width="280" border="5" cellpadding="1" cellspacing="2" bordercolor="#9933CC" bgcolor="#CCCCFF"><?php
while ($aResexe = mysql_fetch_row($rquerysexe))
{
?>
<tr>
<td align="center"><?php echo $aResexe[0]; ?></td>
<td width="70" align="center"><?php echo $aResexe[1]; ?></td>
</tr>
<?php
}
echo "</table>";
//calcul reppartion par mois
mysql_select_db("membres3e");
$lig=0;
$reqsql="select count(*) from ".$renseignements." where month(datecotisation) =1";
$res1 = mysql_query($reqsql);
$jan = mysql_result($res1,$lig);
$reqsql="select count(*) from ".$renseignements." where month(datecotisation) =2";
$res2 = mysql_query($reqsql);
$fev = mysql_result($res2,$lig);
$reqsql="select count(*) from ".$renseignements." where month(datecotisation) =3";
$res3 = mysql_query($reqsq3);
$mars = mysql_result($res1,$lig);
$reqsql="select count(*) from ".$renseignements." where month(datecotisation) =4";
$res4 = mysql_query($reqsql);
$avril = mysql_result($res4,$lig);
$reqsql="select count(*) from ".$renseignements." where month(datecotisation) =5";
$res5 = mysql_query($reqsql);
$mai = mysql_result($res5,$lig);
$reqsql="select count(*) from ".$renseignements." where month(datecotisation) =6";
$res6 = mysql_query($reqsql);
$juin = mysql_result($res6,$lig);
$reqsql="select count(*) from ".$renseignements." where month(datecotisation) =7";
$res7 = mysql_query($reqsql);
$juil = mysql_result($res7,$lig);
$reqsql="select count(*) from ".$renseignements." where month(datecotisation) =8";
$res8 = mysql_query($reqsql);
$aout = mysql_result($res8,$lig);
$reqsql="select count(*) from ".$renseignements." where month(datecotisation) =9";
$res9 = mysql_query($reqsql);
$sept = mysql_result($res9,$lig);
$reqsql="select count(*) from ".$renseignements." where month(datecotisation) =10";
$res10 = mysql_query($reqsql);
$oct = mysql_result($res10,$lig);
$reqsql="select count(*) from ".$renseignements." where month(datecotisation) =11";
$res11 = mysql_query($reqsql);
$nov = mysql_result($res11,$lig);
$reqsql="select count(*) from ".$renseignements." where month(datecotisation) =12";
$res12 = mysql_query($reqsql);
$dec = mysql_result($res12,$lig);
echo "<br>";
echo "<table border=5 CELLPaDDING=1 CELLSPaCING=1 BORDERCOLOR=#CC6600 BGCOLOR= #FFCC99 width =280><th >par mois d'inscription</th><th width = 70>".$annee."</th>";
echo "</table>";
echo "<table width = 280 border=5 CELLPaDDING=1 CELLSPaCING=1 BORDERCOLOR=#CC6600 BGCOLOR= #FFCC99 >
<tr><td align=center >JANVIER</td><td width = 70 align=center >$jan</td>
<tr><td align=center >FEVIER</td><td width = 70 align=center >$fev</td>
<tr><td align=center >MARS</td><td width = 70 align=center >$mars</td>
<tr><td align=center >AVRIL</td><td width = 70 align=center >$avril</td>
<tr><td align=center >MAI</td><td width = 70 align=center >$mai</td>
<tr><td align=center >JUIN</td><td width = 70 align=center >$juin</td>
<tr><td align=center >JUILLET</td><td width = 70 align=center >$juil</td>
<tr><td align=center >AOUT</td><td width = 70 align=center >$aout</td>
<tr><td align=center >SEPTEMBRE</td><td width = 70 align=center >$sept</td>
<tr><td align=center >OCTOBRE</td><td width = 70 align=center >$oct</td>
<tr><td align=center >NOVEMBRE</td><td width = 70 align=center >$nov</td>
<tr><td align=center >DECEMBRE</td><td width = 70 align=center >$dec</td>
</table>";
echo "<Br>";
//col 2
echo"<th width =70>";
echo "<br>";
echo "<table border=5 CELLPaDDING=1 CELLSPaCING=1 BORDERCOLOR=#FFFF00 BGCOLOR= #FFFF99 width =70><th >".$anneec."</th>";
echo "<table border=5 CELLPaDDING=1 CELLSPaCING=1 BORDERCOLOR=#FFFF00 BGCOLOR= #FFFF99 width =70><th >".$totalresc."</th>";
echo "</table>";
echo "<br>";
echo "<table border=5 CELLPaDDING=1 CELLSPaCING=1 BORDERCOLOR=#9933CC BGCOLOR= #CCCCFF width =70><th >".$anneec."</th>";
echo "</table>";
$rquerysexec = mysql_query('SELECT SEXE_TOTAL, COUNT(*)from '.$membresc.', civilité where titre = civilité_titre GROUP BY titre');
?><table width="70" border="5" cellpadding="1" cellspacing="2" bordercolor="#9933CC" bgcolor="#CCCCFF"><?php
while ($aResexec = mysql_fetch_row($rquerysexec))
{
?>
<tr>
<td align="center"><?php echo $aResexec[1]; ?></td>
</tr>
<?php
}
echo "</table>";
echo"<br>";
//calcul reppartion par mois
$lig=0;
$reqsql="select count(*) from ".$renseignementsc." where month(datecotisation) =1";
$res1 = mysql_query($reqsql);
$jan = mysql_result($res1,$lig);
$reqsql="select count(*) from ".$renseignementsc." where month(datecotisation) =2";
$res2 = mysql_query($reqsql);
$fev = mysql_result($res2,$lig);
$reqsql="select count(*) from ".$renseignementsc." where month(datecotisation) =3";
$res3 = mysql_query($reqsq3);
$mars = mysql_result($res1,$lig);
$reqsql="select count(*) from ".$renseignementsc." where month(datecotisation) =4";
$res4 = mysql_query($reqsql);
$avril = mysql_result($res4,$lig);
$reqsql="select count(*) from ".$renseignementsc." where month(datecotisation) =5";
$res5 = mysql_query($reqsql);
$mai = mysql_result($res5,$lig);
$reqsql="select count(*) from ".$renseignementsc." where month(datecotisation) =6";
$res6 = mysql_query($reqsql);
$juin = mysql_result($res6,$lig);
$reqsql="select count(*) from ".$renseignementsc." where month(datecotisation) =7";
$res7 = mysql_query($reqsql);
$juil = mysql_result($res7,$lig);
$reqsql="select count(*) from ".$renseignementsc." where month(datecotisation) =8";
$res8 = mysql_query($reqsql);
$aout = mysql_result($res8,$lig);
$reqsql="select count(*) from ".$renseignementsc." where month(datecotisation) =9";
$res9 = mysql_query($reqsql);
$sept = mysql_result($res9,$lig);
$reqsql="select count(*) from ".$renseignementsc." where month(datecotisation) =10";
$res10 = mysql_query($reqsql);
$oct = mysql_result($res10,$lig);
$reqsql="select count(*) from ".$renseignementsc." where month(datecotisation) =11";
$res11 = mysql_query($reqsql);
$nov = mysql_result($res11,$lig);
$reqsql="select count(*) from ".$renseignementsc." where month(datecotisation) =12";
$res12 = mysql_query($reqsql);
$dec = mysql_result($res12,$lig);
echo "<table border=5 CELLPaDDING=1 CELLSPaCING=1 BORDERCOLOR=#CC6600 BGCOLOR= #FFCC99 ><th width = 70>".$anneec."</th>";
echo "</table>";
echo "<table border=5 CELLPaDDING=1 CELLSPaCING=1 BORDERCOLOR=#CC6600 BGCOLOR= #FFCC99 >
<tr><td width = 70 align=center >$jan</td>
<tr><td width = 70 align=center >$fev</td>
<tr><td width = 70 align=center >$mars</td>
<tr><td width = 70 align=center >$avril</td>
<tr><td width = 70 align=center >$mai</td>
<tr><td width = 70 align=center >$juin</td>
<tr><td width = 70 align=center >$juil</td>
<tr><td width = 70 align=center >$aout</td>
<tr><td width = 70 align=center >$sept</td>
<tr><td width = 70 align=center >$oct</td>
<tr><td width = 70 align=center >$nov</td>
<tr><td width = 70 align=center >$dec</td>
</table>";
echo "<Br>";
echo"<th width =120>";
ci dessous l'écriture des niveaux qui crée le décalage
//col 3
echo"<th width =280>";
//calcul réppartion par age
$reqan="select count(*) from ".$membres.", ".$renseignements." where idrenseignement=idmembre and (year(datecotisation)- year(naissance)) < 19";
$resul20 = mysql_db_query(membres3e,$reqan);
$resultat20 = mysql_fetch_row($resul20);
$reqan="select count(*) from ".$membres.", ".$renseignements." where idrenseignement=idmembre and (year(datecotisation)- year(naissance)) > 19 and (year(datecotisation)- year(naissance)) < 30 ";
$resul30 = mysql_db_query(membres3e,$reqan);
$resultat30 = mysql_fetch_row($resul30);
$reqan="select count(*) from ".$membres.", ".$renseignements." where idrenseignement=idmembre and (year(datecotisation)- year(naissance)) > 29 and (year(datecotisation)- year(naissance)) < 40 ";
$resul40 = mysql_db_query(membres3e,$reqan);
$resultat40 = mysql_fetch_row($resul40);
$reqan="select count(*) from ".$membres.", ".$renseignements." where idrenseignement=idmembre and (year(datecotisation)- year(naissance)) > 39 and (year(datecotisation)- year(naissance)) < 50 ";
$resul50 = mysql_db_query(membres3e,$reqan);
$resultat50 = mysql_fetch_row($resul50);
$reqan="select count(*) from ".$membres.", ".$renseignements." where idrenseignement=idmembre and (year(datecotisation)- year(naissance)) > 49 ";
$resul60 = mysql_db_query(membres3e,$reqan);
$resultat60 = mysql_fetch_row($resul60);
echo "<table border=5 CELLPaDDING=1 CELLSPaCING=1 BORDERCOLOR=#006600# BGCOLOR= #99FFCC width =280><th >par age</th><th width = 70>".$annee."</th>";
echo "</table>";
echo "<table WIDTH= 280 border=5 CELLPaDDING=1 CELLSPaCING=1 BORDERCOLOR=#006600# BGCOLOR= #99FFCC >
<td align= center>age - 20 ans </td><td WIDTH= 70 align= center > $resultat20[0]</td></tr>
<tr><td align= center>age 20 à 29 ans</td><td align= center>$resultat30[0]</td></tr>
<tr><td align= center>age 30 à 39 ans </td><td align= center> $resultat40[0]</td></tr>
<tr><td align= center>age 40 à 49 ans </td><td align= center> $resultat50[0]</td></tr>
<tr><td align= center>age 50 ans & + </td><td align= center> $resultat60[0]</td></tr>
</table>";
echo "<Br>";
//reppartition par niveau formation
echo "</tr>";
echo "<Br>";
echo "<table border=5 CELLPaDDING=1 CELLSPaCING=1 BORDERCOLOR=#FF33CC BGCOLOR= #FFCCFF width =280><th >par niveau de formation</th><th width = 70>".$annee."</th>";
echo "</table>";
$reqniveauformation= "select niveauformation, count(*) from ".$renseignements." group by niveauformation";
mysql_select_db("membres3e");
$resultnf = mysql_query($reqniveauformation);
$nbrlig = mysql_numrows ($resultnf);
echo "<table border=5 CELLPaDDING=1 CELLSPaCING=1 WIDTH= 280 border=1 CELLPaDDING=2 CELLSPaCING=2 BORDERCOLOR=#FF33CC BGCOLOR= #FFCCFF>";
for ($lig = 0; $lig <$nbrlig; $lig++)
{
echo "<tr>";
echo"<td align=center>".mysql_result($resultnf, $lig, 0)."</td>
<td WIDTH= 70 align=center align=center>".mysql_result($resultnf, $lig, 1)."</td>";
echo "</tr>";
}
echo "</table>";
//répppartition par type adherent
$reqact="select count(*) from ".$renseignements." where etatmembres = 'actif' ";
$resulact = mysql_db_query(membres3e,$reqact);
$resultatact = mysql_fetch_row($resulact);
$reqass="select count(*) from ".$renseignements." where etatmembres = 'associ'";
$resulass = mysql_db_query(membres3e,$reqass);
$resultatass = mysql_fetch_row($resulass);
$reqdon="select count(*) from ".$renseignements." where etatmembres = 'donateur' ";
$resuldon = mysql_db_query(membres3e,$reqdon);
$resultatdon = mysql_fetch_row($resuldon);
echo "\n<br>";
echo "<table WIDTH=280 border=5 CELLPaDDING=1 CELLSPaCING=1 BORDERCOLOR=#3366CC BGCOLOR= #CCFFFF><th >par type d'adhérent</th><th width = 70>".$annee."</th>";
echo "</table>";
echo "<table border=1 BGCOLOR= #00FFFF >";
echo "<table WIDTH=280 border=5 CELLPaDDING=1 CELLSPaCING=1 BORDERCOLOR=#3366CC BGCOLOR= #CCFFFF>
<tr><td align=center>actif </td><td WIDTH= 70 align=center> $resultatact[0]</td></tr>
<tr><td align=center>associé </td><td WIDTH= 70 align=center > $resultatass[0]</td></tr>
<tr><td align=center>donateur </td><td WIDTH= 70 align=center > $resultatdon[0]</td></tr>
</table>";
echo "</tr>";
echo "<Br>";
//col 4
echo"<th width =70>";
//calcul réppartion par age
$reqan="select count(*) from ".$membresc.", ".$renseignementsc." where idrenseignement=idmembre and (year(datecotisation)- year(naissance)) < 19";
$resul20 = mysql_db_query(membres3e,$reqan);
$resultat20 = mysql_fetch_row($resul20);
$reqan="select count(*) from ".$membresc.", ".$renseignementsc." where idrenseignement=idmembre and (year(datecotisation)- year(naissance)) > 19 and (year(datecotisation)- year(naissance)) < 30 ";
$resul30 = mysql_db_query(membres3e,$reqan);
$resultat30 = mysql_fetch_row($resul30);
$reqan="select count(*) from ".$membresc.", ".$renseignementsc." where idrenseignement=idmembre and (year(datecotisation)- year(naissance)) > 29 and (year(datecotisation)- year(naissance)) < 40 ";
$resul40 = mysql_db_query(membres3e,$reqan);
$resultat40 = mysql_fetch_row($resul40);
$reqan="select count(*) from ".$membresc.", ".$renseignementsc." where idrenseignement=idmembre and (year(datecotisation)- year(naissance)) > 39 and (year(datecotisation)- year(naissance)) < 50 ";
$resul50 = mysql_db_query(membres3e,$reqan);
$resultat50 = mysql_fetch_row($resul50);
$reqan="select count(*) from ".$membresc.", ".$renseignementsc." where idrenseignement=idmembre and (year(datecotisation)- year(naissance)) > 49 ";
$resul60 = mysql_db_query(membres3e,$reqan);
$resultat60 = mysql_fetch_row($resul60);
echo "<table width = 70 border=5 CELLPaDDING=1 CELLSPaCING=1 BORDERCOLOR=#006600# BGCOLOR= #99FFCC ><th >".$anneec."</th>";
echo "</table>";
echo "<table WIDTH= 70 border=5 CELLPaDDING=1 CELLSPaCING=1 BORDERCOLOR=#006600# BGCOLOR= #99FFCC >
<td align= center > $resultat20[0]</td></tr>
<tr><td align= center>$resultat30[0]</td></tr>
<tr><td align= center> $resultat40[0]</td></tr>
<tr><td align= center> $resultat50[0]</td></tr>
<tr><td align= center> $resultat60[0]</td></tr>
</table>";
echo "<Br>";
//reppartition par niveau formation
echo "</tr>";
echo "<Br>";
echo "<table border=5 CELLPaDDING=1 CELLSPaCING=1 BORDERCOLOR=#FF33CC BGCOLOR= #FFCCFF width =70><th>".$anneec."</th>";
echo "</table>";
$reqniveauformation= "select niveauformation, count(*) from ".$renseignementsc." group by niveauformation";
mysql_select_db("membres3e");
$resultnf = mysql_query($reqniveauformation);
$nbrlig = mysql_numrows ($resultnf);
echo "<table border=5 CELLPaDDING=1 CELLSPaCING=1 WIDTH= 70 border=1 CELLPaDDING=2 CELLSPaCING=2 BORDERCOLOR=#FF33CC BGCOLOR= #FFCCFF>";
for ($lig = 0; $lig <$nbrlig; $lig++)
{
echo "<tr>";
echo"
<td align=center align=center>".mysql_result($resultnf, $lig, 1)."</td>";
echo "</tr>";
}
echo "</table>";
//répppartition par type adherent
$reqact="select count(*) from ".$renseignementsc." where etatmembres = 'actif' ";
$resulact = mysql_db_query(membres3e,$reqact);
$resultatact = mysql_fetch_row($resulact);
$reqass="select count(*) from ".$renseignementsc." where etatmembres = 'associ'";
$resulass = mysql_db_query(membres3e,$reqass);
$resultatass = mysql_fetch_row($resulass);
$reqdon="select count(*) from ".$renseignementsc." where etatmembres = 'donateur' ";
$resuldon = mysql_db_query(membres3e,$reqdon);
$resultatdon = mysql_fetch_row($resuldon);
echo "\n<br>";
echo "<table WIDTH=70 border=5 CELLPaDDING=1 CELLSPaCING=1 BORDERCOLOR=#3366CC BGCOLOR= #CCFFFF><th width = 70>".$anneec."</th>";
echo "</table>";
echo "<table border=1 BGCOLOR= #00FFFF >";
echo "<table WIDTH=70 border=5 CELLPaDDING=1 CELLSPaCING=1 BORDERCOLOR=#3366CC BGCOLOR= #CCFFFF>
<tr><td align=center> $resultatact[0]</td></tr>
<tr><td align=center > $resultatass[0]</td></tr>
<tr><td align=center > $resultatdon[0]</td></tr>
</table>";
echo "</tr>";
echo "<Br>";
je pense avoir mis tous les éléments pour une bonne compréhension afin que vous puissiez juger du "problème"
si quelqu'un a une solution
merci d'avance
atoll