<?php | |
include('./lib/common.inc.php'); | |
include_header("Map"); | |
?> | |
<div class="msg_list"> | |
<p class="msg_head">Header-1 </p> | |
<div class="msg_body"> | |
orem ipsum dolor sit amet, consectetuer adipiscing elit orem ipsum dolor sit amet, consectetuer adipiscing elit | |
</div> | |
<p class="msg_head">Header-2</p> | |
<div class="msg_body"> | |
orem ipsum dolor sit amet, consectetuer adipiscing elit orem ipsum dolor sit amet, consectetuer adipiscing elit | |
</div> | |
<p class="msg_head">Header-3</p> | |
<div class="msg_body"> | |
orem ipsum dolor sit amet, consectetuer adipiscing elit orem ipsum dolor sit amet, consectetuer adipiscing elit | |
</div> | |
</div> | |
sourced from austender | sourced from austender |
Government Agency Information (2009-07-10): National Archives of Australia, http://www.naa.gov.au under Creative Commons - Attribution 2.5 Australia (CC-BY) | Government Agency Information (2009-07-10): National Archives of Australia, http://www.naa.gov.au under Creative Commons - Attribution 2.5 Australia (CC-BY) |
jpgraph for php | jpgraph for php |
ABR | ABR |
Redhat Liberation fonts | Redhat Liberation fonts |
<?php | |
include_once("./lib/common.inc.php"); | |
$query = "SELECT DATE(importDate) as importday, count(*) as count, min(publishDate) as start, max(publishDate) as end | |
FROM `contractnotice` WHERE childCN = 0 AND parentCN = 0 AND DATE(importDate) in (select * from (SELECT DATE(importDate) | |
FROM `contractnotice` ORDER BY `importDate` DESC limit 1) alias)"; | |
$result = mysql_query($query); | |
echo "<div>"; | |
$stats = mysql_fetch_array($result, MYSQL_BOTH); | |
echo $stats["count"] . " new records in period " . $stats["start"] . " to " . $stats["end"] ."<br>"; | |
$query = "SELECT DATE(importDate) as importday, count(*) as count, min(publishDate) as start, max(publishDate) as end | |
FROM `contractnotice` WHERE (childCN != 0 OR parentCN != 0) AND DATE(importDate) in (select * from (SELECT DATE(importDate) | |
FROM `contractnotice` ORDER BY `importDate` DESC limit 1) alias)"; | |
$result = mysql_query($query); | |
echo "<div>"; | |
$stats = mysql_fetch_array($result, MYSQL_BOTH); | |
echo $stats["count"] . " updated records in period " . $stats["start"] . " to " . $stats["end"] ."<br>"; | |
echo "Last updated: ". $stats["importday"]."<br>"; | |
/* Check for null Procurement method and 0 ABN when not ABN exempt */ | |
include_footer(); | |
?> |
<?php | <?php |
error_reporting(E_ALL); | error_reporting(E_ALL); |
$link = mysql_connect('localhost', 'team7', 'wlUsnD2xu9'); | include_once("../lib/common.inc.php"); |
if (!$link) { | |
die('Could not connect: ' . mysql_error()); | |
} | |
@mysql_select_db("team7") or die("Unable to select database"); | |
$unspscresult = mysql_query ("select * from UNSPSCcategories;"); | $unspscresult = mysql_query ("select * from UNSPSCcategories;"); |
while ($row = mysql_fetch_assoc($unspscresult)) { | while ($row = mysql_fetch_assoc($unspscresult)) { |
$unspsc[$row['Title']] = $row['UNSPSC']; | $unspsc[$row['Title']] = $row['UNSPSC']; |
} | } |
$query = "SELECT CNID,category,value | $query = "SELECT CNID,category,value |
FROM `contractnotice` | FROM `contractnotice` |
WHERE `categoryUNSPSC` IS NULL OR `categoryUNSPSC` = 0"; | WHERE `categoryUNSPSC` IS NULL OR `categoryUNSPSC` = 0"; |
$emptycatresult = mysql_query ($query); | $emptycatresult = mysql_query ($query); |
$missing = Array(); | $missing = Array(); |
if ($emptycatresult){ | if ($emptycatresult){ |
while ($record = mysql_fetch_assoc($emptycatresult)) { | while ($record = mysql_fetch_assoc($emptycatresult)) { |
if ($unspsc[$record['category']] == "") { | if ($unspsc[$record['category']] == "") { |
$missing[$record['category']]= $missing[$record['category']]+ $record['value']; | $missing[$record['category']]= $missing[$record['category']]+ $record['value']; |
// echo "<br>\n Category not found for: \n"; | // echo "<br>\n Category not found for: \n"; |
// print_r($record); | // print_r($record); |
} else { | } else { |
$result = mysql_query("UPDATE contractnotice SET categoryUNSPSC = | $result = mysql_query("UPDATE contractnotice SET categoryUNSPSC = |
'".mysql_real_escape_string($unspsc[$record['category']])."' where CNID = | '".mysql_real_escape_string($unspsc[$record['category']])."' where CNID = |
'".mysql_real_escape_string($record['CNID'])."';"); | '".mysql_real_escape_string($record['CNID'])."';"); |
if ($result) echo $record['CNID']. " set to ". ($unspsc[$record['category']]) . " <br>\n"; | if ($result) echo $record['CNID']. " set to ". ($unspsc[$record['category']]) . " <br>\n"; |
else echo "error".mysql_error(); | else echo "error".mysql_error(); |
} | } |
} | } |
} else echo "error".mysql_error(); | } else echo "error".mysql_error(); |
asort($missing); | asort($missing); |
print_r($missing); | print_r($missing); |
?> | ?> |
/* | |
================================================ | |
autosuggest, inquisitor style | |
================================================ | |
*/ | |
body | |
{ | |
position: relative; | |
} | |
div.autosuggest | |
{ | |
position: absolute; | |
background-image: url(images/img_inquisitor/as_pointer.gif); | |
background-position: top; | |
background-repeat: no-repeat; | |
padding: 10px 0 0 0; | |
} | |
div.autosuggest div.as_header, | |
div.autosuggest div.as_footer | |
{ | |
position: relative; | |
height: 6px; | |
padding: 0 6px; | |
background-image: url(images/img_inquisitor/ul_corner_tr.gif); | |
background-position: top right; | |
background-repeat: no-repeat; | |
overflow: hidden; | |
} | |
div.autosuggest div.as_footer | |
{ | |
background-image: url(images/img_inquisitor/ul_corner_br.gif); | |
} | |
div.autosuggest div.as_header div.as_corner, | |
div.autosuggest div.as_footer div.as_corner | |
{ | |
position: absolute; | |
top: 0; | |
left: 0; | |
height: 6px; | |
width: 6px; | |
background-image: url(images/img_inquisitor/ul_corner_tl.gif); | |
background-position: top left; | |
background-repeat: no-repeat; | |
} | |
div.autosuggest div.as_footer div.as_corner | |
{ | |
background-image: url(images/img_inquisitor/ul_corner_bl.gif); | |
} | |
div.autosuggest div.as_header div.as_bar, | |
div.autosuggest div.as_footer div.as_bar | |
{ | |
height: 6px; | |
overflow: hidden; | |
background-color: #333; | |
} | |
div.autosuggest ul | |
{ | |
list-style: none; | |
margin: 0 0 -4px 0; | |
padding: 0; | |
overflow: hidden; | |
background-color: #333; | |
} | |
div.autosuggest ul li | |
{ | |
color: #ccc; | |
padding: 0; | |
margin: 0 4px 4px; | |
text-align: left; | |
} | |
div.autosuggest ul li a | |
{ | |
color: #ccc; | |
display: block; | |
text-decoration: none; | |
background-color: transparent; | |
text-shadow: #000 0px 0px 5px; | |
position: relative; | |
padding: 0; | |
width: 100%; | |
} | |
div.autosuggest ul li a:hover | |
{ | |
background-color: #444; | |
} | |
div.autosuggest ul li.as_highlight a:hover | |
{ | |
background-color: #1B5CCD; | |
} | |
div.autosuggest ul li a span | |
{ | |
display: block; | |
padding: 3px 6px; | |
font-weight: bold; | |
} | |
div.autosuggest ul li a span small | |
{ | |
font-weight: normal; | |
color: #999; | |
} | |
div.autosuggest ul li.as_highlight a span small | |
{ | |
color: #ccc; | |
} | |
div.autosuggest ul li.as_highlight a | |
{ | |
color: #fff; | |
background-color: #1B5CCD; | |
background-image: url(images/img_inquisitor/hl_corner_br.gif); | |
background-position: bottom right; | |
background-repeat: no-repeat; | |
} | |
div.autosuggest ul li.as_highlight a span | |
{ | |
background-image: url(images/img_inquisitor/hl_corner_bl.gif); | |
background-position: bottom left; | |
background-repeat: no-repeat; | |
} | |
div.autosuggest ul li a .tl, | |
div.autosuggest ul li a .tr | |
{ | |
background-image: transparent; | |
background-repeat: no-repeat; | |
width: 6px; | |
height: 6px; | |
position: absolute; | |
top: 0; | |
padding: 0; | |
margin: 0; | |
} | |
div.autosuggest ul li a .tr | |
{ | |
right: 0; | |
} | |
div.autosuggest ul li.as_highlight a .tl | |
{ | |
left: 0; | |
background-image: url(images/img_inquisitor/hl_corner_tl.gif); | |
background-position: bottom left; | |
} | |
div.autosuggest ul li.as_highlight a .tr | |
{ | |
right: 0; | |
background-image: url(images/img_inquisitor/hl_corner_tr.gif); | |
background-position: bottom right; | |
} | |
div.autosuggest ul li.as_warning | |
{ | |
font-weight: bold; | |
text-align: center; | |
} | |
div.autosuggest ul em | |
{ | |
font-style: normal; | |
color: #6EADE7; | |
} |
<?php | <?php |
include_once ("./lib/common.inc.php"); | include_once ("./lib/common.inc.php"); |
if ($_REQUEST['agency']) { | if ($_REQUEST['agency']) { |
include_header("Agency"); | include_header("Agency"); |
$agency = htmlentities(strip_tags($_REQUEST['agency'])); | $agency = htmlentities(strip_tags($_REQUEST['agency'])); |
echo '<img src="graphs/displayMethodCountGraph.php?agency=' . stripslashes($agency) . '">'; | echo '<img src="graphs/displayMethodCountGraph.php?agency=' . stripslashes($agency) . '">'; |
echo '<img src="graphs/displayCnCGraph.php?agency=' . stripslashes($agency) . '">'; | echo '<img src="graphs/displayCnCGraph.php?agency=' . stripslashes($agency) . '">'; |
echo '<img src="graphs/displayMethodValueGraph.php?agency=' . stripslashes($agency) . '">'; | echo '<img src="graphs/displayMethodValueGraph.php?agency=' . stripslashes($agency) . '">'; |
/*biggest contracts | /*biggest contracts |
spending by year | spending by year |
spending by industry/category | spending by industry/category |
spending by supplier | spending by supplier |
spread procurement methods (stacked bar graph) | spread procurement methods (stacked bar graph) |
+ percent consultancies + percent confidential (bar graph) | + percent consultancies + percent confidential (bar graph) |
Average value by procurement type | Average value by procurement type |
--- info | --- info |
website, procurement plan, annual reports | website, procurement plan, annual reports |
Breakdown percentage,number,value by procurement type | Breakdown percentage,number,value by procurement type |
Histograph, overlaying number value reported per week over X years | Histograph, overlaying number value reported per week over X years |
Compliance statistics: amendments, delay in reporting average and number completely late*/ | Compliance statistics: amendments, delay in reporting average and number completely late*/ |
} else { | } else { |
/* | |
split by portfolio | |
*/ | |
include_header("Agencies"); | include_header("Agencies"); |
$query = "SELECT SUM(value), agencyName | $query = "SELECT SUM(value), agencyName |
FROM `contractnotice` | FROM `contractnotice` |
WHERE childCN = 0 | WHERE childCN = 0 |
GROUP BY agencyName "; | GROUP BY agencyName "; |
$result = mysql_query($query); | $result = mysql_query($query); |
echo "<table>"; | echo "<table>"; |
while ($row = mysql_fetch_array($result, MYSQL_BOTH)) { | while ($row = mysql_fetch_array($result, MYSQL_BOTH)) { |
setlocale(LC_MONETARY, 'en_US'); | setlocale(LC_MONETARY, 'en_US'); |
$value = number_format(doubleval($row[0]) , 2); | $value = number_format(doubleval($row[0]) , 2); |
$agency = stripslashes($row[1]); | $agency = stripslashes($row[1]); |
echo ("<tr><td><b><a href=\"displayAgency.php?agency={$agency}\">{$agency}</a></b></td><td>\$$value</td></tr>\n"); | echo ("<tr><td><b><a href=\"displayAgency.php?agency={$agency}\">{$agency}</a></b></td><td>\$$value</td></tr>\n"); |
} | } |
echo "</table>"; | echo "</table>"; |
mysql_free_result($result); | mysql_free_result($result); |
} | } |
include_footer(); | include_footer(); |
?> | ?> |
<?php | <?php |
include_once("./lib/common.inc.php"); | include_once("./lib/common.inc.php"); |
/* | |
split by year | |
*/ | |
/* | /* |
todo: | todo: |
Year/Month drilldown - largest contracts, agencies, suppliers*/ | Year/Month drilldown - largest contracts, agencies, suppliers |
big picture graphs?*/ | |
include_header("Months and Years"); | include_header("Months and Years"); |
$query = "SELECT YEAR(contractStart), MONTH(contractStart), | $query = "SELECT YEAR(contractStart), MONTH(contractStart), |
value FROM `contractnotice` WHERE childCN = 0 GROUP BY MONTH(contractStart), YEAR(contractStart) ORDER BY YEAR(contractStart), MONTH(contractStart) "; | value FROM `contractnotice` WHERE childCN = 0 GROUP BY MONTH(contractStart), YEAR(contractStart) ORDER BY YEAR(contractStart), MONTH(contractStart) "; |
$result = mysql_query($query); | $result = mysql_query($query); |
echo "<table>"; | echo "<table>"; |
while |