--- a/lib/common.inc.php +++ b/lib/common.inc.php @@ -1,27 +1,31 @@ setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); +function databaseError($errMsg) +{ + die($errMsg); +} function ucsmart($str) { - return preg_replace("/(?<=(? 0) $supplierQ = "supplierABN = '" . $supplierParts[0] . "' AND "; - else $supplierQ = "supplierName LIKE '%" . $supplierParts[1] . "%' AND "; -} -$year = mysql_real_escape_string(stripslashes($_REQUEST['year'])); + $supplierName = "%".$supplierParts[1]."%"; + $supplierABN = $supplierParts[0]; + if ($supplierParts[0] > 0) $supplierQ = ' "supplierABN" = :supplierABN AND '; + else $supplierQ = ' "supplierName" LIKE :supplierName AND '; +} + +$startYear = 2007; +$year = filter_var($_REQUEST['year'], FILTER_SANITIZE_NUMBER_INT); if ($year != "") $yearQ = "YEAR(publishDate) = " . $year . " AND "; +$standardQ = ' "childCN" = 0 '; // AND YEAR(contractStart) >= 2007 AND YEAR(contractStart) <= 2010'; $start =0.0; function include_header($title) { @@ -57,11 +67,10 @@ "http://www.w3.org/TR/html4/strict.dtd"> - Contract Dashboard - <?=$title?> + Contract Dashboard - <?php echo $title; ?> - + - + + + + +
@@ -134,5 +207,6 @@ echo '

'."Processing time: ". sprintf("%.4f", ($end-$start))." seconds".'

'; echo '
'; } +include ("graphs.inc.php"); ?>