<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head><title>camembert</title></head>
<body>
<?

function array_to_camembert ($Parts)
{
	# il faut  camembert.php3 dans le meme répertoire
	require ('camembert.php3');
	
	$camembert = new camembert;
	$camembert->trace(400,400,30,$Parts,10,'ffff99','ff9966','ff6666','ccccff','bbbbbb','000000','ff6600','ffffff');
	
	#Visionnage du graphe et sa destruction de la RAM du serveur pour ne le laisser qu'en fichier .gif.
	if (function_exists("imagegif")) {
	 	imagegif($camembert,'camembert.gif');
		echo "<img src='camembert.gif' border=0>";
	}
	elseif (function_exists("imageJpeg")) {
		imagejpeg($camembert,'camembert.jpg', 0.5);
		echo "<img src='camembert.jpg' border=0>";
	}
	elseif (function_exists("imagePng")) {
		imagepng($camembert,'camembert.png');
		echo "<img src='camembert.png' border=0>";
	}
	elseif (function_exists("imagewbmp")) {
		 imagewbmp($camembert,'camembert.wbmp');
		echo "<img src='camembert.wbmp' border=0>";
	}
	else
		die("Pas de support graphique avec PHP sur ce serveur");
	imagedestroy($camembert);
	
	echo "<img src='camembert.gif' border=0>";
}
/*
$Parts[Compaq] = 452;
$Parts[Dell] = 753;
$Parts[HP] = 258;
$Parts[IBM] = 584;
$Parts[NEC] = 351;
$Parts[Gateway] = 155;
$Parts[Autres] = 996;
$Parts[fytku] = 100;
$Parts[dtyk] = 047;
$Parts[ryt] = 753;
$Parts[cgyigcyi] = 357;
$Parts[dty] = 399;
$Parts[ti] = 456;
$Parts[tu] = 159;
*/
?>

<p><? if (function_exists("imagecreate")) array_to_camembert($Parts); ?></p>
</body>
</html>