more postgres migration
--- a/displayAgency.php
+++ b/displayAgency.php
@@ -29,7 +29,7 @@
$query = 'SELECT "CNID", "description", "value", "agencyName", "category",
"contractStart", "supplierName"
FROM contractnotice
- WHERE "agencyName" = :agency
+ WHERE "agencyName" like :agency
ORDER BY "value" DESC limit 100';
$query = $conn->prepare($query);
$query->bindParam(":agency", $agency);
--- a/displayConfidentialities.php
+++ b/displayConfidentialities.php
@@ -10,9 +10,9 @@
*/
include_header("Confidentialities");
-$query = "SELECT value, procurementMethod
-FROM `contractnotice`
-GROUP BY procurementMethod ";
+$query = 'SELECT SUM(value) as value, "procurementMethod"
+FROM contractnotice
+GROUP BY "procurementMethod" ';
$query = $conn->prepare($query);
$query->execute();
--- a/displayConsultancies.php
+++ b/displayConsultancies.php
@@ -10,9 +10,9 @@
*/
include_header("Consultancies");
-$query = "SELECT value, procurementMethod
-FROM `contractnotice`
-GROUP BY procurementMethod ";
+$query = 'SELECT SUM(value) as value, "procurementMethod"
+FROM contractnotice
+GROUP BY "procurementMethod" ';
$query = $conn->prepare($query);
--- a/displayProcurementMethod.php
+++ b/displayProcurementMethod.php
@@ -10,10 +10,10 @@
*/
include_header("Procurement Methods");
-$query = "SELECT SUM(value) as value, procurementMethod
-FROM `contractnotice`
-WHERE childCN is null
-GROUP BY procurementMethod ";
+$query = 'SELECT SUM(value) as value, "procurementMethod"
+FROM contractnotice
+WHERE "childCN" is null
+GROUP BY "procurementMethod"';
$query = $conn->prepare($query);
$query->execute();
--- a/lib/common.inc.php
+++ b/lib/common.inc.php
@@ -100,9 +100,9 @@
$startYear = 2007;
$year = filter_var($_REQUEST['year'], FILTER_SANITIZE_NUMBER_INT);
-if ($year != "")
+if ($year != "") {
$yearQ = "YEAR(publishDate) = " . $year . " AND ";
-
+}
$standardQ = ' "childCN" is null '; // AND YEAR(contractStart) >= 2007 AND YEAR(contractStart) <= 2010';
$start = 0.0;
@@ -117,8 +117,9 @@
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
- <title>Contract Dashboard - <?php echo $title; ?></title>
+ <title><?php echo $title; ?> - Contract Dashboard</title>
<link rel="stylesheet" type="text/css" href="bootstrap.min.css">
+ <link rel="stylesheet" type="text/css" href="bootstrap-responsive.css">
<!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
@@ -205,8 +206,8 @@
<link type="text/css" rel="stylesheet" href="style.css">
</head>
<body>
- <div class="topbar">
- <div class="topbar-inner">
+ <div class="navbar">
+ <div class="navbar-inner">
<div class="container-fluid">
<a class="brand" href="#">contract dashboard</a>
<ul class="nav">
@@ -222,8 +223,6 @@
<li><a href="displayConsultancies.php">consultancies</a></li>
<li><a href="displayAmendments.php">amendments</a></li>
<li><a href="displayMap.php">geo</a></li>
- <!-- </ul>
- </li>-->
</ul>
@@ -246,16 +245,14 @@
var as_xml = new bsn.AutoSuggest('searchKeyword', options_xml);
</script>
<div class="container-fluid">
- <div class="sidebar">
- <div class="well">
- Filter by:<li>
- <li>year
- <li><li>2008</li>
- </li>
- </li>
- </li> <br>
- </div> </div>
- <div class="content">
+ <div class="row-fluid">
+ <div class="span3">
+ <div class="well sidebar-nav">
+ <li class="nav-header">Filter by:</li>
+ <li>2008</li>
+ </div>
+ </div>
+ <div class="span9">
<?php
$start = (float) array_sum(explode(' ', microtime()));
}
@@ -264,7 +261,7 @@
global $start;
$end = (float) array_sum(explode(' ', microtime()));
- echo ' <footer>' . "Processing time: " . sprintf("%.4f", ($end - $start)) . " seconds" . ' <footer>';
+ echo '</div> <footer>' . "Processing time: " . sprintf("%.4f", ($end - $start)) . " seconds" . ' <footer>';
if (strpos($_SERVER['SERVER_NAME'], ".gs")) {
?>
@@ -290,4 +287,5 @@
-
+
+
--- a/lib/graphs.inc.php
+++ b/lib/graphs.inc.php
@@ -220,7 +220,7 @@
global $conn;
$agency = "AusAid";
$topX = 15;
- $query = 'SELECT SUM(value) as val, "supplierName" FROM contractnotice WHERE (extract ("YEAR" from "contractStart") >= :startYear) AND "childCN" is null AND "agencyName" = :agency
+ $query = 'SELECT SUM(value) as val, "supplierName" FROM contractnotice WHERE extract ("YEAR" from "contractStart") >= :startYear AND "childCN" is null AND "agencyName" like :agency
GROUP BY lower(supplierName) ORDER BY val DESC limit $topX';
$query = $conn->prepare($query);
$query->bindParam(":startYear", $startYear);
@@ -235,7 +235,7 @@
}
- $query = 'SELECT sum(a.val) as value, count(1) as count from (SELECT SUM(value) as val, "supplierName" FROM contractnotice WHERE (extract ("YEAR" from "contractStart") >= :startYear) AND "childCN" is null and "agencyName" = :agency
+ $query = 'SELECT sum(a.val) as value, count(1) as count from (SELECT SUM(value) as val, "supplierName" FROM contractnotice WHERE (extract ("YEAR" from "contractStart") >= :startYear) AND "childCN" is null and "agencyName" like :agency
GROUP BY lower("supplierName") ORDER BY val DESC LIMIT 18446744073709551610 OFFSET $topX) as a';
$query = $conn->prepare($query);
$query->bindParam(":startYear", $startYear);
--- a/style.css
+++ b/style.css
@@ -1,6 +1,3 @@
-body {
- padding-top:60px;
-}
/* div collapse from http://roshanbh.com.np/2008/03/expandable-collapsible-toggle-pane-jquery.html */
p {
padding: 0 0 1em;