add amendments metric
[contractdashboard.git] / displayConsultancies.php
blob:a/displayConsultancies.php -> blob:b/displayConsultancies.php
<?php <?php
   
include_once("./lib/common.inc.php"); include_once("./lib/common.inc.php");
/* /*
   
   
agencies that use alot of consultacies agencies that use alot of consultacies
suppliers that provide alot suppliers that provide alot
how much is spent overall per year how much is spent overall per year
*/ */
   
include_header("Consultancies"); include_header("Consultancies");
$query = "SELECT value, procurementMethod $query = '
FROM `contractnotice` SELECT SUM(value) as value, count(*), text_mode("supplierName"), unnest(string_to_array("consultancyReason",\';\')) reason
GROUP BY procurementMethod "; FROM contractnotice where ' .$yearQ . ' "consultancy" = \'Yes\' and "childCN" is null
  GROUP BY "supplierABN",reason order by value desc
  ';
   
$result = mysql_query($query); $query = $conn->prepare($query);
  $query->execute();
  databaseError($conn->errorInfo());
   
echo "<table>"; echo "<table>";
while ($row = mysql_fetch_array($result, MYSQL_BOTH)) { foreach ($query->fetchAll() as $row) {
setlocale(LC_MONETARY, 'en_US'); setlocale(LC_MONETARY, 'en_US');
$value = number_format(doubleval($row[0]),2); $value = number_format(doubleval($row[0]),2);
echo ("<tr><td><b>{$row[1]}</b></td><td>\$$value</td></tr>"); echo ("<tr><td><b>{$row[2]}</b></td><td>{$row[3]}</td><td>{$row[1]} contracts</td><td>\$$value</td></tr>");
} }
echo "</table>"; echo "</table>";
mysql_free_result($result);  
include_footer(); include_footer();
?> ?>