Prettier JQuery tables
Prettier JQuery tables

file:a/about.php -> file:b/about.php
--- a/about.php
+++ b/about.php
@@ -1,6 +1,55 @@
+<?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

 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

 ABR

 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();

+?>

--- a/admin/abr-example.php
+++ b/admin/abr-example.php

--- /dev/null
+++ b/admin/agency2portfolio.php
@@ -1,1 +1,42 @@
+<?php
 
+// Returns portfolio scraped live from directory.gov.au
+// or null if can't find a portfolio
+function agency2portfolio ($agency) {
+	static $cache = array();
+	if (isset($cache[$agency])) { return $cache[$agency]; }
+	$c = curl_init('http://www.directory.gov.au/searchres.php');
+	curl_setopt($c, CURLOPT_POST, true);
+	curl_setopt($c, CURLOPT_HEADER, false);
+	curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
+	curl_setopt($c, CURLOPT_REFERER, 'http://www.directory.gov.au/adsearch.php');
+	curl_setopt($c, CURLOPT_USERAGENT, 'Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3');
+	curl_setopt($c, CURLOPT_POSTFIELDS, array(
+		'advkeywordfield' => '',
+		'advorgunitfield' => $agency,
+		'advrolefield' => '',
+		'advsection' => 'All',
+		'advsurnamefield' => '',
+		'search' => 'Submit Query'
+	));
+	$results = curl_exec($c);
+	
+	if (preg_match('#<span\s+class="standardlinks"><a\s+href="([^"]+)">#smi', $results, $m)) {
+		$nextURL = $m[1];
+	} else {
+		$cache[$agency] = false; return false;
+	}
+	
+	curl_setopt($c, CURLOPT_URL, 'http://www.directory.gov.au' . $nextURL);
+	curl_setopt($c, CURLOPT_HTTPGET, true);
+	curl_setopt($c, CURLOPT_REFERER, 'http://www.directory.gov.au/searchres.php');
+	$results = curl_exec($c);
+	if (preg_match('#portfolios:\s+([^<]+)#ims', $results, $m)) {
+		$cache[$agency] = $m[1]; return $m[1];
+	} else {
+		$cache[$agency] = false; return false;
+	}
+}
+
+?>
+

 Binary files a/admin/cmd.exe.lnk and b/admin/cmd.exe.lnk differ
--- a/admin/convertToThematicMapping.php
+++ b/admin/convertToThematicMapping.php

--- /dev/null
+++ b/admin/displayRepresentatives.php
@@ -1,1 +1,7 @@
+SELECT representative_id,firstname,surname,party,house,division_id,	portfolio
+FROM portfolio2representative
+INNER JOIN representatives
+ON portfolio2representative.representative_id=representatives.id
+INNER JOIN portfolios
+ON portfolio2representative.portfolio_id=portfolios.id
 

--- /dev/null
+++ b/admin/displayUNSPSC.php
@@ -1,1 +1,25 @@
+<?php

+error_reporting(E_ALL);

+

+$link = mysql_connect('localhost', 'team7', 'wlUsnD2xu9');

+if (!$link) {

+    die('Could not connect: ' . mysql_error());

+}

+@mysql_select_db("team7") or die("Unable to select database");

+

+$unspscresult = mysql_query ("select * from UNSPSCcategories;");

+while ($row = mysql_fetch_assoc($unspscresult)) {

+	$unspsc[$row['UNSPSC']] = $row['Title'];

+}

+$catsresult = mysql_query ("SELECT LEFT( categoryUNSPSC, 2 ) as cat , SUM( value ) as value

+FROM `contractnotice`

+GROUP BY cat ;");

+echo "<table>";

+while ($row = mysql_fetch_assoc($catsresult)) {

+	$catName = $unspsc[$row['cat']."000000"].$row['cat'];

+	if ($row['cat'] = "") $catName = "null";

+	

+	echo "<tr><td>$catName</td><td>".$row['value']."</td></tr>";

+}

+?>

 

--- a/admin/google-example.htm
+++ b/admin/google-example.htm

--- a/admin/google-example.php
+++ b/admin/google-example.php

--- a/admin/import.bat
+++ b/admin/import.bat

--- a/admin/import.php
+++ b/admin/import.php
@@ -1,119 +1,113 @@
 <?php
-include_once("../lib/common.inc.php");
-$path = '../data/';
-if ($_REQUEST["fname"] == "") {
-echo "Get files from: https://www.tenders.gov.au/?event=public.reports.list<br>";
-$dhandle = opendir($path);
-// define an array to hold the files
-$files = array();
-
-if ($dhandle) {
-   // loop through all of the files
-   while (false !== ($fname = readdir($dhandle))) {
-      if (($fname != '.') && ($fname != '..')) {
-	  echo "<a href=\"import.php?fname=$fname\">$fname</a>".filesize($path.$fname)."<br/>";
-	  }
-	}
-}
-
-} else {
-$success =0;
-$fname = $_REQUEST["fname"];
-echo " ============== $fname  ============== <br>";
-$row = 1;
-$handle = fopen($path.$fname, "r"); 
-//"t" mode string translates windows line breaks to unix
-$datamapping0709 = Array("Agency" => "agencyName", "Parent CN ID" => "parentCN", "CN ID" => "CNID", "Publish Date" => "publishDate", "Amendment Date" => "amendDate", "Status" => "", "StartDate" => "contractStart" , "EndDate" => "contractEnd", "Value" => "value", "Description" => "description",  "Agency Ref Id" => "agencyID", "Category" => "category", "Procurement Method" => "procurementMethod", "ATM ID" => "atmID", "SON ID" => "SONID","Confidentiality - Contract" => "confidentialityContract", "Confidentiality - Contract Reason(s)" => "confidentialityContractReason", "Confidentiality - Outputs" => "confidentialityOutputs", "Confidentiality - Outputs Reason(s)" => "confidentialityOutputsReason", "Consultancy" => "consultancy", "Consultancy Reason(s)" => "consultancyReason", "Amendment Reason" => "amendmentReason",  "Supplier Name" => "supplierName", "Supplier Address" => "supplierAddress", "Supplier City" => "supplierCity", "Supplier Postcode" => "supplierPostcode", "Supplier Country" => "supplierCountry" , "Supplier ABNExempt" => "supplierABNExempt", "Supplier ABN" => "supplierABN" , "Agency Branch" => "contactBranch","Agency Divison" => "contactDivision", "Agency Postcode" => "contactPostcode" , "" => "");
-$headers;
-$contractNoticeFields = Array("agencyName",  "parentCN", "CNID", "publishDate",  "amendDate", "contractStart" , "contractEnd", "value", "description",   "agencyID",  "category", "procurementMethod", "atmID", "SONID", "confidentialityContract", "confidentialityContractReason", "confidentialityOutputs", "confidentialityOutputsReason", "consultancy", "consultancyReason",  "amendmentReason",  "supplierName", "supplierAddress", "supplierCity",  "supplierPostcode",  "supplierCountry" , "supplierABNExempt",  "supplierABN", "contactBranch","contactDivision","contactPostcode" );
-$agencyFields = Array("agencyName");
-$supplierFields = Array("supplierName", "supplierAddress", "supplierCity",  "supplierPostcode",  "supplierCountry" , "supplierABNExempt",  "supplierABN" );
-
-while (($data = fgetcsv($handle, 1000, "\t")) !== FALSE) {
-    $num = count($data);
-
-	if ($row == 3)
-	{
-	$headers = $data;
-	}
-	else if ($row > 3)
-	{
-			if ($num > count($datamapping0709))
-		{
-		die ("<font color=red>Error in data import; data mapping fields out of bounds or changed</font><br>".$fname.print_r($data));
-		}
-	$firstCN= false;
-    $firstSupplier= true;
-    $firstAgency= true;
-    $contractNoticeInsert = "INSERT INTO contractnotice (importFile, ".implode(" , ",$contractNoticeFields). ") VALUES ( \"$fname\" ";
-    $supplierInsert = "INSERT INTO supplierdetails (".implode(" , ",$supplierFields). ") VALUES (";
-    $agencyInsert = "INSERT INTO agency (".implode(" , ",$agencyFields). ") VALUES (";
-	
-	$keys = array_keys($datamapping0709);
-    for ($c=0; $c < $num; $c++) {
-	$data[$c] = trim($data[$c],"=");
-	$data[$c] = trim($data[$c], "\"");
-	
-	if (in_array(($datamapping0709[$headers[$c]]),$contractNoticeFields))
-	{
-	if (($datamapping0709[$headers[$c]]) == "parentCN" || ($datamapping0709[$headers[$c]]) == "CNID")
-	{
-		$data[$c] = substr($data[$c],2);
-		if ($data[$c] >0)
-		{
-		$contractNoticeInsert .= ($firstCN ? "" : ","). mysql_real_escape_string($data[$c]);
-		} else
-		{
-		$contractNoticeInsert .= ($firstCN ? "" : ",")."''";
-		}
-	} else 	if (($datamapping0709[$headers[$c]]) == "amendDate" || ($datamapping0709[$headers[$c]]) == "publishDate" || ($datamapping0709[$headers[$c]]) == "contractStart" || ($datamapping0709[$headers[$c]]) == "contractEnd")
-	{
-		$contractNoticeInsert .= ($firstCN ? "" : ","). "'".date( 'Y-m-d H:i:s', strtotime($data[$c])). "'";
-	} else
-	{
-		if (strstr("\" =",$data[$c] > 0))
-			{
-				die ("Invalid Description field" . $contractNoticeInsert); 
-			}
-        $contractNoticeInsert .= ($firstCN ? "" : ",") .  "'". mysql_real_escape_string($data[$c])."'";
-		
-		}
-		$firstCN = false;
-    }
-		if (in_array(($datamapping0709[$headers[$c]]),$supplierFields))
-	{
-        $supplierInsert .= ($firstSupplier ? "" : ",") .  "'". mysql_real_escape_string($data[$c])."'";
-		$firstSupplier = false;
-    }
-			if (in_array(($datamapping0709[$headers[$c]]),$agencyFields))
-	{
-        $agencyInsert .= ($firstAgency ? "" : ",") .  "'". mysql_real_escape_string($data[$c])."'";
-		$firstAgency = false;
-    }
-	
-	}
-	$contractNoticeInsert .= ");";
-	$supplierInsert .= ");";
-	$agencyInsert .= ");";
-	
-$result = mysql_query($contractNoticeInsert);
-if ($result) $success++;
-else echo $data[2] . " failed CN insert.<br>". mysql_error() ." <br>  $contractNoticeInsert <br><br>\n";
-	
-	//$result = mysql_query($agencyInsert);
-if ($result) $success++;
-else echo $data[2] . " failed agency insert.<br>". mysql_error() ." <br> $agencyInsert <br><br>\n";
-	
-	$result = mysql_query($supplierInsert);
-if ($result) $success++;
-else echo $data[2] . " failed supplier insert.<br>". mysql_error() ." <br> $supplierInsert <br><br>\n";
-
-echo "<hr>\n";
-	}
-	
-    $row++;
-}
-echo "<br> $success records successfully created";
-fclose($handle);
-}
+  include_once("../lib/common.inc.php");
+  $path = 'data/';
+  if ($_REQUEST["fname"] == "") {
+      echo "Get files from: https://www.tenders.gov.au/?event=public.reports.list<br>";
+      $dhandle = opendir($path);
+      // define an array to hold the files
+      $files = array();
+      
+      if ($dhandle) {
+          // loop through all of the files
+          while (false !== ($fname = readdir($dhandle))) {
+              if (($fname != '.') && ($fname != '..')) {
+                  echo "<a href=\"import.php?fname=$fname\">$fname</a>" . filesize($path . $fname) . "<br/>";
+              }
+          }
+      }
+  } else {
+      $success = 0;
+      $fname = $_REQUEST["fname"];
+      echo " ============== $fname  ============== <br>";
+      flush();
+      $row = 1;
+      $handle = fopen($path . $fname, "r");
+      //"t" mode string translates windows line breaks to unix
+      $datamapping0709 = array("Agency" => "agencyName", "Parent CN ID" => "parentCN", "CN ID" => "CNID", "Publish Date" => "publishDate", "Amendment Date" => "amendDate", "Status" => "", "StartDate" => "contractStart", "EndDate" => "contractEnd", "Value" => "value", "Description" => "description", "Agency Ref Id" => "agencyID", "Category" => "category", "Procurement Method" => "procurementMethod", "ATM ID" => "atmID", "SON ID" => "SONID", "Confidentiality - Contract" => "confidentialityContract", "Confidentiality - Contract Reason(s)" => "confidentialityContractReason", "Confidentiality - Outputs" => "confidentialityOutputs", "Confidentiality - Outputs Reason(s)" => "confidentialityOutputsReason", "Consultancy" => "consultancy", "Consultancy Reason(s)" => "consultancyReason", "Amendment Reason" => "amendmentReason", "Supplier Name" => "supplierName", "Supplier Address" => "supplierAddress", "Supplier City" => "supplierCity", "Supplier Postcode" => "supplierPostcode", "Supplier Country" => "supplierCountry", "Supplier ABNExempt" => "supplierABNExempt", "Supplier ABN" => "supplierABN", "Agency Branch" => "contactBranch", "Agency Divison" => "contactDivision", "Agency Postcode" => "contactPostcode", "" => "");
+      $headers;
+      $contractNoticeFields = array("agencyName", "parentCN", "CNID", "publishDate", "amendDate", "contractStart", "contractEnd", "value", "description", "agencyID", "category", "procurementMethod", "atmID", "SONID", "confidentialityContract", "confidentialityContractReason", "confidentialityOutputs", "confidentialityOutputsReason", "consultancy", "consultancyReason", "amendmentReason", "supplierName", "supplierAddress", "supplierCity", "supplierPostcode", "supplierCountry", "supplierABNExempt", "supplierABN", "contactBranch", "contactDivision", "contactPostcode");
+      $agencyFields = array("agencyName");
+      $supplierFields = array("supplierName", "supplierAddress", "supplierCity", "supplierPostcode", "supplierCountry", "supplierABNExempt", "supplierABN");
+      
+      while (($data = fgetcsv($handle, 1000, "\t")) !== false) {
+          $num = count($data);
+          
+          if ($row == 3) {
+              $headers = $data;
+          } elseif ($row > 3) {
+              if ($num > count($datamapping0709)) {
+                  die("<font color=red>Error in data import; data mapping fields out of bounds or changed</font><br>" . $fname . print_r($data));
+              }
+              $firstCN = false;
+              $firstSupplier = true;
+              $firstAgency = true;
+              $contractNoticeInsert = "INSERT INTO contractnotice (importFile, " . implode(" , ", $contractNoticeFields) . ") VALUES ( \"$fname\" ";
+              $supplierInsert = "INSERT INTO supplierdetails (" . implode(" , ", $supplierFields) . ") VALUES (";
+              $agencyInsert = "INSERT INTO agency (" . implode(" , ", $agencyFields) . ") VALUES (";
+              
+              $keys = array_keys($datamapping0709);
+              for ($c = 0; $c < $num; $c++) {
+                  $data[$c] = trim($data[$c], "=");
+                  $data[$c] = trim($data[$c], "\"");
+                  
+                  if (in_array(($datamapping0709[$headers[$c]]), $contractNoticeFields)) {
+                      if (($datamapping0709[$headers[$c]]) == "parentCN" || ($datamapping0709[$headers[$c]]) == "CNID") {
+                          $data[$c] = substr($data[$c], 2);
+                          if ($data[$c] > 0) {
+                              $contractNoticeInsert .= ($firstCN ? "" : ",") . mysql_real_escape_string($data[$c]);
+                          } else {
+                              $contractNoticeInsert .= ($firstCN ? "" : ",") . "''";
+                          }
+                      } elseif (($datamapping0709[$headers[$c]]) == "amendDate" || ($datamapping0709[$headers[$c]]) == "publishDate" || ($datamapping0709[$headers[$c]]) == "contractStart" || ($datamapping0709[$headers[$c]]) == "contractEnd") {
+                          $contractNoticeInsert .= ($firstCN ? "" : ",") . "'" . date('Y-m-d H:i:s', strtotime($data[$c])) . "'";
+                      } else {
+                          if (strstr("\" =", $data[$c] > 0)) {
+                              die("Invalid Description field" . $contractNoticeInsert);
+                          }
+                          $contractNoticeInsert .= ($firstCN ? "" : ",") . "'" . mysql_real_escape_string($data[$c]) . "'";
+                      }
+                      $firstCN = false;
+                  }
+                  if (in_array(($datamapping0709[$headers[$c]]), $supplierFields)) {
+                      $supplierInsert .= ($firstSupplier ? "" : ",") . "'" . mysql_real_escape_string($data[$c]) . "'";
+                      $firstSupplier = false;
+                  }
+                  if (in_array(($datamapping0709[$headers[$c]]), $agencyFields)) {
+                      $agencyInsert .= ($firstAgency ? "" : ",") . "'" . mysql_real_escape_string($data[$c]) . "'";
+                      $firstAgency = false;
+                  }
+              }
+              flush();
+              $contractNoticeInsert .= ");";
+              $supplierInsert .= ");";
+              $agencyInsert .= ");";
+              
+              $result = mysql_query($contractNoticeInsert);
+              if ($result)
+                  $success++;
+              elseif (strpos(mysql_error(), "Duplicate entry") === false)
+                  echo $data[2] . " failed CN insert.<br>" . mysql_error() . " <br>  $contractNoticeInsert <br><br>\n";
+              
+              $result = mysql_query($agencyInsert);
+              if ($result)
+                  $success++;
+              elseif (strpos(mysql_error(), "Duplicate entry") === false)
+                  echo $data[2] . " failed agency insert.<br>" . mysql_error() . " <br> $agencyInsert <br><br>\n";
+              
+              $result = mysql_query($supplierInsert);
+              if ($result)
+                  $success++;
+              elseif (strpos(mysql_error(), "Duplicate entry") === false)
+                  echo $data[2] . " failed supplier insert.<br>" . mysql_error() . " <br> $supplierInsert <br><br>\n";
+              flush();
+              
+              //echo "<hr>\n";
+          }
+          
+          $row++;
+      }
+      echo "<br> $success records successfully created";
+      flush();
+      fclose($handle);
+  }
 ?>

--- a/admin/linkAmendments.php
+++ b/admin/linkAmendments.php

--- a/admin/recordsperweek.txt
+++ b/admin/recordsperweek.txt

--- a/admin/setAgencyStatus.php
+++ b/admin/setAgencyStatus.php
@@ -1,16 +1,24 @@
 <?php
 include_once("../lib/common.inc.php");
 
-$active = Array('Administrative Appeals Tribunal','Aged Care Standards and Accreditation Agency Ltd','Airservices Australia','Attorney-General\'s Department','Auditing and Assurance Standards Board','AusAid','Austrade','Australia Council for the Arts','Australian Accounting Standards Board','Australian Antarctic Division','Australian Broadcasting Corporation','Australian Bureau of Statistics','Australian Centre for International Agricultural Research','Australian Commission for Law Enforcement Integrity','Australian Communications and Media Authority (ACMA)','Australian Competition and Consumer Commission','Australian Crime Commission','Australian Customs Service','Australian Electoral Commission','Australian Fair Pay Commission','Australian Federal Police','Australian Film Commission','Australian Film Television and Radio School','Australian Fisheries Management Authority','Australian Hearing Services','Australian Industrial Registry','Australian Institute of Aboriginal and Torres Strait Islander Studies (AIATSIS)','Australian Institute of Criminology','Australian Institute of Family Studies','Australian Institute of Health and Welfare','Australian Institute of Marine Science','Australian Law Reform Commission','Australian Maritime Safety Authority','Australian National Audit Office (ANAO)','Australian National Maritime Museum','Australian Nuclear Science and Technology Organisation (ANSTO)','Australian Office of Financial Management','Australian Organ and Tissue Donation and Transplantation Authority','Australian Pesticides and Veterinary Medicines Authority','Australian Prudential Regulation Authority (APRA)','Australian Public Service Commission','Australian Radiation Protection and Nuclear Safety Agency (ARPANSA)','Australian Research Council','Australian Reward Investment Alliance (ARIA)','Australian Securities and Investments Commission','Australian Security Intelligence Organisation','Australian Sports Anti-Doping Authority (ASADA)','Australian Taxation Office','Australian Transaction Reports and Analysis Centre (AUSTRAC)','Australian Transport Safety Bureau','Australian War Memorial','Biosecurity Australia','Bureau of Meteorology','Cancer Australia','Centrelink','Civil Aviation Safety Authority','Comcare','Commonwealth Grants Commission','Comsuper','Corporations and Markets Advisory Committee','Crimtrac','CRS Australia','CSIRO','Defence Housing Australia','Defence Materiel Organisation','Department of Agriculture, Fisheries and Forestry','Department of Broadband, Communications and the Digital Economy','Department of Climate Change','Department of Defence','Department of Education, Employment and Workplace Relations','Department of Families, Housing, Community Services and Indigenous Affairs','Department of Finance and Deregulation','Department of Foreign Affairs and Trade','Department of Health and Ageing','Department of Human Services','Department of Immigration & Citizenship','Department of Infrastructure, Transport, Regional Development and Local Government','Department of Innovation, Industry, Science and Research','Department of Parliamentary Services','Department of Resources, Energy and Tourism','Department of the Environment, Water, Heritage and the Arts','Department of the House of Representatives','Department of the Prime Minister and Cabinet','Department of the Senate','Department of the Treasury','Department of Veterans\' Affairs','Director of National Parks','Emergency Management Australia','Equal Opportunity for Women in the Workplace Agency','Export Finance and Insurance Corporation (EFIC)','Fair Work Australia','Family Court of Australia','Federal Court of Australia','Federal Magistrates Court','Future Fund Management Agency','Geoscience Australia','Grains Research and Development Corporation','Great Barrier Reef Marine Park Authority','Human Rights and Equal Opportunity Commission','Insolvency and Trustee Service Australia (ITSA)','Inspector-General of Taxation','IP Australia','Land and Water Australia','Medicare Australia','Migration Review Tribunal and Refugee Review Tribunal (MRT-RRT)','Murray-Darling Basin Authority','National Archives of Australia','National Blood Authority','National Capital Authority','National Competition Council','National Film and Sound Archive','National Gallery of Australia','National Health and Medical Research Council','National Library of Australia','National Museum of Australia','National Native Title Tribunal','National Offshore Petroleum Safety Authority','National Water Commission','Office of National Assessments','Office of Parliamentary Counsel','Office of the Australian Building and Construction Commissioner (ABCC)','Office of the Commonwealth Ombudsman','Office of the Director of Public Prosecutions','Office of the Fair Work Ombudsman','Office of the Inspector-General of Intelligence and Security','Office of the Official Secretary to the Governor-General','Office of the Privacy Commissioner','Office of the Renewable Energy Regulator','Old Parliament House','Private Health Insurance Ombudsman','Productivity Commission','Professional Services Review','Questacon','Reserve Bank of Australia','Royal Australian Mint','Seacare','Social Security Appeals Tribunal','Sydney Harbour Federation Trust','Therapeutic Goods Administration','Tourism Australia','Workplace Authority','Workplace Ombudsman');
+$active = Array('0EC8D805-C293-3ADD-E51A93667D977314|Administrative Appeals Tribunal','0ECAA17D-9862-5309-101D94A126495C7F|Aged Care Standards and Accreditation Agency Ltd','CE45735B-F9FC-04DA-F299C730D9BE613E|Airservices Australia','0EC8DF71-ED98-8593-2D776EE93D9BA248|Attorney-General\'s Department','0ECA6B4C-DE4F-A04A-DBFB5F39B050B6D7|AusAid','0ECA6F64-F6B8-F406-E490A1479A7A717B|Austrade','D2724D99-F230-A93A-93D62A8DCC187940|Australia Council for the Arts','D26C4D0A-FF6E-612A-C6FEDB2D5E71AE4A|Australian Antarctic Division','C8E854CD-E966-9A35-078FF6702EC1ECED|Australian Broadcasting Corporation','0ECB50CF-028A-FB9D-3E5EF0F9708E4BC7|Australian Bureau of Statistics','0ECA671F-EA1F-8560-1D7C90408694B565|Australian Centre for International Agricultural Research','A861A42C-B32C-85A8-0F719005E27F4E23|Australian Commission for Law Enforcement Integrity','C8F9DAF8-9763-EA22-FA44B6BBC12B0B94|Australian Communications and Media Authority (ACMA)','0ECB2BB9-B19C-4929-87EC63542388D079|Australian Competition and Consumer Commission','0EC8E42E-EB6A-15DA-3F001AFB9C2B8D34|Australian Crime Commission','0EC8E8CE-9BCF-0651-D4362CF53DB8E4DC|Australian Customs and Border Protection Service','CD51BCA4-9DC7-9494-B7D944029D03A1F9|Australian Electoral Commission','D248626B-0BDD-B201-1A1C7C978AD973D2|Australian Fair Pay Commission','0EC8EDF3-E025-2F80-AEB39B350641C81F|Australian Federal Police','0EC8B90B-CBF5-8EC4-2C4E261041A25E16|Australian Fisheries Management Authority','0ECABD48-0388-F8AB-00BD4EB12FA44067|Australian Hearing Services','0EC920D5-CEB1-81FC-5A107A206F4A6BF3|Australian Human Rights Commission','D257B064-D245-51CC-F69A50FF4620915B|Australian Industrial Registry','0EC8F7B1-03ED-C4C3-70FBDF105ADB2FB6|Australian Institute of Criminology','D32EC07E-E22E-5805-1240CF68033C5E15|Australian Institute of Family Studies','0ECA9D77-A0B8-448A-53945B4DFACEE685|Australian Institute of Health and Welfare','D31CF0E2-B1A4-DE74-5D7B7B1DC97EA1DC|Australian Institute of Marine Science','0EC8FC41-C1BE-587A-A19920F43BA616BF|Australian Law Reform Commission','CE5DCAA3-D793-2FEE-B3C263B84AF2676C|Australian Maritime Safety Authority','0ECAED96-0B3B-1D24-56412EC3384996B0|Australian National Audit Office (ANAO)','D281D726-938C-D76D-A346348BEFC509F9|Australian National Maritime Museum','D31E738F-F139-2BC2-EBF2764D7812EA10|Australian Nuclear Science and Technology Organisation (ANSTO)','0ECB3D20-C837-FBE2-B1C32937F87CBB8F|Australian Office of Financial Management','82C5CFA1-0088-7B9E-9A3EF95987B55045|Australian Organ and Tissue Donation and Transplantation Authority','0EC8BF2B-B23F-0A07-0659BB9760EFC94E|Australian Pesticides and Veterinary Medicines Authority','0ECB5AFF-F4DC-06E3-97B3118B978F33BD|Australian Prudential Regulation Authority (APRA)','0ECAF18D-044A-0F5E-AD942B0CD5BB1ACC|Australian Public Service Commission','0ECA88C8-B803-ECE2-00F37CE4797C74BC|Australian Radiation Protection and Nuclear Safety Agency (ARPANSA)','D320882B-ED70-8061-6A5B2F8E64D6F575|Australian Research Council','CD5A2434-9592-2217-49970AF89E5956F8|Australian Reward Investment Alliance (ARIA)','0ECB44F1-BC3B-58E0-96CD33517E10E38B|Australian Securities and Investments Commission','0EC9056F-C13F-ED84-07B410D54C4A1013|Australian Security Intelligence Organisation','D303A5DD-B83B-EC45-588E3680B4E842E4|Australian Sports Anti-Doping Authority (ASADA)','0ECB54CA-EE15-8B26-3C430607E8DB3D4E|Australian Taxation Office','0EC900DB-D645-6C40-DD8BEA03CC15D392|Australian Transaction Reports and Analysis Centre (AUSTRAC)','77068F86-0A15-723A-C2FC1601C44FFCD2|Australian Transport Safety Bureau','0EC9AC89-DEB3-1441-2441891A3772863E|Australian War Memorial','D28B4F07-C2F2-2D4F-1C9229D177088373|Bureau of Meteorology','0ECA90FE-A44B-2EAA-08039CC6C43E728D|Cancer Australia','0ECAB1CF-D480-0C8B-70670DFC4FFDAC56|Centrelink','CE608086-A4DC-45F6-1179DCC148CF91F7|Civil Aviation Safety Authority','D24AFCAC-A2B2-4766-17C9A3EC3AAE4205|Comcare','166B9AD2-ACC9-B56F-4D5B47BD325DEB25|Commonwealth Grants Commission','CD5BDE89-9805-D921-0DAAFDBD5312D0D5|Comsuper','0ECB5EF6-CC7B-7C8E-32798557B78F6D98|Corporations and Markets Advisory Committee','0EC909FF-D902-5FD3-6660ADB353470F95|Crimtrac','0ECAC700-BDE8-458D-6A4E91C8B151A270|CRS Australia','D3275762-D634-4459-D33A26E1BEA05D14|CSIRO','0EC99E6C-0375-2DAF-A8338121FCBD6F7A|Defence Housing Australia','0EC9A29C-E478-AD19-3F0F29F6BE4914BF|Defence Materiel Organisation','0EC892FD-E156-BCB0-ADF5D534E584BC18|Department of Agriculture, Fisheries and Forestry','FB2B0C69-0AAF-1B2B-8186EC38772F8FC1|Department of Broadband, Communications and the Digital Economy','69368049-A8EF-0896-EA9C603C856788D9|Department of Climate Change and Energy Efficiency','0EC98EF9-E020-5DA9-DCB10135BE81BD2B|Department of Defence','D23E9B50-DAE3-6701-D90A2582EE48A4DA|Department of Education, Employment and Workplace Relations','D2FBF89C-D43D-4B3E-527132AC0D41ABBB|Department of Families, Housing, Community Services and Indigenous Affairs','CD39DC0D-D4B3-DFEC-DDDCD52E651F06EA|Department of Finance and Deregulation','0ECA5FC9-A4AD-0A3A-97A8DD3FD9D44CB1|Department of Foreign Affairs and Trade','0ECA80C0-EC9F-B5B9-0D3E8A4537C39808|Department of Health and Ageing','0ECAADBC-B488-A53B-F4F6672EC813849A|Department of Human Services','0ECB6A9B-BA91-CB7D-36C62C5C9191D403|Department of Immigration & Citizenship','047091E8-CEE4-A9FF-BF552F538D279807|Department of Infrastructure and Transport','FADB0367-F000-E0B9-8F79FD109F613AB6|Department of Innovation, Industry, Science and Research','0ECB7ED8-BB19-D108-324A8A05B1966ABF|Department of Parliamentary Services','2F03BD8D-F73D-C35C-729559C6C70C6602|Department of Regional Australia, Regional Development and Local Government','FADFD268-9BF5-97E4-2F247B92F74E82C0|Department of Resources, Energy and Tourism','62304115-AA13-68D1-592110A8021DA68E|Department of Sustainability, Environment, Water, Population and Communities','0ECB8490-9B07-1898-98170CDD42A9DFF7|Department of the House of Representatives','0ECAE795-F858-203D-FD1C9FF933EF4A37|Department of the Prime Minister and Cabinet','0ECB8A6E-B354-715B-C9DEDE4A6DA3C393|Department of the Senate','0ECB25C0-02C3-6BAA-4738951514F489A9|Department of the Treasury','0EC9A85E-BA37-0A60-47A828CD70D831FC|Department of Veterans\' Affairs','D2E272D5-DDD0-178B-F1BE5A9181D3ACAE|Director of National Parks','D2F85A2B-E563-118E-0CB302E02C74397C|Equal Opportunity for Women in the Workplace Agency','0ECA73FA-FAAD-62B5-48581DF753E57CCA|Export Finance and Insurance Corporation (EFIC)','A535F827-E58E-89FB-7F58107CBBD0D79A|Fair Work Australia','0EC91301-C770-6470-480E879920826ABD|Family Court of Australia','0EC91799-A81B-262C-CE6ACAB2622F0566|Federal Court of Australia','0EC91C3C-BB6B-97BF-76BEF63DD0905AAF|Federal Magistrates Court','08355C10-AB46-67AA-421E334D1B45E125|Food Standards Australia New Zealand','CD5E362E-A615-1102-67814B74731025AD|Future Fund Management Agency','D33926C6-BB30-4A30-3A29A5821CFB7AE6|Geoscience Australia','0EC8CA07-AE70-7EB2-5A174487D4BD6236|Grains Research and Development Corporation','D2E5D48D-08A4-5CC9-5378FEA3CD8E649C|Great Barrier Reef Marine Park Authority','0EC925CD-F184-26AF-DE8A84DE3CBA3790|Insolvency and Trustee Service Australia (ITSA)','0ECB302F-AADD-2BB1-392F50E0E94CB