add amendments metric
add amendments metric

file:a/about.php -> file:b/about.php
--- a/about.php
+++ b/about.php

--- a/cutenews/data/auto_archive.db.php
+++ b/cutenews/data/auto_archive.db.php

--- a/cutenews/data/cat.num.php
+++ b/cutenews/data/cat.num.php

--- a/cutenews/data/category.db.php
+++ b/cutenews/data/category.db.php

--- a/cutenews/data/config.php
+++ b/cutenews/data/config.php

--- a/cutenews/data/flood.db.php
+++ b/cutenews/data/flood.db.php

--- a/cutenews/data/ipban.db.php
+++ b/cutenews/data/ipban.db.php

--- a/cutenews/data/rss_config.php
+++ b/cutenews/data/rss_config.php

--- a/cutenews/data/users.db.php
+++ b/cutenews/data/users.db.php

--- a/cutenews/example1.php
+++ b/cutenews/example1.php

--- a/cutenews/example2.php
+++ b/cutenews/example2.php

--- a/cutenews/inc/functions.inc.php
+++ b/cutenews/inc/functions.inc.php

--- a/cutenews/inc/shows.inc.php
+++ b/cutenews/inc/shows.inc.php

--- a/cutenews/index.php
+++ b/cutenews/index.php

--- a/cutenews/register.php
+++ b/cutenews/register.php

--- a/cutenews/rss.php
+++ b/cutenews/rss.php

--- a/cutenews/search.php
+++ b/cutenews/search.php

--- a/cutenews/show_archives.php
+++ b/cutenews/show_archives.php

--- a/cutenews/show_news.php
+++ b/cutenews/show_news.php

--- a/cutenews/skins/compact.skin.php
+++ b/cutenews/skins/compact.skin.php

--- a/cutenews/skins/default.skin.php
+++ b/cutenews/skins/default.skin.php

--- a/cutenews/skins/simple.skin.php
+++ b/cutenews/skins/simple.skin.php

--- a/displayAgency.php
+++ b/displayAgency.php
@@ -19,6 +19,7 @@
   

   --- info

   website, procurement plan, annual reports

+  Breakdown of divisions/branches

   Breakdown percentage,number,value by procurement type

   Histograph, overlaying number value reported per week over X years

   Compliance statistics: amendments, delay in reporting average and number completely late*/


--- /dev/null
+++ b/displayAmendments.php
@@ -1,1 +1,20 @@
+<?php

+include_once ("./lib/common.inc.php");

+    include_header("Amendments");

+$query = "select CNID, description, value, pvalue, (value - pvalue) as diff from contractnotice, (SELECT CNID as cn, childCN as ccn, value as pvalue FROM contractnotice where childCN > 0) a where CNID = ccn order by diff DESC";

+$result = mysql_query($query);

+echo "<table>";

+while ($row = mysql_fetch_array($result, MYSQL_BOTH)) {

+  setlocale(LC_MONETARY, 'en_US');

+  $value = number_format(doubleval($row['value']) , 2);

+  $pvalue = number_format(doubleval($row['pvalue']) , 2);

+  $diff = number_format(doubleval($row['diff']) , 2);

+  echo ("<tr>");

+  echo "<td><A href=\"displayContract.php?CNID={$row['CNID']}\"><b>{$row['description']}</b></a></td>";

+  echo "<td>\$$pvalue</td><td>\$$value</td><td>\$$diff</td></tr>";

+}

+echo "</table>";

+mysql_free_result($result);

+include_footer();

+?>

 

--- a/displayCalendar.php
+++ b/displayCalendar.php
@@ -1,15 +1,38 @@
 <?php

 include_once("./lib/common.inc.php");

+

+include_header("Months and Years");

+

+if ($_REQUEST['category']) {

+    echo "<center><h1>".$_REQUEST['category']."</h1></center>";

+  $query = "SELECT CNID, description, value, agencyName, category, contractStart, supplierName

+    FROM `contractnotice`

+    WHERE childCN = 0 

+    AND category = '" . $_REQUEST['category'] . "'

+    ORDER BY value DESC";

+  $result = mysql_query($query);

+  echo "<table>";

+  while ($row = mysql_fetch_array($result, MYSQL_BOTH)) {

+    setlocale(LC_MONETARY, 'en_US');

+    $value = number_format(doubleval($row['value']) , 2);

+    echo ("<tr>

+    <td><a href=\"displayContract.php?CNID={$row['CNID']}\">{$row['CNID']}</a></td>

+    <td><b>{$row['description']}</b></a></td>

+    <td>\$$value</td><td>{$row['agencyName']}</td>

+    <td>{$row['contractStart']}</td>

+    <td>{$row['supplierName']}</td>

+    </tr>");

+  }

+  echo "</table>";

+  mysql_free_result($result);

+} else {

 /*

      split by year

-    */

-/*

 todo:

 Year/Month drilldown - largest contracts, agencies, suppliers

 big picture graphs?*/

 

 

-include_header("Months and Years");

 $query = "SELECT YEAR(contractStart), MONTH(contractStart),

 value FROM `contractnotice` WHERE childCN = 0 GROUP BY MONTH(contractStart), YEAR(contractStart) ORDER BY YEAR(contractStart), MONTH(contractStart) ";

 

@@ -23,6 +46,6 @@
 }

 echo "</table>";

 mysql_free_result($result);

-

+}

 include_footer();

 ?>

--- a/displayCategory.php
+++ b/displayCategory.php

--- a/displayConfidentialities.php
+++ b/displayConfidentialities.php
@@ -1,4 +1,31 @@
-agencies that use alot of consultacies
+<?php
+
+include_once("./lib/common.inc.php");
+/*
+
+
+agencies that use alot of Confidentialities
 suppliers that provide alot
 how much is spent overall per year
+*/
 
+include_header("Confidentialities");
+$query = "SELECT value, procurementMethod
+FROM `contractnotice`
+GROUP BY procurementMethod ";
+
+$result = mysql_query($query);
+
+echo "<table>";
+while ($row = mysql_fetch_array($result, MYSQL_BOTH)) {
+setlocale(LC_MONETARY, 'en_US');
+$value = number_format(doubleval($row[0]),2);
+    echo ("<tr><td><b>{$row[1]}</b></td><td>\$$value</td></tr>");
+}
+echo "</table>";
+mysql_free_result($result);
+include_footer();
+?>
+
+
+

--- a/displayConsultancies.php
+++ b/displayConsultancies.php
@@ -1,4 +1,31 @@
+<?php
+
+include_once("./lib/common.inc.php");
+/*
+
+
 agencies that use alot of consultacies
 suppliers that provide alot
 how much is spent overall per year
+*/
 
+include_header("Consultancies");
+$query = "SELECT value, procurementMethod
+FROM `contractnotice`
+GROUP BY procurementMethod ";
+
+$result = mysql_query($query);
+
+echo "<table>";
+while ($row = mysql_fetch_array($result, MYSQL_BOTH)) {
+setlocale(LC_MONETARY, 'en_US');
+$value = number_format(doubleval($row[0]),2);
+    echo ("<tr><td><b>{$row[1]}</b></td><td>\$$value</td></tr>");
+}
+echo "</table>";
+mysql_free_result($result);
+include_footer();
+?>
+
+
+

--- a/displayContract.php
+++ b/displayContract.php

--- a/displayMap.php
+++ b/displayMap.php

--- a/displayProcurementMethod.php
+++ b/displayProcurementMethod.php

--- a/displaySupplier.php
+++ b/displaySupplier.php
@@ -9,7 +9,7 @@
    echo '<img src="graphs/displayMethodValueGraph.php?supplier=' . stripslashes($supplier) . '">';
   /*lobbyist ties
   
-  
+  links to ABR/ASIC/Google News/ASX/Court records
   
   total value to various agencies (bar graph)
   
@@ -19,7 +19,9 @@
   
   spread of industries (textual?)*/
 } else {
-    
+    /*
+     histograph of supplier size/value
+    */
 include_header("Suppliers");
   $query = "SELECT SUM(value) as val, supplierName, supplierABN
 FROM `contractnotice`

--- a/futureindex.php
+++ b/futureindex.php

--- a/graphs/displayAgenciesGraph.php
+++ b/graphs/displayAgenciesGraph.php

--- a/graphs/displayAgencySuppliersGraph.php
+++ b/graphs/displayAgencySuppliersGraph.php

--- a/graphs/displayCnCGraph.php
+++ b/graphs/displayCnCGraph.php

--- a/graphs/displayContractPublishedGraph.php
+++ b/graphs/displayContractPublishedGraph.php

--- a/graphs/displayContractStartingGraph.php
+++ b/graphs/displayContractStartingGraph.php

--- a/graphs/displayHeatmap.php
+++ b/graphs/displayHeatmap.php

--- a/graphs/displayMethodCountGraph.php
+++ b/graphs/displayMethodCountGraph.php

--- a/graphs/displayMethodValueGraph.php
+++ b/graphs/displayMethodValueGraph.php

--- a/graphs/displaySuppliersGraph.php
+++ b/graphs/displaySuppliersGraph.php

--- a/lib/bsn.AutoSuggest_2.1.3_comp.js
+++ b/lib/bsn.AutoSuggest_2.1.3_comp.js

--- a/lib/common.inc.php
+++ b/lib/common.inc.php
@@ -59,7 +59,7 @@
             <script type="text/javascript" src="lib/bsn.AutoSuggest_2.1.3_comp.js" charset="utf-8"></script>

 

 <link rel="stylesheet" href="autosuggest_inquisitor.css" type="text/css" media="screen" charset="utf-8" />

-            <script type="text/javascript" src="lib/jquery.js"></script>

+            <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>

 <script type="text/javascript">

 $(document).ready(function()

 {

@@ -86,6 +86,7 @@
             <a href="displayProcurementMethod.php">procurement method</a>

             <a href="displayConfidentialities.php">contractual confidentiality</a>

             <a href="displayConsultancies.php">consultancies</a>

+            <a href="displayAmendments.php">consultancies</a>

             <a href="displayMap.php">postcodes</a>

             <div id="search"><form method="post" action="search.php" class="asholder">

 	<label for="searchKeyword">search</label>

@@ -106,7 +107,7 @@
              <div id="bd" role="main"> 

     <div id="yui-main"> 

         <div class="yui-b"><div class="yui-g">

-<?

+<?php

 $start = (float) array_sum(explode(' ',microtime())); 

 }

 

@@ -125,7 +126,9 @@
         </li>

         </ul> <br>        </div> </div>

      

-    <?

+    <?php

    echo '<div id="ft"><p>'."Processing time: ". sprintf("%.4f", ($end-$start))." seconds".'</p></div>'; 

-echo '</div> </body> </html>';

-} ?>
+   echo '</div> </body> </html>';

+} 

+?>

+

--- a/lib/jpgraph/contour_dev/findpolygon.php
+++ b/lib/jpgraph/contour_dev/findpolygon.php

--- a/lib/jpgraph/contour_dev/tri-quad.php
+++ b/lib/jpgraph/contour_dev/tri-quad.php

--- a/lib/jpgraph/gd_image.inc.php
+++ b/lib/jpgraph/gd_image.inc.php

--- a/lib/jpgraph/imgdata_balls.inc.php
+++ b/lib/jpgraph/imgdata_balls.inc.php

--- a/lib/jpgraph/imgdata_bevels.inc.php
+++ b/lib/jpgraph/imgdata_bevels.inc.php

--- a/lib/jpgraph/imgdata_diamonds.inc.php
+++ b/lib/jpgraph/imgdata_diamonds.inc.php

--- a/lib/jpgraph/imgdata_pushpins.inc.php
+++ b/lib/jpgraph/imgdata_pushpins.inc.php

--- a/lib/jpgraph/imgdata_squares.inc.php
+++ b/lib/jpgraph/imgdata_squares.inc.php

--- a/lib/jpgraph/imgdata_stars.inc.php
+++ b/lib/jpgraph/imgdata_stars.inc.php

--- a/lib/jpgraph/jpg-config.inc.php
+++ b/lib/jpgraph/jpg-config.inc.php

file: