--- a/displayAgency.php
+++ b/displayAgency.php
@@ -1,42 +1,41 @@
prepare($query);
-$query->bindParam(":agency", $agency);
- $query->execute();
- if (!$query) {
- databaseError($conn->errorInfo());
- }
+ ORDER BY "value" DESC limit 100';
+ $query = $conn->prepare($query);
+ $query->bindParam(":agency", $agency);
+ $query->execute();
+ databaseError($conn->errorInfo());
- echo "
+ echo "
Contract Notice Number |
Contract Description |
@@ -46,46 +45,44 @@
Supplier |
";
- foreach ($query->fetchAll() as $row) {
- setlocale(LC_MONETARY, 'en_US');
- $value = number_format(doubleval($row['value']) , 2);
- echo ("
+ foreach ($query->fetchAll() as $row) {
+ setlocale(LC_MONETARY, 'en_US');
+ $value = number_format(doubleval($row['value']), 2);
+ echo ("
{$row['CNID']} |
{$row['description']} |
\$$value | {$row['agencyName']} |
{$row['contractStart']} |
{$row['supplierName']} |
");
- }
- echo "
";
+ }
+ echo "
";
} else {
/*
- split by portfolio
- */
-include_header("Agencies");
-agenciesGraph();
- $query = 'SELECT SUM("value"), "agencyName"
+ split by portfolio
+ */
+ include_header("Agencies");
+ agenciesGraph();
+ $query = 'SELECT SUM("value"), "agencyName"
FROM contractnotice
-WHERE "childCN" = 0
+WHERE "childCN" is null
GROUP BY "agencyName" ';
-$query = $conn->prepare($query);
- $query->execute();
- if (!$query) {
- databaseError($conn->errorInfo());
- }
- echo "
+ $query = $conn->prepare($query);
+ $query->execute();
+ databaseError($conn->errorInfo());
+ echo "
Agency |
Total Contracts Value |
";
- foreach ($query->fetchAll() as $row) {
- setlocale(LC_MONETARY, 'en_US');
- $value = number_format(doubleval($row[0]) , 2);
- $agency = stripslashes($row[1]);
- echo ("{$agency} | \$$value |
\n");
- }
- echo "
";
+ foreach ($query->fetchAll() as $row) {
+ setlocale(LC_MONETARY, 'en_US');
+ $value = number_format(doubleval($row[0]), 2);
+ $agency = stripslashes($row[1]);
+ echo ("{$agency} | \$$value |
\n");
+ }
+ echo "
";
}
include_footer();
?>