Top
Home


<?php
ini_set('error_reporting', E_ALL | E_STRICT);
ini_set('display_errors', 'On');
$link = mysql_connect("localhost", "USERNAME", "PASSWORD");
mysql_select_db("DATABASE", $link);

require_once ('jpgraph/src/jpgraph.php');
require_once ('jpgraph/src/jpgraph_pie.php');

$Reading = mysql_query("SELECT * FROM  THETABLE where FIELDONE like 'Reading' and FIELDTWO like 'Web Integration'", $link);$Reading =mysql_num_rows($Reading);
$Forum = mysql_query("SELECT * FROM  THETABLE where FIELDONE like 'Forum' and FIELDTWO like 'Web Integration'", $link);$Forum =mysql_num_rows($Forum);
$Video = mysql_query("SELECT * FROM  THETABLE where FIELDONE like 'Video' and FIELDTWO like 'Web Integration'", $link);$Video = mysql_num_rows($Video);
$Exercise = mysql_query("SELECT * FROM  THETABLE where FIELDONE like 'Exercise' and FIELDTWO like 'Web Integration'", $link);$Exercise = mysql_num_rows($Exercise);
$Worksheet = mysql_query("SELECT * FROM  THETABLE where FIELDONE like 'Worksheet' and FIELDTWO like 'Web Integration'", $link);$Worksheet = mysql_num_rows($Worksheet);
$Lecture = mysql_query("SELECT * FROM  THETABLE where FIELDONE like 'Lecture' and FIELDTWO like 'Web Integration'", $link);$Lecture = mysql_num_rows($Lecture);
$Movie = mysql_query("SELECT * FROM  THETABLE where FIELDONE like 'Movie' and FIELDTWO like 'Web Integration'", $link);$Movie = mysql_num_rows($Movie);
$Quiz = mysql_query("SELECT * FROM  THETABLE where FIELDONE like 'Quiz' and FIELDTWO like 'Web Integration'", $link);$Quiz = mysql_num_rows($Quiz);
$WebQuest = mysql_query("SELECT * FROM  THETABLE where FIELDONE like 'Web Quest' and FIELDTWO like 'Web Integration'", $link);$WebQuest = mysql_num_rows($WebQuest);
$data = array(
$Reading,$Forum,$Video,$Exercise,$Worksheet,$Lecture,$Movie,$Quiz,$WebQuest
);

// Create the Pie Graph.
$graph = new PieGraph(450,350);
//$graph->SetTheme(new $theme_class());
// Set A title for the plot
$graph->title->Set("Attendance");
$graph->SetBox(true);
// Create
$p1 = new PiePlot($data);
$graph->Add($p1);
$p1->ShowBorder();
$p1->SetColor('white');
$p1->SetSliceColors(array('#FF0000','#FFFF00','#00FF00','#00FFFF','#33A457','#00ACEC','#FF00FF','#D66C51','#CA0088'));
$graph->Stroke();
?>