postgres migration
postgres migration

<?php <?php
   
include_once("./lib/common.inc.php"); include_once("./lib/common.inc.php");
/* /*
   
   
agencies that use alot of Confidentialities agencies that use alot of Confidentialities
suppliers that provide alot suppliers that provide alot
how much is spent overall per year how much is spent overall per year
*/ */
   
include_header("Confidentialities"); include_header("Confidentialities");
$query = "SELECT value, procurementMethod $query = 'SELECT SUM(value) as value, "procurementMethod"
FROM `contractnotice` FROM contractnotice
GROUP BY procurementMethod "; GROUP BY "procurementMethod" ';
   
$query = $conn->prepare($query); $query = $conn->prepare($query);
$query->execute(); $query->execute();
databaseError($conn->errorInfo()); databaseError($conn->errorInfo());
   
echo "<table>"; echo "<table>";
foreach ($query->fetchAll() as $row) { foreach ($query->fetchAll() as $row) {
setlocale(LC_MONETARY, 'en_US'); setlocale(LC_MONETARY, 'en_US');
$value = number_format(doubleval($row[0]),2); $value = number_format(doubleval($row[0]),2);
echo ("<tr><td><b>{$row[1]}</b></td><td>\$$value</td></tr>"); echo ("<tr><td><b>{$row[1]}</b></td><td>\$$value</td></tr>");
} }
echo "</table>"; echo "</table>";
include_footer(); include_footer();
?> ?>
   
   
   
<?php <?php
   
include_once("./lib/common.inc.php"); include_once("./lib/common.inc.php");
/* /*
   
   
agencies that use alot of consultacies agencies that use alot of consultacies
suppliers that provide alot suppliers that provide alot
how much is spent overall per year how much is spent overall per year
*/ */
   
include_header("Consultancies"); include_header("Consultancies");
$query = "SELECT value, procurementMethod $query = 'SELECT SUM(value) as value, "procurementMethod"
FROM `contractnotice` FROM contractnotice
GROUP BY procurementMethod "; GROUP BY "procurementMethod" ';
   
   
$query = $conn->prepare($query); $query = $conn->prepare($query);
$query->execute(); $query->execute();
databaseError($conn->errorInfo()); databaseError($conn->errorInfo());
   
echo "<table>"; echo "<table>";
foreach ($query->fetchAll() as $row) { foreach ($query->fetchAll() as $row) {
setlocale(LC_MONETARY, 'en_US'); setlocale(LC_MONETARY, 'en_US');
$value = number_format(doubleval($row[0]),2); $value = number_format(doubleval($row[0]),2);
echo ("<tr><td><b>{$row[1]}</b></td><td>\$$value</td></tr>"); echo ("<tr><td><b>{$row[1]}</b></td><td>\$$value</td></tr>");
} }
echo "</table>"; echo "</table>";
include_footer(); include_footer();
?> ?>
   
   
   
<?php <?php
include_once("./lib/common.inc.php"); include_once("./lib/common.inc.php");
/* /*
biggest suppliers in each method biggest suppliers in each method
biggest agencies in each method (weighted for size? percentage of total expenditure) biggest agencies in each method (weighted for size? percentage of total expenditure)
largest Average value by procurement type? largest Average value by procurement type?
*/ */
include_header("Procurement Methods"); include_header("Procurement Methods");
$query = "SELECT SUM(value) as value, procurementMethod $query = 'SELECT SUM(value) as value, "procurementMethod"
FROM `contractnotice` FROM contractnotice
WHERE childCN is null WHERE "childCN" is null
GROUP BY procurementMethod "; GROUP BY "procurementMethod"';
$query = $conn->prepare($query); $query = $conn->prepare($query);
$query->execute(); $query->execute();
databaseError($conn->errorInfo()); databaseError($conn->errorInfo());
echo "<table>"; echo "<table>";
foreach ($query->fetchAll() as $row) { foreach ($query->fetchAll() as $row) {
setlocale(LC_MONETARY, 'en_US'); setlocale(LC_MONETARY, 'en_US');
$value = number_format(doubleval($row[0]),2); $value = number_format(doubleval($row[0]),2);
echo ("<tr><td><b>{$row[1]}</b></td><td>\$$value</td></tr>"); echo ("<tr><td><b>{$row[1]}</b></td><td>\$$value</td></tr>");
} }
echo "</table>"; echo "</table>";
include_footer(); include_footer();
?> ?>