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
| <?php
session_start ();
header('Content-Type: text/html; charset=ISO-8859-1');
// On récupère nos variables de session
if (isset($_SESSION['login']) && isset($_SESSION['pass'])) {
include('../includes/connectionbdd.php');
$datefiche1=$_POST['datefiche1'];
$datefiche2=$_POST['datefiche2'];
$datefiche1new = convert_date_to_num($datefiche1);
$datefiche2new = convert_date_to_num($datefiche2);
//Calcul du nombre de dossiers Envoye
$req= "SELECT * FROM ficheform
INNER JOIN etatfiche
ON etatfiche.numetat = ficheform.numetat
INNER JOIN stagiaire_ficheform
ON stagiaire_ficheform.numfiche = ficheform.numfiche
WHERE (datefiche BETWEEN '$datefiche1new' AND '$datefiche2new')
AND (ficheform.numetat IN (1,3,4))";
$result = mysql_query($req)
or die ('Erreur 1: ' . mysql_error());
$total1 = mysql_num_rows($result);
//Calcul du nombre de dossiers Recu
$req2= "SELECT * FROM ficheform
INNER JOIN etatfiche
ON etatfiche.numetat = ficheform.numetat
INNER JOIN stagiaire_ficheform
ON stagiaire_ficheform.numfiche = ficheform.numfiche
WHERE (datefiche BETWEEN '$datefiche1new' AND '$datefiche2new')
AND (ficheform.numetat IN (2,5,7,8,9))";
$result2 = mysql_query($req2)
or die ('Erreur 1: ' . mysql_error());
$total2 = mysql_num_rows($result2);
//Calcul du nombre de dossiers Annule
$req3= "SELECT * FROM ficheform
INNER JOIN etatfiche
ON etatfiche.numetat = ficheform.numetat
INNER JOIN stagiaire_ficheform
ON stagiaire_ficheform.numfiche = ficheform.numfiche
WHERE (datefiche BETWEEN '$datefiche1new' AND '$datefiche2new')
AND (ficheform.numetat IN (6,10))";
$result3 = mysql_query($req3)
or die ('Erreur 1: ' . mysql_error());
$total3 = mysql_num_rows($result3);
$totalgen = $total1+$total2+$total3;
$pctotal1 = round((100/$totalgen)*$total1)."%";
$libelle1 = 'Envoye';
$deg1 = (360/100)*$pctotal1;
$pctotal2 = round((100/$totalgen)*$total2)."%";
$libelle2 = 'Revenu signe';
$deg2 = (360/100)*$pctotal2;
$findeg2 = $deg1+$deg2;
$pctotal3 = round((100/$totalgen)*$total3)."%";
$libelle3 = 'Annule';
$deg3 = (360/100)*$pctotal3;
$findeg3 = $findeg2+$deg3;
/*
echo $deg1;?><br /><?
echo $pctotal1;?><br /><br /><?
echo $deg2;?><br /><?
echo $findeg2;?><br /><?
echo $pctotal2;?><br /><br /><?
echo $deg3;?><br /><?
echo $pctotal3;?><br /><br /><?
*/
$largeur=650;
$hauteur=400;
$courbe=imagecreatetruecolor($largeur, $hauteur);
$fond=imagecolorallocate($courbe,255,255,255);
$bleu=imagecolorallocate($courbe,3,107,192);
$vert=imagecolorallocate($courbe,215,205,26);
$rouge=imagecolorallocate($courbe,255,13,13);
$noir=imagecolorallocate($courbe,0,0,0);
imagefilledrectangle($courbe,0 , 0, $largeur, $hauteur, $fond);
if($deg1>0){
imagefilledarc($courbe,199,199,299,299,0,$deg1,$bleu,IMG_ARC_PIE);
}
if($deg2>0){
imagefilledarc($courbe,199,199,299,299,$deg1,$findeg2,$vert,IMG_ARC_PIE);
}
if($deg3>0){
imagefilledarc($courbe,199,199,299,299,$findeg2,$findeg3,$rouge,IMG_ARC_PIE);
}
imagestring($courbe,5,2,10,'Pour la periode du: '. $datefiche1 .' au: '. $datefiche2,$noir);
imagestring($courbe,3,390,45,'Nombre d\'acces total: '.$totalgen,$noir);
if($deg1>0){
imagestring($courbe,3,430,80,$libelle1.' ('.$total1.') '.$pctotal1,$noir);
imagefilledrectangle($courbe,400,80,390,90,$bleu);
}
if($deg2>0){
imagestring($courbe,3,430,115,$libelle2.' ('.$total2.') '.$pctotal2,$noir);
imagefilledrectangle($courbe,400,115,390,125,$vert);
}
if($deg3>0){
imagestring($courbe,3,430,150,$libelle3.' ('.$total3.') '.$pctotal3,$noir);
imagefilledrectangle($courbe,400,150,390,160,$rouge);
}
imagepng($courbe,"../images/statgen.png");
imagedestroy($courbe);
?>
<div class="formulaire">
<?php
echo'<img src="../images/statgen.png"/>';
?>
</div>
<?php
}
else
{
header('Location: login.php');
}
?> |
Partager