--- a/lib/common.inc.php +++ b/lib/common.inc.php @@ -1,24 +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'])); -if ($year != "") $yearQ = "agencyName = '" . $agency . "' AND"; - + $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) { @@ -53,11 +67,10 @@ "http://www.w3.org/TR/html4/strict.dtd"> - Contract Dashboard - <?=$title?> + Contract Dashboard - <?php echo $title; ?> - + - + + + + +
@@ -86,7 +163,7 @@ procurement method contractual confidentiality consultancies - consultancies + amendments postcodes '; } +include ("graphs.inc.php"); ?>