Change references to numeric child/parent IDs which can now be text
[contractdashboard.git] / displayCalendar.php
blob:a/displayCalendar.php -> blob:b/displayCalendar.php
--- a/displayCalendar.php
+++ b/displayCalendar.php
@@ -8,7 +8,7 @@
 $monthParts = explode("-",$_REQUEST['month']);

   $query = 'SELECT "CNID", "description", "value", "agencyName", "category", "contractStart", "supplierName"

     FROM contractnotice

-    WHERE "childCN" = 0 

+    WHERE "childCN" is null

     AND extract(year from "contractStart") = :year

     AND extract(month from "contractStart")  = :month

     ORDER BY value DESC';

@@ -61,7 +61,7 @@
 

 

 $query = 'SELECT extract(year from "contractStart"), extract(month from "contractStart"),

-SUM(value) as val, count(1) as count FROM contractnotice WHERE "childCN" = 0 GROUP BY extract(year from "contractStart"), extract(month from "contractStart") ORDER BY extract(year from "contractStart"), extract(month from "contractStart") ';

+SUM(value) as val, count(1) as count FROM contractnotice WHERE "childCN" is null GROUP BY extract(year from "contractStart"), extract(month from "contractStart") ORDER BY extract(year from "contractStart"), extract(month from "contractStart") ';

 $query = $conn->prepare($query);

   $query->execute();

   if (!$query) {