--- a/displayCalendar.php +++ b/displayCalendar.php @@ -65,13 +65,15 @@ $query = 'SELECT 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") '; +SUM(value) as val, count(1) as count FROM contractnotice WHERE '.$yearQ.' "childCN" is null GROUP BY extract(year from "contractStart"), extract(month from "contractStart") +ORDER BY extract(year from "contractStart") asc, extract(month from "contractStart") asc'; $query = $conn->prepare($query); $query->execute(); databaseError($conn->errorInfo()); echo " + @@ -81,7 +83,7 @@ setlocale(LC_MONETARY, 'en_US'); $value = number_format(doubleval($row["val"]), 2); $month_name = date('F', mktime(0, 0, 0, $row[1])); - echo (''); + echo (''); } echo "
Num Month/Year Total Contracts Value Number of Contracts
'.$month_name.' '.$row[0].'$'.$value.'(' .$row['count'].' contracts)
'.$row[0].'-'.$row[1].''.$month_name.' '.$row[0].'$'.$value.'(' .$row['count'].' contracts)
"; }