fix date input again
--- a/displayCalendar.php
+++ b/displayCalendar.php
@@ -5,9 +5,9 @@
if ($_REQUEST['month']) {
- $monthParts = explode("-", str_replace(Array("'","/","\\",'-'), "",$_REQUEST['month']));
- $year = $monthParts[1];
- $month = $monthParts[0];
+ $monthParts = explode("-", str_replace(Array("'","/","\\"), "",$_REQUEST['month']));
+ $year = str_replace('-', '',$monthParts[1]);
+ $month = str_replace('-', '',$monthParts[0]);
$monthName = date("F Y", mktime(0,0,0,$month,1,$year));
include_header($monthName);
@@ -81,7 +81,7 @@
setlocale(LC_MONETARY, 'en_US');
$value = number_format(doubleval($row["val"]), 2);
$month_name = date('F', mktime(0, 0, 0, $row[1]));
- echo ('<tr><td><b><a href="?month=$row[1]-$row[0]">'.$month_name.' '.$row[0].'</a></b></td><td>$'.$value.'</td><td>(' .$row['count'].' contracts)</td></tr>');
+ echo ('<tr><td><b><a href="?month='.$row[1].'-'.$row[0].'">'.$month_name.' '.$row[0].'</a></b></td><td>$'.$value.'</td><td>(' .$row['count'].' contracts)</td></tr>');
}
echo "</table>";
}
--- a/sitemap.xml.php
+++ b/sitemap.xml.php
@@ -43,7 +43,8 @@
}
}
if ($_REQUEST['section'] == "supplier") {
- $result = $conn->query('SELECT DISTINCT "supplierABN", "supplierName" from contractnotice');
+ $result = $conn->query('SELECT DISTINCT on ("supplierID") (
+ case when "supplierABN" != 0 THEN "supplierABN"::text ELSE "supplierName" END) as "supplierID", "supplierABN", "supplierName" from contractnotice');
foreach ($result->fetchAll() as $row) {