lotta updates
[contractdashboard.git] / displayAgency.php
blob:a/displayAgency.php -> blob:b/displayAgency.php
--- a/displayAgency.php
+++ b/displayAgency.php
@@ -113,12 +113,16 @@
     "contractStart", "supplierName"
     FROM contractnotice
     WHERE ' . $yearQ . ' "agencyName" LIKE :agency AND "childCN" IS NULL
-    ORDER BY "value" DESC LIMIT 100';
+    ORDER BY "value" DESC';
+if ($yearQ == '') $query .=' LIMIT 1000';
     $query = $conn->prepare($query);
     $query->bindParam(":agency", $agency);
     $query->execute();
     databaseError($conn->errorInfo());
-
+if ($query->rowCount() > 999 && $yearQ == '') {
+// if 1000 records warn too many results
+print "<b> More than 1000 results found so only first 1000 shown. Please filter by year to see all results </b>";
+}
     echo "<h3>Contracts</h3><table>  <thead>
     <tr>
       <th>Contract Notice Number</th>