<?php | <?php |
include_once('include/common.inc.php'); | include_once('include/common.inc.php'); |
include_header('About'); | include_header('About'); |
?> | ?> |
<div class="foundation-header"> | <div class="foundation-header"> |
<h1><a href="about.php">About/FAQ</a></h1> | <h1><a href="about.php">About/FAQ</a></h1> |
</div> | </div> |
<a href="http://thenounproject.com/noun/document-dump/">Document Dump icon designed by Iconathon, 2013</a> | |
Contact us: maxious@lambdacomplex.org | |
Exports: <a href="admin/exportAll.csv.php">All Agencies</a> <a href="admin/exportEmployees.csv.php">Agency Employee Headcounts</a> | |
<h2> Attributions </h2> | <h2> Attributions </h2> |
National Archives of Australia, Australian Governments’ Interactive Functions Thesaurus, 2nd edition, September 2005, published at http://www.naa.gov.au/recordkeeping/thesaurus/index.htm <br/> | National Archives of Australia, Australian Governments’ Interactive Functions Thesaurus, 2nd edition, September 2005, published at http://www.naa.gov.au/recordkeeping/thesaurus/index.htm <br/> |
data.gov.au http://data.gov.au/dataset/directory-gov-au-full-data-export/ <br/> | data.gov.au http://data.gov.au/dataset/directory-gov-au-full-data-export/ <br/> |
directory.gov.au <br/> | directory.gov.au <br/> |
australia.gov.au http://australia.gov.au/about/copyright <br/> | australia.gov.au http://australia.gov.au/about/copyright <br/> |
<h2>Organisational Data Sources</h2> | <h2>Organisational Data Sources</h2> |
http://www.comlaw.gov.au/Browse/Results/ByTitle/AdministrativeArrangementsOrders/Current/Ad/0 defines departments | http://www.comlaw.gov.au/Browse/Results/ByTitle/AdministrativeArrangementsOrders/Current/Ad/0 defines departments |
Agencies can be found in the Schedule to an Appropriation Bill (budget), Schedule to FMA Regulations and/or Public Service Act.<br> | Agencies can be found in the Schedule to an Appropriation Bill (budget), Schedule to FMA Regulations and/or Public Service Act.<br> |
http://www.finance.gov.au/publications/flipchart/docs/FMACACFlipchart.pdf summarises these. view-source:https://www.tenders.gov.au/?event=public.advancedsearch.home is great for the suspended/active status<br> | http://www.finance.gov.au/publications/flipchart/docs/FMACACFlipchart.pdf summarises these. view-source:https://www.tenders.gov.au/?event=public.advancedsearch.home is great for the suspended/active status<br> |
Fraud in gov depts by Fairfax Media http://www.smh.com.au/national/public-service-keeps-fraud-cases-private-20110923-1kpdr.html <br> | Fraud in gov depts by Fairfax Media http://www.smh.com.au/national/public-service-keeps-fraud-cases-private-20110923-1kpdr.html <br> |
When defining the hierachy, this system is designed towards monitoring accountablity. Thus large agencies that have registered their own ABN | When defining the hierachy, this system is designed towards monitoring accountablity. Thus large agencies that have registered their own ABN |
and have their own accountablity mechanisms/website receive a seperate record as a child of their department.<br> | and have their own accountablity mechanisms/website receive a seperate record as a child of their department.<br> |
Some small agencies will choose to simply rely on their parent department's accountablity measures.<br> | Some small agencies will choose to simply rely on their parent department's accountablity measures.<br> |
This flows through to organisation name and other/past names. A department that completely accounts for an agency will list that agency as an other child name.<br> | This flows through to organisation name and other/past names. A department that completely accounts for an agency will list that agency as an other child name.<br> |
As agencies themselves shift between departments, there may be scope for providing time ranges but typically the newest hierarchy will be the one recorded.<br> | As agencies themselves shift between departments, there may be scope for providing time ranges but typically the newest hierarchy will be the one recorded.<br> |
A department/agency name will be the newest active name assigned to that ABN.<br> | A department/agency name will be the newest active name assigned to that ABN.<br> |
ABN information is derived from the ABR. This is the definitive umpire about which former name should be linked to which current name. <br> | ABN information is derived from the ABR. This is the definitive umpire about which former name should be linked to which current name. <br> |
For example "Department of Transport and Regional Services" became "Department of Infrastructure, Transport, Regional Development and Local Government" (same ABN) | For example "Department of Transport and Regional Services" became "Department of Infrastructure, Transport, Regional Development and Local Government" (same ABN) |
however it later split into "Department of Infrastructure and Transport" (same ABN) | however it later split into "Department of Infrastructure and Transport" (same ABN) |
and "Department of Regional Australia, Regional Development and Local Government" (new ABN).<br> | and "Department of Regional Australia, Regional Development and Local Government" (new ABN).<br> |
Statistical information from http://www.apsc.gov.au/stateoftheservice/1011/statsbulletin/section1.html#t2total https://www.apsedii.gov.au/apsedii/CustomQueryx33.shtml | Statistical information from http://www.apsc.gov.au/stateoftheservice/1011/statsbulletin/section1.html#t2total https://www.apsedii.gov.au/apsedii/CustomQueryx33.shtml |
and individual annual reports.<br> | and individual annual reports.<br> |
<?php | <?php |
include_footer(); | include_footer(); |
?> | ?> |
<?php | |
include_once('include/common.inc.php'); | |
include_header('Charts'); | |
$db = $server->get_db('disclosr-agencies'); | |
?> | |
<div class="foundation-header"> | |
<h1><a href="about.php">Charts</a></h1> | |
<h4 class="subheader">Lorem ipsum.</h4> | |
</div> | |
<div id="scores" style="width:900px;height:500px;"></div> | |
<div id="employees" style="width:1000px;height:900px;"></div> | |
<script id="source"> | |
window.onload = function() { | |
$(document).ready(function() { | |
var d1 = []; | |
var scorelabels = []; | |
<?php | |
try { | |
$rows = $db->get_view("app", "scoreHas?group=true", null, true)->rows; | |
$dataValues = Array(); | |
foreach ($rows as $row) { | |
$dataValues[$row->value] = $row->key; | |
} | |
$i = 0; | |
ksort($dataValues); | |
foreach ($dataValues as $value => $key) { | |
echo " d1.push([$i, $value]);" . PHP_EOL; | |
echo " scorelabels.push('$key');" . PHP_EOL; | |
$i++; | |
} | |
} catch (SetteeRestClientException $e) { | |
setteErrorHandler($e); | |
} | |
?> | |
function scoretrackformatter(obj) { | |
if (scorelabels[Math.floor(obj.x)]) { | |
return (scorelabels[Math.floor(obj.x)])+"="+obj.y; | |
} else { | |
return ""; | |
} | |
} | |
function scoretickformatter(val, axis) { | |
if (scorelabels[Math.floor(val)]) { | |
return '<p style="margin-top:8em;-webkit-transform:rotate(-90deg);">'+(scorelabels[Math.floor(val)])+"</b>"; | |
} else { | |
return ""; | |
} | |
} | |
Flotr.draw(document.getElementById("scores"), [ {data: d1}], { | |
HtmlText: true, | |
bars : { | |
show : true | |
}, | |
mouse : { | |
track : true, | |
relative : true, | |
trackFormatter: scoretrackformatter | |
},yaxis: { | |
autoscaling: true | |
}, | |
xaxis: { | |
autoscaling: true, | |
minorTickFreq: 0.6, | |
noTicks : scorelabels.length, | |
tickFormatter: scoretickformatter | |
} | |
}); | |
var emplabels = []; | |
function emptrackformatter(obj) { | |
return (obj.series.label)+" = "+obj.y+" in "+emplabels[Math.floor(obj.x)]; | |
} | |
function emptickformatter(val, axis) { | |
if (emplabels[Math.floor(val)]) { | |
return '<p style="margin-top:8em;-webkit-transform:rotate(-90deg);">'+(emplabels[Math.floor(val)])+"</b>"; | |
} else { | |
return ""; | |
} | |
} | |
function onDataReceived(series) { | |
emplabels = series.labels; | |
Flotr.draw(document.getElementById("employees"), series.data, { | |
mouse : { | |
track : true, | |
relative : true, | |
trackFormatter: emptrackformatter | |
},yaxis: { | |
max: 10000, | |
scaling: 'logarithmic' | |
}, | |
xaxis: { | |
minorTickFreq: 1, | |
noTicks: emplabels.length, | |
showMinorLabels: true, | |
tickFormatter: emptickformatter | |
}, | |
legend: { | |
show: false | |
} | |
}); | |
} | |
$.ajax({ | |
url: "admin/exportEmployees.csv.php?format=json", | |
method: 'GET', | |
dataType: 'json', | |
success: onDataReceived | |
}); | |
}); | |
}; | |
</script> | |
<?php | |
include_footer(); | |
?> |
<?php | <?php |
include('template.inc.php'); | include('template.inc.php'); |
include_header_documents("Charts"); | include_header_documents("Charts"); |
include_once('../include/common.inc.php'); | include_once('../include/common.inc.php'); |
$agenciesdb = $server->get_db('disclosr-agencies'); | $agenciesdb = $server->get_db('disclosr-agencies'); |
$idtoname = Array(); | $idtoname = Array(); |
foreach ($agenciesdb->get_view("app", "byCanonicalName")->rows as $row) { | foreach ($agenciesdb->get_view("app", "byCanonicalName")->rows as $row) { |
$idtoname[$row->id] = trim($row->value->name); | $idtoname[$row->id] = trim($row->value->name); |
} | } |
$foidocsdb = $server->get_db('disclosr-foidocuments'); | $foidocsdb = $server->get_db('disclosr-foidocuments'); |
?> | ?> |
<div class="foundation-header"> | <div class="foundation-header"> |
<h1><a href="about.php">Charts</a></h1> | <h1><a href="about.php">Charts</a></h1> |
<h4 class="subheader">Lorem ipsum.</h4> | <h4 class="subheader"></h4> |
</div> | </div> |
<div id="bydate" style="width:1000px;height:300px;"></div> | <div id="bydate" style="width:1000px;height:300px;"></div> |
<div id="byagency" style="width:1200px;height:300px;"></div> | <div id="byagency" style="width:1200px;height:800px;"></div> |
<script id="source"> | <script id="source"> |
window.onload = function () { | window.onload = function () { |
$(document).ready(function () { | $(document).ready(function () { |
var | var |
d1 = [], | d1 = [], |
options1, | options1, |
o1; | o1; |
<?php | <?php |
try { | try { |
$rows = $foidocsdb->get_view("app", "byDateMonthYear?group=true",null, false,false,true)->rows; | $rows = $foidocsdb->get_view("app", "byDateMonthYear?group=true",null, false,false,true)->rows; |
$dataValues = Array(); | $dataValues = Array(); |
foreach ($rows as $row) { | foreach ($rows as $row) { |
$dataValues[$row->key] = $row->value; | $dataValues[$row->key] = $row->value; |
} | } |
$i = 0; | $i = 0; |
ksort($dataValues); | ksort($dataValues); |
foreach ($dataValues as $key => $value) { | foreach ($dataValues as $key => $value) { |
$date = date_create_from_format('Y-m-d', $key); | $date = date_create_from_format('Y-m-d', $key); |
if (date_format($date, 'U') != "") { | if (date_format($date, 'U') != "") { |
echo " d1.push([".date_format($date, 'U')."000, $value]);" . PHP_EOL; | echo " d1.push([".date_format($date, 'U')."000, $value]);" . PHP_EOL; |
// echo " emplabels.push('$key');" . PHP_EOL; | // echo " emplabels.push('$key');" . PHP_EOL; |
$i++; | $i++; |
} | } |
} | } |
} catch (SetteeRestClientException $e) { | } catch (SetteeRestClientException $e) { |
setteErrorHandler($e); | setteErrorHandler($e); |
} | } |
?> | ?> |
options1 = { | options1 = { |
xaxis: { | xaxis: { |
mode: 'time', | mode: 'time', |
labelsAngle: 45 | labelsAngle: 45 |
}, | }, |
selection: { | selection: { |
mode: 'x' | mode: 'x' |
}, | }, |
HtmlText: false, | HtmlText: false, |
title: 'Time' | title: 'Disclosure Log entries added by Date' |
}; | }; |
// Draw graph with default options, overwriting with passed options | // Draw graph with default options, overwriting with passed options |
function drawGraph(opts) { | function drawGraph(opts) { |
// Clone the options, so the 'options' variable always keeps intact. | // Clone the options, so the 'options' variable always keeps intact. |
o1 = Flotr._.extend(Flotr._.clone(options1), opts || {}); | o1 = Flotr._.extend(Flotr._.clone(options1), opts || {}); |
// Return a new graph. | // Return a new graph. |
return Flotr.draw( | return Flotr.draw( |
document.getElementById("bydate"), | document.getElementById("bydate"), |
[ d1 ], | [ d1 ], |
o1 | o1 |
); | ); |
} | } |
graph = drawGraph(); | graph = drawGraph(); |
Flotr.EventAdapter.observe(document.getElementById("bydate"), 'flotr:select', function (area) { | Flotr.EventAdapter.observe(document.getElementById("bydate"), 'flotr:select', function (area) { |
// Draw selected area | // Draw selected area |
graph = drawGraph({ | graph = drawGraph({ |
xaxis: { min: area.x1, max: area.x2, mode: 'time', labelsAngle: 45 }, | xaxis: { min: area.x1, max: area.x2, mode: 'time', labelsAngle: 45 }, |
yaxis: { min: area.y1, max: area.y2 } | yaxis: { min: area.y1, max: area.y2 } |
}); | }); |
}); | }); |
// When graph is clicked, draw the graph with default area. | // When graph is clicked, draw the graph with default area. |
Flotr.EventAdapter.observe(document.getElementById("bydate"), 'flotr:click', function () { | Flotr.EventAdapter.observe(document.getElementById("bydate"), 'flotr:click', function () { |
graph = drawGraph(); | graph = drawGraph(); |
}); | }); |
}); | }); |
}; | }; |
var d2 = []; | var d2 = []; |
var agencylabels = []; | var agencylabels = []; |
function agencytrackformatter(obj) { | function agencytrackformatter(obj) { |
return agencylabels[Math.floor(obj.x)] + " = " + obj.y; | return agencylabels[Math.floor(obj.y)] + " = " + obj.x; |
} | } |
function agencytickformatter(val, axis) { | function agencytickformatter(val, axis) { |
if (agencylabels[Math.floor(val)]) { | if (agencylabels[Math.floor(val)]) { |
return '<p style="margin-top:8em;-webkit-transform:rotate(-90deg);">' + (agencylabels[Math.floor(val)]) + "</b>"; | return (agencylabels[Math.floor(val)]) ; |
} else { | } else { |
return ""; | return ""; |
} | } |
} | } |
<?php | <?php |
try { | try { |
$rows = $foidocsdb->get_view("app", "byAgencyID?group=true",null, false,false,true)->rows; | $rows = $foidocsdb->get_view("app", "byAgencyID?group=true",null, false,false,true)->rows; |
$dataValues = Array(); | $dataValues = Array(); |
$i = 0; | $i = 0; |
foreach ($rows as $row) { | foreach ($rows as $row) { |
echo " d2.push([".$i.", $row->value]);" . PHP_EOL; | echo " d2.push([ $row->value,$i]);" . PHP_EOL; |
echo " agencylabels.push(['".str_replace("'","",$idtoname[$row->key])."']);" . PHP_EOL; | echo " agencylabels.push(['".str_replace("'","",$idtoname[$row->key])."']);" . PHP_EOL; |
$i++; | $i++; |
} | } |
} catch (SetteeRestClientException $e) { | } catch (SetteeRestClientException $e) { |
setteErrorHandler($e); | setteErrorHandler($e); |
} | } |
?> | ?> |
// Draw the graph | // Draw the graph |
Flotr.draw( | Flotr.draw( |
document.getElementById("byagency"), | document.getElementById("byagency"), |
[d2], | [d2], |
{ | { |
title: "Disclosure Log entries by Agency", | |
bars: { | bars: { |
show: true, | show: true, |
horizontal: false, | horizontal: true, |
shadowSize: 0, | shadowSize: 0, |
barWidth: 0.5 | barWidth: 0.5 |
}, | }, |
mouse: { | mouse: { |
track: true, | track: true, |
relative: true, | relative: true, |
trackFormatter: agencytrackformatter | trackFormatter: agencytrackformatter |
}, | }, |
yaxis: { | yaxis: { |
min: 0, | |
autoscaleMargin: 1 | |
}, | |
xaxis: { | |
minorTickFreq: 1, | minorTickFreq: 1, |
noTicks: agencylabels.length, | noTicks: agencylabels.length, |
showMinorLabels: true, | showMinorLabels: true, |
tickFormatter: agencytickformatter | tickFormatter: agencytickformatter |
}, | |
xaxis: { | |
min: 0, | |
autoscaleMargin: 1 | |
}, | }, |
legend: { | legend: { |
show: false | show: false |
} | } |
} | } |
); | ); |
</script> | </script> |
<?php | <?php |
include_footer_documents(); | include_footer_documents(); |
?> | ?> |
<?php | <?php |
function include_header_documents($title) | function include_header_documents($title) |
{ | { |
header('X-UA-Compatible: IE=edge,chrome=1'); | header('X-UA-Compatible: IE=edge,chrome=1'); |
?> | ?> |
<!doctype html> | <!doctype html> |
<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ --> | <!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ --> |
<!--[if lt IE 7]> | <!--[if lt IE 7]> |
<html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]--> | <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]--> |
<!--[if IE 7]> | <!--[if IE 7]> |
<html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]--> | <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]--> |
<!--[if IE 8]> | <!--[if IE 8]> |
<html class="no-js lt-ie9" lang="en"> <![endif]--> | <html class="no-js lt-ie9" lang="en"> <![endif]--> |
<!-- Consider adding a manifest.appcache: h5bp.com/d/Offline --> | <!-- Consider adding a manifest.appcache: h5bp.com/d/Offline --> |
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]--> | <!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]--> |
<head> | <head> |
<meta charset="utf-8"> | <meta charset="utf-8"> |
<title>Australian Disclosure Logs<?php if ($title != "") echo " - $title"; ?></title> | <title>Australian Disclosure Logs<?php if ($title != "") echo " - $title"; ?></title> |
<meta name="description" content=""> | <meta name="description" content=""> |
<!-- Mobile viewport optimized: h5bp.com/viewport --> | <!-- Mobile viewport optimized: h5bp.com/viewport --> |
<meta name="viewport" content="width=device-width"> | <meta name="viewport" content="width=device-width"> |
<link rel="alternate" type="application/rss+xml" title="Latest Disclosure Log Entries" href="rss.xml.php"/> | <link rel="alternate" type="application/rss+xml" title="Latest Disclosure Log Entries" href="rss.xml.php"/> |
<!-- Place favicon.ico and apple-touch-icon.png in the root directory: mathiasbynens.be/notes/touch-icons --> | <!-- Place favicon.ico and apple-touch-icon.png in the root directory: mathiasbynens.be/notes/touch-icons --> |
<meta name="google-site-verification" content="jkknX5g2FCpQvrW030b1Nq2hyoa6mb3EDiA7kCoHNj8"/> | <meta name="google-site-verification" content="jkknX5g2FCpQvrW030b1Nq2hyoa6mb3EDiA7kCoHNj8"/> |
<!-- Le styles --> | <!-- Le styles --> |
<link href="css/bootstrap.min.css" rel="stylesheet"> | <link href="css/bootstrap.min.css" rel="stylesheet"> |
<style type="text/css"> | <style type="text/css"> |
body { | body { |
padding-top: 60px; | padding-top: 60px; |
padding-bottom: 40px; | padding-bottom: 40px; |
} | } |
.sidebar-nav { | .sidebar-nav { |
padding: 9px 0; | padding: 9px 0; |
} | } |
</style> | </style> |
<link href="css/bootstrap-responsive.min.css" rel="stylesheet"> | <link href="css/bootstrap-responsive.min.css" rel="stylesheet"> |
<!-- HTML5 shim, for IE6-8 support of HTML5 elements --> | <!-- HTML5 shim, for IE6-8 support of HTML5 elements --> |
<!--[if lt IE 9]> | <!--[if lt IE 9]> |
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> | <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> |
<![endif]--> | <![endif]--> |
<!-- More ideas for your <head> here: h5bp.com/d/head-Tips --> | <!-- More ideas for your <head> here: h5bp.com/d/head-Tips --> |
<!-- All JavaScript at the bottom, except this Modernizr build. | <!-- All JavaScript at the bottom, except this Modernizr build. |
Modernizr enables HTML5 elements & feature detects for optimal performance. | Modernizr enables HTML5 elements & feature detects for optimal performance. |
Create your own custom Modernizr build: www.modernizr.com/download/ | Create your own custom Modernizr build: www.modernizr.com/download/ |
<script src="js/libs/modernizr-2.5.3.min.js"></script>--> | <script src="js/libs/modernizr-2.5.3.min.js"></script>--> |
<script src="js/jquery.js"></script> | <script src="js/jquery.js"></script> |
<script type="text/javascript" src="js/flotr2.min.js"></script> | <script type="text/javascript" src="js/flotr2.min.js"></script> |
</head> | </head> |
<body> | <body> |
<div class="navbar navbar-inverse navbar-fixed-top"> | <div class="navbar navbar-inverse navbar-fixed-top"> |
<div class="navbar-inner"> | <div class="navbar-inner"> |
<div class="container-fluid"> | <div class="container-fluid"> |
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"> | <!--<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"> |
<span class="icon-bar"></span> | <span class="icon-bar"></span> |
<span class="icon-bar"></span> | <span class="icon-bar"></span> |
<span class="icon-bar"></span> | <span class="icon-bar"></span> |
</a> | </a> --> |
<a class="brand" href="#">Australian Disclosure Logs</a> | <a class="brand" href="#">Australian Disclosure Logs</a> |
<div class="nav-collapse collapse"> | <div class="nav-collapse collapse"> |
<p class="navbar-text pull-right"> | <p class="navbar-text pull-right"> |
<small> | <small> |
Subsites on: | Subsites on: |
</small> | </small> |
<a href="http://orgs.disclosurelo.gs">Government Agencies</a> | <a href="http://orgs.disclosurelo.gs">Government Agencies</a> |
• <a href="http://lobbyists.disclosurelo.gs">Political Lobbyists</a> | • <a href="http://lobbyists.disclosurelo.gs">Political Lobbyists</a> |
• <a href="http://contracts.disclosurelo.gs">Government Contracts and Spending</a> | • <a href="http://contracts.disclosurelo.gs">Government Contracts and Spending</a> |
</p> | </p> |
<ul class="nav"> | <ul class="nav"> |
<li><a href="agency.php">By Agency</a></li> | <li><a href="agency.php">By Agency</a></li> |
<li><a href="date.php">By Date</a></li> | <li><a href="date.php">By Date</a></li> |
<li><a href="disclogsList.php">List of Disclosure Logs</a></li> | <li><a href="disclogsList.php">List of Disclosure Logs</a></li> |
<li><a href="charts.php">Charts</a></li> | |
<li><a href="about.php">About</a></li> | <li><a href="about.php">About</a></li> |
</ul> | </ul> |
</div> | </div> |
<!--/.nav-collapse --> | <!--/.nav-collapse --> |
</div> | </div> |
</div> | </div> |
</div> | </div> |
<div class="container"> | <div class="container"> |
<?php | <?php |
} | } |
function include_footer_documents() | function include_footer_documents() |
{ | { |
global $ENV; | global $ENV; |
?> | ?> |
</div> <!-- /container --> | </div> <!-- /container --> |
<hr> | <hr> |
<footer> | <footer> |
<p>Not affiliated with or endorsed by any government agency.</p> | <p>Not affiliated with or endorsed by any government agency.</p> |
</footer> | </footer> |
<?php | <?php |
if ($ENV != "DEV") { | if ($ENV != "DEV") { |
echo "<script type='text/javascript'> | echo "<script type='text/javascript'> |
var _gaq = _gaq || []; | var _gaq = _gaq || []; |
_gaq.push(['_setAccount', 'UA-12341040-4']); | _gaq.push(['_setAccount', 'UA-12341040-4']); |
_gaq.push(['_setDomainName', 'disclosurelo.gs']); | _gaq.push(['_setDomainName', 'disclosurelo.gs']); |
_gaq.push(['_setAllowLinker', true]); | _gaq.push(['_setAllowLinker', true]); |
_gaq.push(['_trackPageview']); | _gaq.push(['_trackPageview']); |
(function() { | (function() { |
var ga = document.createElement('script'); | var ga = document.createElement('script'); |
ga.type = 'text/javascript'; | ga.type = 'text/javascript'; |
ga.async = true; | ga.async = true; |
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; | ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; |
var s = document.getElementsByTagName('script')[0]; | var s = document.getElementsByTagName('script')[0]; |
s.parentNode.insertBefore(ga, s); | s.parentNode.insertBefore(ga, s); |
})(); | })(); |
</script>"; | </script>"; |
} | } |
?> | ?> |
<!-- Le javascript | <!-- Le javascript |
================================================== --> | ================================================== --> |
<!-- Placed at the end of the document so the pages load faster --> | <!-- Placed at the end of the document so the pages load faster --> |
<!-- | <!-- |
<script src="js/bootstrap-transition.js"></script> | <script src="js/bootstrap-transition.js"></script> |
<script src="js/bootstrap-alert.js"></script> | <script src="js/bootstrap-alert.js"></script> |
<script src="js/bootstrap-modal.js"></script> | <script src="js/bootstrap-modal.js"></script> |
<script src="js/bootstrap-dropdown.js"></script> | <script src="js/bootstrap-dropdown.js"></script> |
<script src="js/bootstrap-scrollspy.js"></script> | <script src="js/bootstrap-scrollspy.js"></script> |
<script src="js/bootstrap-tab.js"></script> | <script src="js/bootstrap-tab.js"></script> |
<script src="js/bootstrap-tooltip.js"></script> | <script src="js/bootstrap-tooltip.js"></script> |
<script src="js/bootstrap-popover.js"></script> | <script src="js/bootstrap-popover.js"></script> |
<script src="js/bootstrap-button.js"></script> | <script src="js/bootstrap-button.js"></script> |
<script src="js/bootstrap-collapse.js"></script> | <script src="js/bootstrap-collapse.js"></script> |
<script src="js/bootstrap-carousel.js"></script> | <script src="js/bootstrap-carousel.js"></script> |
<script src="js/bootstrap-typeahead.js"></script>--> | <script src="js/bootstrap-typeahead.js"></script>--> |
</body> | </body> |
</html> | </html> |
<?php | <?php |
} | } |
function truncate($string, $length, $stopanywhere = false) | function truncate($string, $length, $stopanywhere = false) |
{ | { |
//truncates a string to a certain char length, stopping on a word if not specified otherwise. | //truncates a string to a certain char length, stopping on a word if not specified otherwise. |
if (strlen($string) > $length) { | if (strlen($string) > $length) { |
//limit hit! | //limit hit! |
$string = substr($string, 0, ($length - 3)); | $string = substr($string, 0, ($length - 3)); |
if ($stopanywhere) { | if ($stopanywhere) { |
//stop anywhere | //stop anywhere |
$string .= '...'; | $string .= '...'; |
} else { | } else { |
//stop on a word. | //stop on a word. |
$string = substr($string, 0, strrpos($string, ' ')) . '...'; | $string = substr($string, 0, strrpos($string, ' ')) . '...'; |
} | } |
} | } |
return $string; | return $string; |
} | } |
function displayLogEntry($row, $idtoname) | function displayLogEntry($row, $idtoname) |
{ | { |
$result = ""; | $result = ""; |
$result .= '<div itemscope itemtype="http://schema.org/Article">'; | $result .= '<div itemscope itemtype="http://schema.org/Article">'; |
$result .= '<h2><a href="http://disclosurelo.gs/view.php?id=' . $row->value->_id . '"> <span itemprop="datePublished">' . $row->value->date . "</span>: <span itemprop='name headline'>" . truncate($row->value->title, 120) . "</span>"; | $result .= '<h2><a href="http://disclosurelo.gs/view.php?id=' . $row->value->_id . '"> <span itemprop="datePublished">' . $row->value->date . "</span>: <span itemprop='name headline'>" . truncate($row->value->title, 120) . "</span>"; |
$result .= ' (<span itemprop="author publisher creator">' . $idtoname[$row->value->agencyID] . '</span>)</a></h2>'; | $result .= ' (<span itemprop="author publisher creator">' . $idtoname[$row->value->agencyID] . '</span>)</a></h2>'; |
$result .= "<p itemprop='description articleBody text'> Title: " . $row->value->title . "<br/>"; | $result .= "<p itemprop='description articleBody text'> Title: " . $row->value->title . "<br/>"; |
if (isset($row->value->description)) { | if (isset($row->value->description)) { |
$result .= str_replace("\n", "<br>", preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "", trim($row->value->description))); | $result .= str_replace("\n", "<br>", preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "", trim($row->value->description))); |
} | } |
if (isset($row->value->notes)) { | if (isset($row->value->notes)) { |
$result .= " <br>Note: " . $row->value->notes; | $result .= " <br>Note: " . $row->value->notes; |
} | } |
$result .= "</p>"; | $result .= "</p>"; |
if (isset($row->value->links)) { | if (isset($row->value->links)) { |
$result .= '<h3>Links/Documents</h3><ul itemprop="associatedMedia">'; | $result .= '<h3>Links/Documents</h3><ul itemprop="associatedMedia">'; |
foreach ($row->value->links as $link) { | foreach ($row->value->links as $link) { |
$result .= '<li itemscope itemtype="http://schema.org/MediaObject"><a href="' . htmlspecialchars($link) . '" itemprop="url contentURL">' . htmlspecialchars($link) . "</a></li>"; | $result .= '<li itemscope itemtype="http://schema.org/MediaObject"><a href="' . htmlspecialchars($link) . '" itemprop="url contentURL">' . htmlspecialchars($link) . "</a></li>"; |
} | } |
$result .= "</ul>"; | $result .= "</ul>"; |
} | } |
$result .= "<small><A itemprop='url' href='" . $row->value->url . "'>View original source...</a> ID: " . strip_tags($row->value->docID) . "</small>"; | $result .= "<small><A itemprop='url' href='" . $row->value->url . "'>View original source...</a> ID: " . strip_tags($row->value->docID) . "</small>"; |
$result .= "</div>\n"; | $result .= "</div>\n"; |
return $result; | return $result; |
} | } |
<?php | |
include_once('include/common.inc.php'); | |
include_header('Charts'); | |
$db = $server->get_db('disclosr-agencies'); | |
?> | |
<div class="foundation-header"> | |
<h1><a href="about.php">Charts</a></h1> | |
<h4 class="subheader">Lorem ipsum.</h4> | |
</div> | |
<div id="scores" style="width:900px;height:500px;"></div> | |
<script id="source"> | |
window.onload = function() { | |
$(document).ready(function() { | |
var d1 = []; | |
var scorelabels = []; | |
<?php | |
try { | |
$rows = $db->get_view("app", "scoreHas?group=true", null, true)->rows; | |
$dataValues = Array(); | |
foreach ($rows as $row) { | |
$dataValues[$row->value] = $row->key; | |
} | |
$i = 0; | |
ksort($dataValues); | |
foreach ($dataValues as $value => $key) { | |
echo " d1.push([$i, $value]);" . PHP_EOL; | |
echo " scorelabels.push('$key');" . PHP_EOL; | |
$i++; | |
} | |
} catch (SetteeRestClientException $e) { | |
setteErrorHandler($e); | |
} | |
?> | |
function scoretrackformatter(obj) { | |
if (scorelabels[Math.floor(obj.x)]) { | |
return (scorelabels[Math.floor(obj.x)])+"="+obj.y; | |
} else { | |
return ""; | |
} | |
} | |
function scoretickformatter(val, axis) { | |
if (scorelabels[Math.floor(val)]) { | |
return '<p style="margin-top:8em;-webkit-transform:rotate(-90deg);">'+(scorelabels[Math.floor(val)])+"</b>"; | |
} else { | |
return ""; | |
} | |
} | |
Flotr.draw(document.getElementById("scores"), [ {data: d1}], { | |
HtmlText: true, | |
bars : { | |
show : true | |
}, | |
mouse : { | |
track : true, | |
relative : true, | |
trackFormatter: scoretrackformatter | |
},yaxis: { | |
autoscaling: true | |
}, | |
xaxis: { | |
autoscaling: true, | |
minorTickFreq: 0.6, | |
noTicks : scorelabels.length, | |
tickFormatter: scoretickformatter | |
} | |
}); | |
<div id="employees" style="width:1000px;height:900px;"></div> | |
var emplabels = []; | |
function emptrackformatter(obj) { | |
return (obj.series.label)+" = "+obj.y+" in "+emplabels[Math.floor(obj.x)]; | |
} | |
function emptickformatter(val, axis) { | |
if (emplabels[Math.floor(val)]) { | |
return '<p style="margin-top:8em;-webkit-transform:rotate(-90deg);">'+(emplabels[Math.floor(val)])+"</b>"; | |
} else { | |
return ""; | |
} | |
} | |
function onDataReceived(series) { | |
emplabels = series.labels; | |
Flotr.draw(document.getElementById("employees"), series.data, { | |
mouse : { | |
track : true, | |
relative : true, | |
trackFormatter: emptrackformatter | |
},yaxis: { | |
max: 10000, | |
scaling: 'logarithmic' | |
}, | |
xaxis: { | |
minorTickFreq: 1, | |
noTicks: emplabels.length, | |
showMinorLabels: true, | |
tickFormatter: emptickformatter | |
}, | |
legend: { | |
show: false | |
} | |
}); | |
} | |
$.ajax({ | |
url: "admin/exportEmployees.csv.php?format=json", | |
method: 'GET', | |
dataType: 'json', | |
success: onDataReceived | |
}); | |
}); | |
}; | |
</script> | |
<?php | |
include_footer(); | |
?> | |
<?php | <?php |
include_once('include/common.inc.php'); | include_once('include/common.inc.php'); |
function displayValue($key, $value, $mode) { | function displayValue($key, $value, $mode) |
{ | |
global $db, $schemas; | global $db, $schemas; |
$ignoreKeys = Array("metadata" ,"metaTags", "statistics","rtkURLs","rtkDescriptions"); | $ignoreKeys = Array("metadata", "metaTags", "statistics", "rtkURLs", "rtkDescriptions"); |
if ($mode == "view") { | if ($mode == "view") { |
if (strpos($key, "_") === 0 || in_array($key,$ignoreKeys)) | if (strpos($key, "_") === 0 || in_array($key, $ignoreKeys)) |
return; | return; |
echo "<tr>"; | echo "<tr>"; |
echo "<td class='$key'>"; | echo "<td class='$key'>"; |
if (isset($schemas['agency']["properties"][$key])) { | if (isset($schemas['agency']["properties"][$key])) { |
echo $schemas['agency']["properties"][$key]['x-title'] . "<br><small>" . $schemas['agency']["properties"][$key]['description'] . "</small>"; | echo $schemas['agency']["properties"][$key]['x-title'] . "<br><small>" . $schemas['agency']["properties"][$key]['description'] . "</small>"; |
} | } |
echo "</td><td>"; | echo "</td><td>"; |
if (is_array($value)) { | if (is_array($value)) { |
echo "<ol>"; | echo "<ol>"; |
foreach ($value as $subkey => $subvalue) { | foreach ($value as $subkey => $subvalue) { |
echo "<li "; | echo "<li "; |
if (isset($schemas['agency']["properties"][$key]['x-property'])) { | if (isset($schemas['agency']["properties"][$key]['x-property'])) { |
echo ' property="' . $schemas['agency']["properties"][$key]['x-property'] . '" '; | echo ' property="' . $schemas['agency']["properties"][$key]['x-property'] . '" '; |
} if (isset($schemas['agency']["properties"][$key]['x-itemprop'])) { | } |
if (isset($schemas['agency']["properties"][$key]['x-itemprop'])) { | |
echo ' itemprop="' . $schemas['agency']["properties"][$key]['x-itemprop'] . '" '; | echo ' itemprop="' . $schemas['agency']["properties"][$key]['x-itemprop'] . '" '; |
} | } |
echo " >"; | echo " >"; |
echo "$subvalue</li>"; | echo "$subvalue</li>"; |
} | } |
echo "</ol></td></tr>"; | echo "</ol></td></tr>"; |
} else { | } else { |
if (isset($schemas['agency']["properties"][$key]['x-property'])) { | if (isset($schemas['agency']["properties"][$key]['x-property'])) { |
echo '<span property="' . $schemas['agency']["properties"][$key]['x-property'] . '">'; | echo '<span property="' . $schemas['agency']["properties"][$key]['x-property'] . '">'; |
} else { | } else { |
echo "<span>"; | echo "<span>"; |
} | } |
if ((strpos($key, "URL") > 0 || $key == 'website') && $value != "") { | if ((strpos($key, "URL") > 0 || $key == 'website') && $value != "") { |
echo "<a " . ($key == 'website' ? 'itemprop="url"' : '') . " href='$value'>$value</a>"; | echo "<a " . ($key == 'website' ? 'itemprop="url"' : '') . " href='$value'>$value</a>"; |
} else if ($key == 'abn') { | } else if ($key == 'abn') { |
echo "<a href='http://www.abr.business.gov.au/SearchByAbn.aspx?SearchText=$value'>$value</a>"; | echo "<a href='http://www.abr.business.gov.au/SearchByAbn.aspx?SearchText=$value'>$value</a>"; |
} else { | } else { |
echo "$value"; | echo "$value"; |
} | } |
echo "</span>"; | echo "</span>"; |
} | } |
echo "</td></tr>"; | echo "</td></tr>"; |
} | } |
if ($mode == "edit") { | if ($mode == "edit") { |
if (is_array($value)) { | if (is_array($value)) { |
echo '<div class="row"> | echo '<div class="row"> |
<div class="seven columns"> | <div class="seven columns"> |
<fieldset> | <fieldset> |
<h5>' . $key . '</h5>'; | <h5>' . $key . '</h5>'; |
foreach ($value as $subkey => $subvalue) { | foreach ($value as $subkey => $subvalue) { |
echo "<label>$subkey</label><input class='input-text' type='text' id='$key$subkey' name='$key" . '[' . $subkey . "]' value='$subvalue'/></tr>"; | echo "<label>$subkey</label><input class='input-text' type='text' id='$key$subkey' name='$key" . '[' . $subkey . "]' value='$subvalue'/></tr>"; |
} | } |
echo "</fieldset> | echo "</fieldset> |
</div> | </div> |
</div>"; | </div>"; |
} else { | } else { |
if (strpos($key, "_") === 0) { | if (strpos($key, "_") === 0) { |
echo"<input type='hidden' id='$key' name='$key' value='$value'/>"; | echo "<input type='hidden' id='$key' name='$key' value='$value'/>"; |
} else if ($key == "parentOrg") { | } else if ($key == "parentOrg") { |
echo "<label for='$key'>$key</label><select id='$key' name='$key'><option value=''> Select... </option>"; | echo "<label for='$key'>$key</label><select id='$key' name='$key'><option value=''> Select... </option>"; |
$rows = $db->get_view("app", "byDeptStateName")->rows; | $rows = $db->get_view("app", "byDeptStateName")->rows; |
//print_r($rows); | //print_r($rows); |
foreach ($rows as $row) { | foreach ($rows as $row) { |
echo "<option value='{$row->value}'" . (($row->value == $value) ? "SELECTED" : "") . " >" . str_replace("Department of ", "", $row->key) . "</option>"; | echo "<option value='{$row->value}'" . (($row->value == $value) ? "SELECTED" : "") . " >" . str_replace("Department of ", "", $row->key) . "</option>"; |
} | } |
echo" </select>"; | echo " </select>"; |
} else { | } else { |
echo "<label>$key</label><input class='input-text' type='text' id='$key' name='$key' value='$value'/>"; | echo "<label>$key</label><input class='input-text' type='text' id='$key' name='$key' value='$value'/>"; |
if ((strpos($key, "URL") > 0 || $key == 'website') && $value != "") { | if ((strpos($key, "URL") > 0 || $key == 'website') && $value != "") { |
echo "<a " . ($key == 'website' ? 'itemprop="url"' : '') . " href='$value'>view</a>"; | echo "<a " . ($key == 'website' ? 'itemprop="url"' : '') . " href='$value'>view</a>"; |
} | } |
if ($key == 'abn') { | if ($key == 'abn') { |
echo "<a href='http://www.abr.business.gov.au/SearchByAbn.aspx?SearchText=$value'>view abn</a>"; | echo "<a href='http://www.abr.business.gov.au/SearchByAbn.aspx?SearchText=$value'>view abn</a>"; |
} | } |
} | } |
} | } |
} | } |
// | // |
} | } |
function addDefaultFields($row) { | function addDefaultFields($row) |
{ | |
global $schemas; | global $schemas; |
$defaultFields = array_keys($schemas['agency']['properties']); | $defaultFields = array_keys($schemas['agency']['properties']); |
foreach ($defaultFields as $defaultField) { | foreach ($defaultFields as $defaultField) { |
if (!isset($row[$defaultField])) { | if (!isset($row[$defaultField])) { |
if ($schemas['agency']['properties'][$defaultField]['type'] == "string") { | if ($schemas['agency']['properties'][$defaultField]['type'] == "string") { |
$row[$defaultField] = ""; | $row[$defaultField] = ""; |
} | } |
if ($schemas['agency']['properties'][$defaultField]['type'] == "array") { | if ($schemas['agency']['properties'][$defaultField]['type'] == "array") { |
$row[$defaultField] = Array(""); | $row[$defaultField] = Array(""); |
} | } |
} else if ($schemas['agency']['properties'][$defaultField]['type'] == "array") { | } else if ($schemas['agency']['properties'][$defaultField]['type'] == "array") { |
if (is_array($row[$defaultField])) { | if (is_array($row[$defaultField])) { |
$row[$defaultField][] = ""; | $row[$defaultField][] = ""; |
$row[$defaultField][] = ""; | $row[$defaultField][] = ""; |
$row[$defaultField][] = ""; | $row[$defaultField][] = ""; |
} else { | } else { |
$value = $row[$defaultField]; | $value = $row[$defaultField]; |
$row[$defaultField] = Array($value); | $row[$defaultField] = Array($value); |
$row[$defaultField][] = ""; | $row[$defaultField][] = ""; |
$row[$defaultField][] = ""; | $row[$defaultField][] = ""; |
} | } |
} | } |
} | } |
return $row; | return $row; |
} | } |
$db = $server->get_db('disclosr-agencies'); | $db = $server->get_db('disclosr-agencies'); |
if (isset($_REQUEST['id'])) { | if (isset($_REQUEST['id'])) { |
//get an agency record as json/html, search by name/abn/id | //get an agency record as json/html, search by name/abn/id |
// by name = startkey="Ham"&endkey="Ham\ufff0" | // by name = startkey="Ham"&endkey="Ham\ufff0" |
// edit? | // edit? |
$obj = $db->get($_REQUEST['id']); | $obj = $db->get($_REQUEST['id']); |
include_header(isset($obj->name) ? $obj->name : ""); | include_header(isset($obj->name) ? $obj->name : ""); |
//print_r($row); | //print_r($row); |
if (sizeof($_POST) > 0) { | if (sizeof($_POST) > 0) { |
//print_r($_POST); | //print_r($_POST); |
foreach ($_POST as $postkey => $postvalue) { | foreach ($_POST as $postkey => $postvalue) { |
if ($postvalue == "") { | if ($postvalue == "") { |
unset($_POST[$postkey]); | |
} | |
if (is_array($postvalue)) { | |
if (count($postvalue) == 1 && $postvalue[0] == "") { | |
unset($_POST[$postkey]); | unset($_POST[$postkey]); |
} | } else { |
if (is_array($postvalue)) { | foreach ($_POST[$postkey] as $key => &$value) { |
if (count($postvalue) == 1 && $postvalue[0] == "") { | if ($value == "") { |
unset($_POST[$postkey]); | unset($_POST[$postkey][$key]); |
} else { | |
foreach ($_POST[$postkey] as $key => &$value) { | |
if ($value == "") { | |
unset($_POST[$postkey][$key]); | |
} | |
} | } |
} | } |
} | } |
} | } |
if (isset($_POST['_id']) && $db->get_rev($_POST['_id']) == $_POST['_rev']) { | } |
echo "Edited version was latest version, continue saving"; | if (isset($_POST['_id']) && $db->get_rev($_POST['_id']) == $_POST['_rev']) { |
$newdoc = $_POST; | echo "Edited version was latest version, continue saving"; |
$newdoc['metadata']['lastModified'] = time(); | $newdoc = $_POST; |
$obj = $db->save($newdoc); | $newdoc['metadata']['lastModified'] = time(); |
} else { | $obj = $db->save($newdoc); |
echo "ALERT doc revised by someone else while editing. Document not saved."; | |
} | |
} | |
$mode = "view"; | |
$rowArray = object_to_array($obj); | |
ksort($rowArray); | |
if ($mode == "edit") { | |
$row = addDefaultFields($rowArray); | |
} else { | } else { |
$row = $rowArray; | echo "ALERT doc revised by someone else while editing. Document not saved."; |
} | } |
} | |
if ($mode == "view") { | |
echo ' <div class="container-fluid"> | $mode = "view"; |
$rowArray = object_to_array($obj); | |
ksort($rowArray); | |
if ($mode == "edit") { | |
$row = addDefaultFields($rowArray); | |
} else { | |
$row = $rowArray; | |
} | |
if ($mode == "view") { | |
echo ' <div class="container-fluid"> | |
<div class="row-fluid"> | <div class="row-fluid"> |
<div class="span3"> | <div class="span3"> |
<div class="well sidebar-nav"> | <div class="well sidebar-nav"> |
<ul class="nav nav-list"> | <ul class="nav nav-list"> |
<li class="nav-header">Statistics</li>'; | <li class="nav-header">Statistics</li>'; |
if (isset($row['statistics']['employees'])) { | if (isset($row['statistics']['employees'])) { |
echo '<div><i class="icon-user" style="float:left"></i><p style="margin-left:16px;">'; | echo '<div><i class="icon-user" style="float:left"></i><p style="margin-left:16px;">'; |
$keys = array_keys($row['statistics']['employees']); | $keys = array_keys($row['statistics']['employees']); |
$lastkey = $keys[count($keys)-1]; | $lastkey = $keys[count($keys) - 1]; |
echo $row['statistics']['employees'][$lastkey]['value'].' employees <small>('.$lastkey.')</small>'; | echo $row['statistics']['employees'][$lastkey]['value'] . ' employees <small>(' . $lastkey . ')</small>'; |
echo '</div>'; | echo '</div>'; |
} | } |
if (isset($row['statistics']['budget'])) { | if (isset($row['statistics']['budget'])) { |
echo '<div><i class="icon-shopping-cart" style="float:left"></i><p style="margin-left:16px;">'; | echo '<div><i class="icon-shopping-cart" style="float:left"></i><p style="margin-left:16px;">'; |
$keys = array_keys($row['statistics']['budget']); | $keys = array_keys($row['statistics']['budget']); |
$lastkey = $keys[count($keys)-1]; | $lastkey = $keys[count($keys) - 1]; |
echo "$".number_format(floatval($row['statistics']['budget'][$lastkey]['value'])).' <small>('.$lastkey.' budget)</small>'; | echo "$" . number_format(floatval($row['statistics']['budget'][$lastkey]['value'])) . ' <small>(' . $lastkey . ' budget)</small>'; |
echo '</div>'; | echo '</div>'; |
} | } |
echo ' </ul> | echo ' </ul> |
</div><!--/.well --> | </div><!--/.well --> |
</div><!--/span--> | </div><!--/span--> |
<div class="span9">'; | <div class="span9">'; |
echo '<div itemscope itemtype="http://schema.org/GovernmentOrganization" typeof="schema:GovernmentOrganization" about="#' . $row['_id'] . '">'; | echo '<div itemscope itemtype="http://schema.org/GovernmentOrganization" typeof="schema:GovernmentOrganization" about="#' . $row['_id'] . '">'; |
echo '<div class="hero-unit"> | echo '<div class="hero-unit"> |
<h1 itemprop="name">' . $row['name'] . '</h1>'; | <h1 itemprop="name">' . $row['name'] . '</h1>'; |
if (isset($row['description'])) { | if (isset($row['description'])) { |
echo '<p>'.$row['description'].'</p>'; | echo '<p>' . $row['description'] . '</p>'; |
} | } |
echo '</div><table width="100%">'; | echo '</div><table width="100%">'; |
echo "<tr><th>Field Name</th><th>Field Value</th></tr>"; | echo "<tr><th>Field Name</th><th>Field Value</th></tr>"; |
} | } |
if ($mode == "edit") { | if ($mode == "edit") { |
?> | ?> |
<input id="addfield" type="button" value="Add Field"/> | <input id="addfield" type="button" value="Add Field"/> |
<script> | <script> |
window.onload = function() { | window.onload = function () { |
$(document).ready(function() { | $(document).ready(function () { |
// put all your jQuery goodness in here. | // put all your jQuery goodness in here. |
// http://charlie.griefer.com/blog/2009/09/17/jquery-dynamically-adding-form-elements/ | // http://charlie.griefer.com/blog/2009/09/17/jquery-dynamically-adding-form-elements/ |
$('#addfield').click(function() { | $('#addfield').click(function () { |
var field_name=window.prompt("fieldname?",""); | var field_name = window.prompt("fieldname?", ""); |
if (field_name !="") { | if (field_name != "") { |
$('#submitbutton').before($('<span></span>') | $('#submitbutton').before($('<span></span>') |
.append("<label>"+field_name+"</label>") | .append("<label>" + field_name + "</label>") |
.append("<input class='input-text' type='text' id='"+field_name+"' name='"+field_name+"'/>") | .append("<input class='input-text' type='text' id='" + field_name + "' name='" + field_name + "'/>") |
); | ); |
} | } |
}); | }); |
}); | }); |
}; | }; |
</script> | </script> |
<form id="editform" class="nice" method="post"> | <form id="editform" class="nice" method="post"> |
<?php | <?php |
} | } |
foreach ($row as $key => $value) { | foreach ($row as $key => $value) { |
echo displayValue($key, $value, $mode); | echo displayValue($key, $value, $mode); |
} | } |
if ($mode == "view") { | if ($mode == "view") { |
echo "</table></div>"; | echo "</table></div>"; |
echo ' </div><!--/span--> | echo ' </div><!--/span--> |
</div><!--/row--> | </div><!--/row--> |
</div><!--/span--> | </div><!--/span--> |
</div><!--/row-->'; | </div><!--/row-->'; |
} | } |
if ($mode == "edit") { | if ($mode == "edit") { |
echo '<input id="submitbutton" type="submit"/></form>'; | echo '<input id="submitbutton" type="submit"/></form>'; |
} | } |
} else { | } else { |
// show all list | // show all list |
include_header('Agencies'); | include_header('Agencies'); |
echo ' <div class="container-fluid"> | echo ' <div class="container-fluid"> |
<div class="row-fluid"> | <div class="row-fluid"> |
<div class="span3"> | <div class="span3"> |
<div class="well sidebar-nav"> | <div class="well sidebar-nav"> |
<ul class="nav nav-list"> | <ul class="nav nav-list"> |
<li class="nav-header">Sidebar</li>'; | <li class="nav-header">Sidebar</li>'; |
echo ' </ul> | echo ' </ul> |
</div><!--/.well --> | </div><!--/.well --> |
</div><!--/span--> | </div><!--/span--> |
<div class="span9"> | <div class="span9"> |
<div class="hero-unit"> | <div class="hero-unit"> |
<h1>Australian Government Agencies</h1> | <h1>Australian Government Agencies</h1> |
<p>Explore collected information about Australian Government Agencies below.</p> | <p>Explore collected information about Australian Government Agencies below.</p> |
</div> | </div> |
<div class="row-fluid"> | <div class="row-fluid"> |
<div class="span4">'; | <div class="span4">'; |
try { | try { |
$rows = $db->get_view("app", "byCanonicalName")->rows; | $rows = $db->get_view("app", "byCanonicalName")->rows; |
//print_r($rows); | //print_r($rows); |
$rowCount = count($rows); | $rowCount = count($rows); |
foreach ($rows as $i => $row) { | foreach ($rows as $i => $row) { |
if ($i % ($rowCount/3) == 0 && $i != 0 && $i != $rowCount -2 ) echo '</div><div class="span4">'; | if ($i % ($rowCount / 3) == 0 && $i != 0 && $i != $rowCount - 2) echo '</div><div class="span4">'; |
// print_r($row); | // print_r($row); |
echo '<span itemscope itemtype="http://schema.org/GovernmentOrganization" typeof="schema:GovernmentOrganization foaf:Organization" about="getAgency.php?id=' . $row->value->_id . '"> | echo '<span itemscope itemtype="http://schema.org/GovernmentOrganization" typeof="schema:GovernmentOrganization foaf:Organization" about="getAgency.php?id=' . $row->value->_id . '"> |
<a href="getAgency.php?id=' . $row->value->_id . '" rel="schema:url foaf:page" property="schema:name foaf:name" itemprop="url"><span itemprop="name">' . | <a href="getAgency.php?id=' . $row->value->_id . '" rel="schema:url foaf:page" property="schema:name foaf:name" itemprop="url"><span itemprop="name">' . |
(isset($row->value->name) ? $row->value->name : "ERROR NAME MISSING") | (isset($row->value->name) ? $row->value->name : "ERROR NAME MISSING") |
. '</span></a></span><br><br>'; | . '</span></a></span><br><br>'; |
} | } |
} catch (SetteeRestClientException $e) { | } catch (SetteeRestClientException $e) { |
setteErrorHandler($e); | setteErrorHandler($e); |
} | } |
echo ' </div><!--/span--> | echo ' </div><!--/span--> |
</div><!--/row--> | </div><!--/row--> |
</div><!--/span--> | </div><!--/span--> |
</div><!--/row-->'; | </div><!--/row-->'; |
} | } |
include_footer(); | include_footer(); |
?> | ?> |
<?php | <?php |
date_default_timezone_set("Australia/Sydney"); | date_default_timezone_set("Australia/Sydney"); |
$basePath = ""; | $basePath = ""; |
if (strstr($_SERVER['PHP_SELF'], "alaveteli/") | if (strstr($_SERVER['PHP_SELF'], "alaveteli/") |
|| strstr($_SERVER['PHP_SELF'], "admin/") | || strstr($_SERVER['PHP_SELF'], "admin/") |
|| strstr($_SERVER['PHP_SELF'], "lib/") | || strstr($_SERVER['PHP_SELF'], "lib/") |
|| strstr($_SERVER['PHP_SELF'], "include/") | || strstr($_SERVER['PHP_SELF'], "include/") |
|| strstr($_SERVER['PHP_SELF'], "documents/") | || strstr($_SERVER['PHP_SELF'], "documents/") |
|| $_SERVER['SERVER_NAME'] == "disclosurelo.gs" | || $_SERVER['SERVER_NAME'] == "disclosurelo.gs" |
|| $_SERVER['SERVER_NAME'] == "www.disclosurelo.gs" | || $_SERVER['SERVER_NAME'] == "www.disclosurelo.gs" |
) | ) |
$basePath = "../"; | $basePath = "../"; |
include_once ('couchdb.inc.php'); | include_once ('couchdb.inc.php'); |
include_once ('template.inc.php'); | include_once ('template.inc.php'); |
require_once $basePath.'lib/Requests/library/Requests.php'; | require_once $basePath.'lib/Requests/library/Requests.php'; |
Requests::register_autoloader(); | Requests::register_autoloader(); |
$ENV = "DEV"; | $ENV = "DEV"; |
if (isset($_SERVER['SERVER_NAME']) && $_SERVER['SERVER_NAME'] != 'localhost') { | if (false && isset($_SERVER['SERVER_NAME']) && $_SERVER['SERVER_NAME'] != 'localhost') { |
require $basePath."lib/amon-php/amon.php"; | require $basePath."lib/amon-php/amon.php"; |
Amon::config(array('address'=> 'http://127.0.0.1:2464', | Amon::config(array('address'=> 'http://127.0.0.1:2464', |
'protocol' => 'http', | 'protocol' => 'http', |
'secret_key' => "I2LJ6dOMmlnXgVAkTPFXd5M3ejkga8Gd2FbBt6iqZdw")); | 'secret_key' => "I2LJ6dOMmlnXgVAkTPFXd5M3ejkga8Gd2FbBt6iqZdw")); |
Amon::setup_exception_handler(); | Amon::setup_exception_handler(); |
$ENV = "PROD"; | $ENV = "PROD"; |
} | } |
# Convert a stdClass to an Array. http://www.php.net/manual/en/language.types.object.php#102735 | # Convert a stdClass to an Array. http://www.php.net/manual/en/language.types.object.php#102735 |
function object_to_array(stdClass $Class) { | function object_to_array(stdClass $Class) { |
# Typecast to (array) automatically converts stdClass -> array. | # Typecast to (array) automatically converts stdClass -> array. |
$Class = (array) $Class; | $Class = (array) $Class; |
# Iterate through the former properties looking for any stdClass properties. | # Iterate through the former properties looking for any stdClass properties. |
# Recursively apply (array). | # Recursively apply (array). |
foreach ($Class as $key => $value) { | foreach ($Class as $key => $value) { |
if (is_object($value) && get_class($value) === 'stdClass') { | if (is_object($value) && get_class($value) === 'stdClass') { |
$Class[$key] = object_to_array($value); | $Class[$key] = object_to_array($value); |
} | } |
} | } |
return $Class; | return $Class; |
} | } |
# Convert an Array to stdClass. http://www.php.net/manual/en/language.types.object.php#102735 | # Convert an Array to stdClass. http://www.php.net/manual/en/language.types.object.php#102735 |
function array_to_object(array $array) { | function array_to_object(array $array) { |
# Iterate through our array looking for array values. | # Iterate through our array looking for array values. |
# If found recurvisely call itself. | # If found recurvisely call itself. |
foreach ($array as $key => $value) { | foreach ($array as $key => $value) { |
if (is_array($value)) { | if (is_array($value)) { |
$array[$key] = array_to_object($value); | $array[$key] = array_to_object($value); |
} | } |
} | } |
# Typecast to (object) will automatically convert array -> stdClass | # Typecast to (object) will automatically convert array -> stdClass |
return (object) $array; | return (object) $array; |
} | } |
function dept_to_portfolio($deptName) { | function dept_to_portfolio($deptName) { |
return trim(str_replace("Department of", "", str_replace("Department of the", "Department of", $deptName))); | return trim(str_replace("Department of", "", str_replace("Department of the", "Department of", $deptName))); |
} | } |
function phrase_to_tag ($phrase) { | function phrase_to_tag ($phrase) { |
return str_replace(" ","_",str_replace("'","",str_replace(",","",strtolower($phrase)))); | return str_replace(" ","_",str_replace("'","",str_replace(",","",strtolower($phrase)))); |
} | } |
function local_url() { | function local_url() { |
return "http://" . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['PHP_SELF']), '/\\') . "/"; | return "http://" . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['PHP_SELF']), '/\\') . "/"; |
} | } |
function GetDomain($url) | function GetDomain($url) |
{ | { |
$nowww = ereg_replace('www\.','',$url); | $nowww = ereg_replace('www\.','',$url); |
$domain = parse_url($nowww); | $domain = parse_url($nowww); |
if(!empty($domain["host"])) | if(!empty($domain["host"])) |
{ | { |
return $domain["host"]; | return $domain["host"]; |
} else | } else |
{ | { |
return $domain["path"]; | return $domain["path"]; |
} | } |
} | } |
<?php | <?php |
include $basePath . "schemas/schemas.inc.php"; | include $basePath . "schemas/schemas.inc.php"; |
require ($basePath . 'couchdb/settee/src/settee.php'); | require ($basePath . 'couchdb/settee/src/settee.php'); |
if (php_uname('n') == "vanille") { | if (php_uname('n') == "vanille") { |
$serverAddr = 'http://192.168.178.21:5984/'; | $serverAddr = 'http://192.168.178.21:5984/'; |
} else | } else |
if (php_uname('n') == "KYUUBEY") { | if (php_uname('n') == "KYUUBEY") { |
$serverAddr = 'http://192.168.1.148:5984/'; | $serverAddr = 'http://192.168.1.148:5984/'; |
$serverAddr = 'http://127.0.0.1:5984/'; | $serverAddr = 'http://127.0.0.1:5984/'; |
} else | } else |
if (php_uname('n') == "ikurt-20") { | if (php_uname('n') == "ikurt-20") { |
$serverAddr = 'http://192.168.1.113:5984/'; | //$serverAddr = 'http://192.168.1.113:5984/'; |
//$serverAddr = 'http://127.0.0.1:5984/'; | $serverAddr = 'http://127.0.0.1:5984/'; |
} else { | } else { |
$serverAddr = 'http://127.0.0.1:5984/'; | $serverAddr = 'http://127.0.0.1:5984/'; |
} | } |
$server = new SetteeServer($serverAddr); | $server = new SetteeServer($serverAddr); |
function setteErrorHandler($e) | function setteErrorHandler($e) |
{ | { |
if (class_exists('Amon')) { | if (class_exists('Amon')) { |
Amon::log($e->getMessage() . " " . print_r($_SERVER, true), array('error')); | Amon::log($e->getMessage() . " " . print_r($_SERVER, true), array('error')); |
} | } |
echo $e->getMessage() . "<br>" . PHP_EOL; | echo $e->getMessage() . "<br>" . PHP_EOL; |
} | } |
<?php | <?php |
function include_header($title) { | function include_header($title) { |
global $basePath; | global $basePath; |
?> | ?> |
<!DOCTYPE html> | <!DOCTYPE html> |
<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ --> | <!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ --> |
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]--> | <!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]--> |
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]--> | <!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]--> |
<!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]--> | <!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]--> |
<!--[if gt IE 8]><!--> <html lang="en"> <!--<![endif]--> | <!--[if gt IE 8]><!--> <html lang="en"> <!--<![endif]--> |
<head> | <head> |
<meta charset="utf-8" /> | <meta charset="utf-8" /> |
<!-- Set the viewport width to device width for mobile --> | <!-- Set the viewport width to device width for mobile --> |
<meta name="viewport" content="width=device-width" /> | <meta name="viewport" content="width=device-width" /> |
<title><?php echo $title; ?> - Disclosr</title> | <title><?php echo $title; ?> - Disclosr</title> |
<!-- Included CSS Files --> | <!-- Included CSS Files --> |
<link href="<?php echo $basePath ?>css/bootstrap.min.css" rel="stylesheet"> | <link href="<?php echo $basePath ?>css/bootstrap.min.css" rel="stylesheet"> |
<style type="text/css"> | <style type="text/css"> |
body { | body { |
padding-top: 60px; | padding-top: 60px; |
padding-bottom: 40px; | padding-bottom: 40px; |
} | } |
.sidebar-nav { | .sidebar-nav { |
padding: 9px 0; | padding: 9px 0; |
} | } |
.flotr-dummy-div { | |
margin-left: -999px; | |
} | |
</style> | </style> |
<link href="<?php echo $basePath ?>css/bootstrap-responsive.min.css" rel="stylesheet"> | <link href="<?php echo $basePath ?>css/bootstrap-responsive.min.css" rel="stylesheet"> |
<!--[if lt IE 9]> | <!--[if lt IE 9]> |
<link rel="stylesheet" href="<?php echo $basePath ?>stylesheets/ie.css"> | <link rel="stylesheet" href="<?php echo $basePath ?>stylesheets/ie.css"> |
<![endif]--> | <![endif]--> |
<!-- IE Fix for HTML5 Tags --> | <!-- IE Fix for HTML5 Tags --> |
<!--[if lt IE 9]> | <!--[if lt IE 9]> |
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> | <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> |
<![endif]--> | <![endif]--> |
</head> | </head> |
<body xmlns:schema="http://schema.org/" xmlns:foaf="http://xmlns.com/foaf/0.1/"> | <body xmlns:schema="http://schema.org/" xmlns:foaf="http://xmlns.com/foaf/0.1/"> |
<div class="navbar navbar-inverse navbar-fixed-top"> | <div class="navbar navbar-inverse navbar-fixed-top"> |
<div class="navbar-inner"> | <div class="navbar-inner"> |
<div class="container-fluid"> | <div class="container-fluid"> |
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"> | <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"> |
<span class="icon-bar"></span> | <span class="icon-bar"></span> |
<span class="icon-bar"></span> | <span class="icon-bar"></span> |
<span class="icon-bar"></span> | <span class="icon-bar"></span> |
</a> | </a> |
<a class="brand" href="#">Disclosr</a> | <a class="brand" href="#">Disclosr</a> |
<div class="nav-collapse collapse"> | <div class="nav-collapse collapse"> |
<ul class="nav"> | <ul class="nav"> |
<li><a href="getAgency.php">Agencies</a></li> | <li><a href="getAgency.php">Agencies</a></li> |
<li><a href="ranking.php">Open Gov Ranking</a></li> | |
<li><a href="headcount.php">Employee Headcount Graph</a></li> | <li><a href="headcount.php">Employee Headcount Graph</a></li> |
<li><a href="budget.php">Budget Graph</a></li> | <li><a href="budget.php">Budget Graph</a></li> |
<li><a href="about.php">About/FAQ</a></li> | <li><a href="about.php">About/FAQ</a></li> |
</ul> | </ul> |
</div><!--/.nav-collapse --> | </div><!--/.nav-collapse --> |
</div> | </div> |
</div> | </div> |
</div> | </div> |
<div class="container-fluid"> | <div class="container-fluid"> |
<?php } | <?php } |
function include_footer() { | function include_footer() { |
global $basePath; | global $basePath; |
?> | ?> |
</div> <!-- /container --> | </div> <!-- /container --> |
<hr> | <hr> |
<footer> | <footer> |
<p>Not affiliated with or endorsed by any government agency.</p> | <p>Not affiliated with or endorsed by any government agency.</p> |
</footer> | </footer> |
<!-- Included JS Files --> | <!-- Included JS Files --> |
<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script> | <script src="http://code.jquery.com/jquery-1.7.1.min.js"></script> |
<script type="text/javascript" src="<?php echo $basePath ?>js/flotr2/flotr2.js"></script> | <script type="text/javascript" src="<?php echo $basePath ?>js/flotr2/flotr2.js"></script> |
<?php | <?php |
if (strpos($_SERVER['SERVER_NAME'], ".gs")) { | if (strpos($_SERVER['SERVER_NAME'], ".gs")) { |
?> | ?> |
<script type="text/javascript"> | <script type="text/javascript"> |
var _gaq = _gaq || []; | var _gaq = _gaq || []; |
_gaq.push(['_setAccount', 'UA-12341040-2']); | _gaq.push(['_setAccount', 'UA-12341040-2']); |
_gaq.push(['_trackPageview']); | _gaq.push(['_trackPageview']); |
(function() { | (function() { |
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; | var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; |
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; | ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; |
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); | var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); |
})(); | })(); |
</script> | </script> |
</body> | </body> |
</html> | </html> |
<?php } | <?php } |
} | } |
<?php | |
include_once('include/common.inc.php'); | |
include_header('Open Gov Rankings'); | |
$db = $server->get_db('disclosr-agencies'); | |
?> | |
<div class="foundation-header"> | |
<h1><a href="about.php">Open Government Rankings</a></h1> | |
<h4 class="subheader"></h4> | |
</div> | |
<table> | |
<?php | |
$agenciesdb = $server->get_db('disclosr-agencies'); | |
//$docsdb = $server->get_db('disclosr-documents'); | |
$scoredagencies = Array(); | |
$scores = Array(); | |
$columnKeys = Array(); | |
try { | |
$rows = $agenciesdb->get_view("app", "all", null, true)->rows; | |
if ($rows) { | |
foreach ($rows as $row) { | |
$columns = Array(); | |
foreach ($row->value as $key => $value) { | |
if ((strstr($key, "has") || strstr($key, "URL")) && $key != "rtkURLs") { | |
//echo "$key<br>"; | |
$columns[$key] = $value; | |
} | |
} | |
//print_r(array_keys($columns)); | |
$columnKeys = array_unique(array_merge($columnKeys, array_keys($columns))); | |
//print_r($columnKeys); | |
$score = count($columns); | |
$scores[$score]++; | |
$scoredagencies[] = Array("id"=> $row->key, "website"=> $row->value->website, "name" => $row->value->name, "columns" => $columns, "score" => $score); | |
} | |
} | |
} catch (SetteeRestClientException $e) { | |
setteErrorHandler($e); | |
} | |
function cmp($a, $b) | |
{ | |
if ($a['score'] == $b['score']) { | |
return strcmp($a['name'], $b['name']); | |
} | |
return ($a['score'] > $b['score']) ? -1 : 1; | |
} | |
usort($scoredagencies, "cmp"); | |
echo "<tr>"; | |
echo "<th>Agency Name</th>"; | |
echo "<th>Score</th>"; | |
foreach ($columnKeys as $columnID) { | |
echo "<th>" . (isset($schemas['agency']["properties"][$columnID]['x-title']) ? $schemas['agency']["properties"][$columnID]['x-title'] : "<i>$columnID</i>") . "</th>"; | |
} | |
echo "</tr>"; | |
foreach ($scoredagencies as $scoredagency) { | |
echo "<tr>"; | |
echo "<td><b><a href='getAgency.php?id=" . $scoredagency['id'] . "'>". $scoredagency['name'] . "</a></b></td>"; | |
echo "<td><b>" . $scoredagency['score'] . "</b></td>"; | |
foreach ($columnKeys as $key) { | |
echo "<td style='text-align: center;'>"; | |
if (isset($scoredagency['columns'][$key])) { | |
$value = $scoredagency['columns'][$key]; | |
if (is_array($value)) { | |
if (count($value) == 1) { | |
$href = $value[0]; | |
} else { | |
$href = $value[0]; | |
} | |
} else { | |
$href = $value; | |
} | |
if ($href[0] == "@") { | |
$href = str_replace("@","https://twitter.com/",$href); | |
} | |
//$href= urlencode($href); | |
echo "<font color='lightgreen'>"; | |
if (strstr($href, "http")) { | |
echo "<a title='Yes' href='$href' style='color:lightgreen;'>✓</a>"; | |
} else { | |
echo "✓"; | |
} | |
echo "</font>"; | |
} else { | |
echo "<font color='orange'><abbr title='No'>✘</abbr></font>"; | |
} | |
echo "</td>"; | |
} | |
echo "</tr>\n"; | |
} | |
?> | |
</table><br> | |
<div id="criteria" style="width:500px;height:900px;"></div> | |
<div id="scores" style="width:900px;height:500px;"></div> | |
<script id="source"> | |
window.onload = function () { | |
$(document).ready(function () { | |
var d1 = []; | |
var scorelabels = []; | |
<?php | |
try { | |
$rows = $db->get_view("app", "scoreHas?group=true", null, true)->rows; | |
$dataValues = Array(); | |
foreach ($rows as $row) { | |
$dataValues[$row->value] = $row->key; | |
} | |
$i = 0; | |
ksort($dataValues); | |
foreach ($dataValues as $value => $key) { | |
echo " d1.push([$value, $i]);" . PHP_EOL; | |
echo " scorelabels.push('$key');" . PHP_EOL; | |
$i++; | |
} | |
} catch (SetteeRestClientException $e) { | |
setteErrorHandler($e); | |
} | |
?> | |
function scoretrackformatter(obj) { | |
if (scorelabels[Math.floor(obj.y)]) { | |
return (scorelabels[Math.floor(obj.y)]) + "=" + obj.x; | |
} else { | |
return ""; | |
} | |
} | |
function scoretickformatter(val, axis) { | |
if (scorelabels[Math.floor(val)]) { | |
return (scorelabels[Math.floor(val)]) ; | |
} else { | |
return ""; | |
} | |
} | |
Flotr.draw(document.getElementById("criteria"), [ | |
{data: d1} | |
], { | |
title: 'Total count of agencies with criteria', | |
HtmlText: true, | |
bars: { | |
show: true, | |
horizontal: true | |
}, | |
mouse: { | |
track: true, | |
relative: true, | |
trackFormatter: scoretrackformatter | |
}, yaxis: { | |
autoscaling: true, | |
minorTickFreq: 0.6, | |
noTicks: scorelabels.length, | |
tickFormatter: scoretickformatter | |
}, | |
xaxis: { | |
autoscaling: true | |
} | |
}); | |
var d2 = []; | |
<?php | |
try { | |
ksort($scores); | |
foreach ($scores as $key => $value) { | |
echo " d2.push([$key,$value]);" . PHP_EOL; | |
$i++; | |
} | |
} catch (SetteeRestClientException $e) { | |
setteErrorHandler($e); | |
} | |
?> | |
Flotr.draw(document.getElementById("scores"), [ | |
{data: d2} | |
], { | |
title: 'Frequency distribution of Scores', | |
HtmlText: true, | |
bars: { | |
show: true | |
}, | |
mouse: { | |
track: true, | |
relative: true | |
}, yaxis: { | |
autoscaling: true | |
}, | |
xaxis: { | |
autoscaling: true | |
} | |
}); | |
}); | |
}; | |
</script> | |
<?php | |
include_footer(); | |
?> | |