Valid XHTML    Valid CSS2    

Listing du fichier categstages.php

 

00001     <?php
00002     
include("../std.php") ;
00003     include(
"../statuno.php") ;
00004     
$tit
= "Statistiques sur les Stages de Maitrise M.A.S.S. à l'Université d'Angers" ;
00005     
debutPage
($tit) ;
00006     
blockquote() ;
00007     
debutSection() ;
00008     
h1
($tit) ;
00009     
########################################################
00010     
00011     
mysql_connect
("localhost","anonymous","anonymous") ;
00012     
mysql_select_db
("statdata") ;
00013     
00014     
$res
= mysql_query("select count(nom) from stagesMaitrise ") ;
00015     
$ligr
= mysql_fetch_array($res) ;
00016     
$nbstg
= $ligr["count(nom)"] ;
00017     
00018     
$res
= mysql_query("select distinct an from stagesMaitrise order by an desc") ;
00019     
$nban
= 0 ;
00020     while (
$ligr
=mysql_fetch_array($res)) {
00021     
$nban
++ ; $an[$nban] = $ligr["an"] ;
00022     } ;
# fin de tant que
00023     
00024     
blockquote() ;
00025     
00026     
p() ;
00027     echo
"<font size='4' color='blue'>";
00028     
$mpa
= sprintf("%3.1f",$nbstg/$nban) ;
00029     echo
b
("Il y a $nbstg stages répartis sur $nban années soit approximativement $mpa stages par an.") ;
00030     echo
"</font>" ;
00031     
finp() ;
00032     
00033     
p() ;
00034     echo
"Nombre de stages par catégorie :" ;
00035     
finp() ;
00036     
00037     
blockquote() ;
00038     
table
(1,5,"colapse") ;
00039     
tr() ;
00040     
th
() ; echo "Catégorie" ; finth() ;
00041     
th
() ; echo "Nb Stages" ; finth() ;
00042     
th
() ; echo "Description" ; finth() ;
00043     
th
() ; echo "Pourcentage" ; finth() ;
00044     
fintr() ;
00045     
00046     
$nbca
= 5 ;
00047     
$cat
[1] = "gp" ; $dcat[1] = " Gestion de production " ;
00048     
$cat
[2] = "info" ; $dcat[2] = " Informatique (analyse, développement...)" ;
00049     
$cat
[3] = "mkg" ; $dcat[3] = " Marketing " ;
00050     
$cat
[4] = "rh" ; $dcat[4] = " Ressources humaines " ;
00051     
$cat
[5] = "stat" ; $dcat[5] = " Statistiques et Analyse des données " ;
00052     
00053     
$ica
= 1 ;
00054     
$stgdata
= "" ;
00055     
$labels
= "" ;
00056      while (
$ica
<=$nbca) {
00057     
$cac
= $cat[$ica] ;
00058     
$labels
.= $cac ;
00059      if (
$ica
<$nbca) { $labels .= "_" ; }
00060     
$res
= mysql_query("select count(nom) from stagesMaitrise where categorie = \"$cac\" ") ;
00061     
$ligr
= mysql_fetch_array($res) ;
00062     
$nba
= $ligr["count(nom)"] ;
00063     
$pcn
= sprintf(" %3.0f",100.0*$nba/$nbstg) ;
00064     
$stgdata
.= $nba ;
00065      if (
$ica
<$nbca) { $stgdata .= "_" ; }
00066     
tr() ;
00067     
td
() ; echo "&nbsp;&nbsp;&nbsp;$cat[$ica]" ; fintd() ;
00068     
td
("R") ; echo $nba ; fintd() ;
00069     
td
() ; echo "&nbsp;$dcat[$ica]" ; fintd() ;
00070     
td
("R") ; echo "$pcn %" ; fintd() ;
00071     
fintr() ;
00072     
$ica++;
00073      } ;
# fin tant que sur ian
00074     
fintable() ;
00075     
finblockquote() ;
00076     
00077     
pvide() ;
00078     
00079     
p
("center") ;
00080     
$titImg
= urlencode("Répartition des catégories de stages") ;
00081     
$img
= "../jphistopct.php?vdata=$stgdata&amp;xmrks=$labels&amp;titr=$titImg" ;
00082     echo
img
($img,"stages") ;
00083     
finp() ;
00084     
# pour debug :
00085     
echo
"<pre>echo $img</pre>\n" ;
00086     
00087     
## doit produire :
00088     ## ../jphistopct.php?vdata=8_93_5_3_35
00089     ## &xmrks=gp_info_mkg_rh_stat
00090     ## &titr=R%E9partition+des+cat%E9gories+de+stages
00091     
00092     
finblockquote() ;
00093     
00094     
########################################################
00095     
finSection() ;
00096     
finblockquote() ;
00097     
finPage() ;
00098     
?>

Pour ne pas voir les numéros de ligne, ajoutez &nl=non à la suite du nom du fichier.

 

 

retour gH    Retour à la page principale de   (gH)