<?php |
<?php |
|
|
include_once("./lib/common.inc.php"); |
include_once("./lib/common.inc.php"); |
/* |
/* |
|
|
|
|
agencies that use alot of Confidentialities |
agencies that use alot of Confidentialities |
suppliers that provide alot |
suppliers that provide alot |
how much is spent overall per year |
how much is spent overall per year |
*/ |
*/ |
|
|
include_header("Confidentialities"); |
include_header("Confidentialities"); |
$query = "SELECT value, procurementMethod |
$query = ' |
FROM `contractnotice` |
SELECT SUM(value) as value,count(*), reason |
GROUP BY procurementMethod "; |
FROM |
|
(select value, unnest(string_to_array(replace("confidentialityContractReason",\'Other - \',\'\'),\';\')) reason from contractnotice where "confidentialityContractReason" != \'\' and "confidentialityContractReason" != "confidentialityOutputsReason" |
|
union select value, unnest(string_to_array(replace("confidentialityOutputsReason",\'Other - \',\'\'),\';\')) reason from contractnotice where "confidentialityOutputsReason" != \'\' and "confidentialityContractReason" != "confidentialityOutputsReason" |
|
union select value, unnest(string_to_array(replace("confidentialityOutputsReason",\'Other - \',\'\'),\';\')) reason from contractnotice where "confidentialityOutputsReason" != \'\' and "confidentialityContractReason" = "confidentialityOutputsReason") a |
|
GROUP BY reason ORDER BY value desc |
|
'; |
|
|
$query = $conn->prepare($query); |
$query = $conn->prepare($query); |
$query->execute(); |
$query->execute(); |
databaseError($conn->errorInfo()); |
databaseError($conn->errorInfo()); |
|
|
echo "<table>"; |
echo "<table>"; |
foreach ($query->fetchAll() as $row) { |
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[1]} contract".($row[1] >1 ? 's':'')."<td>\$$value</td></tr>"); |
} |
} |
echo "</table>"; |
echo "</table>"; |
include_footer(); |
include_footer(); |
?> |
?> |
|
|
|
|
|
|