add amendments metric
[contractdashboard.git] / graphs / displayCnCGraph.php
blob:a/graphs/displayCnCGraph.php -> blob:b/graphs/displayCnCGraph.php
--- a/graphs/displayCnCGraph.php
+++ b/graphs/displayCnCGraph.php
@@ -3,7 +3,7 @@
 // Width and height of the graph

 $width = 800;

 $height = 300;

-$query = "select procurementMethod, count(1) as count, value, MONTH(contractStart) as month, YEAR(contractStart) as year from `contractnotice`

+$query = "select procurementMethod, count(1) as count, SUM(value) as val, MONTH(contractStart) as month, YEAR(contractStart) as year from `contractnotice`

 where $agencyQ $supplierQ childCN = 0 AND YEAR(contractStart) >= 2007 AND YEAR(contractStart) <= 2009 group by procurementMethod,year,month order by procurementMethod,year,month";

 $result = mysql_query($query);

 $methods = Array("Direct","Open","Select");

@@ -13,7 +13,7 @@
 $maxValue = 0;

 while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {

   setlocale(LC_MONETARY, 'en_US');

-  if ($row['value'] > $maxValue) $maxValue = $row['value'];

+  if ($row['val'] > $maxValue) $maxValue = $row['val'];

   $date = date( 'F ', mktime(0, 0, 0, $row["month"]) ). $row["year"];

   if (array_search($date,$dates) === false ) {

     $dates[$row["year"]*100 + $row["month"]] = $date;

@@ -57,7 +57,7 @@
 $graph2->Set90AndMargin(105, 45, 45, 45);

 // Setup a title for the graph

 $graph2->title->Set($agency);

-$graph2->SetUserFont("ttf-liberation/LiberationSans-Regular.ttf");

+$graph2->SetUserFont("liberation/LiberationSans-Regular.ttf");

 $graph2->title->SetFont(FF_USERFONT, FS_NORMAL, 12);

 // Setup font for axis

 $graph2->xaxis->SetFont(FF_USERFONT, FS_NORMAL, 10);