1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | <?php include_once("./lib/common.inc.php"); $query = 'SELECT * FROM contractnotice WHERE "CNID" = :CNID LIMIT 1'; $query = $conn->prepare($query); $query->bindParam(":CNID", $_REQUEST['CNID']); $query->execute(); $contractResult = $query->fetch(PDO::FETCH_ASSOC); if (!$contractResult) { header("Status: 404 Not Found"); header("HTTP/1.0 404 Not Found"); include_header("Contract Not Found"); echo "<center><h1>No Contract Notice with that ID found</h1></center>"; databaseError($conn->errorInfo()); } else { $description = ucsmart($contractResult["description"]); include_header($description); echo '<center><h1>'.$description.'</h1></center>'; databaseError($conn->errorInfo()); setlocale(LC_MONETARY, 'en_US'); foreach (array_filter($contractResult) as $key => $value) { echo "<b>$key</b> "; switch ($key) { case "supplierName": case "supplierABN": echo '<a href="displaySupplier.php?supplier=' . $contractResult['supplierABN'] . '-' . urlencode($contractResult['supplierName']) . '">' . $value . "</a>"; break; case "agencyName": echo '<a href="displayAgency.php?agency=' . urlencode($value) . '">' . $value . "</a>"; break; case "value": echo "$" . number_format(doubleval($value), 2); break; default: echo str_replace(" ", "<br>", ucsmart($value)); } echo "<br>"; } echo '<br><a href="https://www.tenders.gov.au/?event=public.advancedsearch.keyword&keyword=CN' . $_REQUEST['CNID'] . '"> View original record @ tenders.gov.au</a><br>'; $query = 'SELECT * FROM heuristic_results where "CNID" = :CNID'; $query = $conn->prepare($query); $agencyName = $input . '%'; $query->bindParam(":CNID", $_REQUEST['CNID']); $query->execute(); databaseError($conn->errorInfo()); foreach ($query->fetchAll() as $r) { echo "<b>{$r['heuristic_name']}</b>: {$r['heuristic_value']} (raw value: {$r['raw_value']}, mean: {$r['mean']}, stddev: {$r['stddev']})<br>"; } } include_footer(); ?> |