lotta updates
[contractdashboard.git] / displaySupplier.php
blob:a/displaySupplier.php -> blob:b/displaySupplier.php
--- a/displaySupplier.php
+++ b/displaySupplier.php
@@ -226,11 +226,15 @@
 FROM contractnotice
 WHERE ' . $yearQ . ' "childCN" IS NULL
 GROUP BY supplierID,"supplierABN"
-ORDER BY val DESC
-LIMIT 100';
-    $query = $conn->prepare($query);
-    $query->execute();
-    databaseError($conn->errorInfo());
+ORDER BY val DESC';
+if ($yearQ == '') $query .=' LIMIT 1000';
+    $query = $conn->prepare($query);
+    $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 "<table>  <thead>
     <tr>
        <th>Position</th>