--- a/index.php +++ b/index.php @@ -4,11 +4,33 @@ ?>

Contract Dashboard

- -
-Explore further on OpenSpending.org!
+prepare($query); +$query->execute(); +databaseError($conn->errorInfo()); +$date = $query->fetch(); +$query = 'SELECT * FROM contractnotice where DATE("importDate") = ? +OFFSET random()*(select count(*) from contractnotice where DATE("importDate") = ?) LIMIT 10'; +$query = $conn->prepare($query); +$query->execute(Array($date[0],$date[0])); +databaseError($conn->errorInfo()); +$res = $query->fetchAll(PDO::FETCH_ASSOC); + +foreach ($res as $row) { +setlocale(LC_MONETARY, 'en_US'); + $value = number_format(doubleval($row['value']), 2); + echo (" + + + + + + "); +} +echo "
{$row['CNID']}{$row['description']}\$$value{$row['agencyName']}{$row['contractStart']}{$row['supplierName']}
"; include_footer(); ?>