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
|
<?php
include ("../../graph/jpgraph.php");
include ("../../graph/jpgraph_pie.php");
$db = mysql_connect('localhost', 'root', '') or die('erreur');
mysql_select_db('Mediatheque',$db) or die('erreur');
$DVD="select FldIdRef from tblDVD";
$DVD = mysql_query($DVD) or die('Erreur SQL !<br>'.$DVD.'<br>'.mysql_error());
//$row_RsListeDVD = mysql_fetch_assoc($DVD);
$totalRows_DVD = mysql_num_rows($DVD);
$STV="select distinct FldIdRef from tblseriestv";
$STV = mysql_query($STV) or die('Erreur SQL !<br>'.$STV.'<br>'.mysql_error());
//$row_RsListeSTV = mysql_fetch_assoc($STV);
$totalRows_STV = mysql_num_rows($STV);
$VHS="select FldIdRef from tblvhs";
$VHS = mysql_query($VHS) or die('Erreur SQL !<br>'.$VHS.'<br>'.mysql_error());
//$row_RsListeVHS = mysql_fetch_assoc($VHS);
$totalRows_VHS = mysql_num_rows($VHS);
$data = array($totalRows_DVD,$totalRows_STV,$totalRows_VHS);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!-- DW6 -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Les Statistiques sur les Films</title>
</head>
<body
<table width="99%" height="600" cellpadding="0" cellspacing="0" border="0">
<tr>
<?
// Create the Pie Graph.
$graph = new PieGraph(500,350,"auto");
$graph->SetShadow();
// Set A title for the plot
$graph->title->Set("Statistiques sur les Films");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
// Create
$p1 = new PiePlot($data);
$p1->SetLegends(array("DVD","Série Télévisée","Vhs"));
$graph->Add($p1);
$graph->Stroke();
?>
</tr></table
</body>
</html> |
Partager