add RTK import
add RTK import


Former-commit-id: a6b6a0a350cf467915ec023c9e41421df3fcb83d

  <?php
 
  require_once '../include/common.inc.php';
 
  $db = $server->get_db('disclosr-agencies');
  $rows = $db->get_view("app", "byName")->rows;
  $nametoid = Array();
  $accounts = Array();
  foreach ($rows as $row) {
  $nametoid[trim($row->key)] = $row->value;
  }
 
  function extractCSVAccounts($url, $nameField, $accountField, $filter) {
  global $accounts, $nametoid;
  $request = Requests::get($url);
  echo $url;
  $Data = str_getcsv($request->body, "\n"); //parse the rows
  $headers = Array();
  foreach ($Data as $num => $line) {
  $Row = str_getcsv($line, ",");
  if ($num == 0) {
  $headers = $Row;
  print_r($headers);
  } else {
  if (isset($Row[array_search($nameField, $headers)])) {
  $agencyName = $Row[array_search($nameField, $headers)];
  if (!in_array(trim($agencyName), array_keys($nametoid))) {
  echo "$agencyName missing" . PHP_EOL;
  } else {
  echo $Row[array_search($nameField, $headers)] . PHP_EOL;
  $accounts[$nametoid[trim($agencyName)]]["rtkURLs"][$agencyName] = 'http://www.righttoknow.org.au/body/'.$Row[array_search($accountField, $headers)];
  }
  } else {
  echo "error finding any agency" . $line . PHP_EOL;
  }
  }
  }
  }
 
  extractCSVAccounts("http://www.righttoknow.org.au/body/all-authorities.csv","Agency","URL name");
  print_r($accounts);
  /* foreach ($accounts as $id => $accountTypes) {
  echo $id . "<br>" . PHP_EOL;
  $doc = object_to_array($db->get($id));
  // print_r($doc);
 
  foreach ($accountTypes as $accountType => $accounts) {
  if (!isset($doc["has" . $accountType]) || !is_array($doc["has" . $accountType])) {
  $doc["has" . $accountType] = Array();
  }
  $doc["has" . $accountType] = array_unique(array_merge($doc["has" . $accountType], $accounts));
  }
  $db->save($doc);
  }*/
  ?>
 
   
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"> "http://www.w3.org/TR/html4/loose.dtd">
<html> <html>
<head> <head>
<title>Demo of the tree layout in D3.js</title> <title>Demo of the tree layout in D3.js</title>
<!-- source: http://blog.pixelingene.com/demos/d3_tree/ <!-- source: http://blog.pixelingene.com/demos/d3_tree/
http://javadude.wordpress.com/2012/06/20/d3-js-from-tree-to-cluster-and-radial-projection/ http://javadude.wordpress.com/2012/06/20/d3-js-from-tree-to-cluster-and-radial-projection/
http://bl.ocks.org/1249394--> http://bl.ocks.org/1249394-->
<style> <style>
g.node { g.node {
font-family: Verdana, Helvetica; font-family: Verdana, Helvetica;
font-size: 12px; font-size: 12px;
font-weight: bold; font-weight: bold;
} }
circle.node-dot { circle.node-dot {
fill: lightsalmon; fill: lightsalmon;
stroke: red; stroke: red;
stroke-width: 1px; stroke-width: 1px;
} }
   
path.link { path.link {
fill: none; fill: none;
stroke: gray; stroke: gray;
} }
</style> </style>
</head> </head>
<body> <body>
   
<div id="tree-container"></div> <div id="tree-container"></div>
<div id="viz"></div> <div id="viz"></div>
   
<script type="text/javascript" src="../javascripts/jquery-1.6.2.min.js"></script> <script type="text/javascript" src="../js/jquery-1.6.2.min.js"></script>
<script type="text/javascript" src="../javascripts/d3.min.js"></script> <script type="text/javascript" src="../js/d3.min.js"></script>
<script type="text/javascript" src="../javascripts/d3.layout.min.js"></script> <script type="text/javascript" src="../js/d3.layout.min.js"></script>
   
<script> <script>
/** /**
* Created by JetBrains RubyMine. * Created by JetBrains RubyMine.
* User: pavanpodila * User: pavanpodila
* Date: 7/17/11 * Date: 7/17/11
* Time: 4:30 PM * Time: 4:30 PM
* To change this template use File | Settings | File Templates. * To change this template use File | Settings | File Templates.
*/ */
   
var treeData = var treeData =
<?php <?php
// $json = file_get_children('naa-agift.json'); // $json = file_get_children('naa-agift.json');
// $raw = json_decode($json); // $raw = json_decode($json);
// echo $json; // echo $json;
// print_r($raw); // print_r($raw);
$raw = json_decode('[ $raw = json_decode('[
"Home", "Home",
"index.htm", "index.htm",
[ [
"BUSINESS SUPPORT AND REGULATION", "BUSINESS SUPPORT AND REGULATION",
"000411.htm", "000411.htm",
[ [
"Association registration", "Association registration",
"000396.htm" "000396.htm"
], ],
[ [
"Business process auditing", "Business process auditing",
"000413.htm" "000413.htm"
], ],
[ [
"Business registration and licensing", "Business registration and licensing",
"000414.htm" "000414.htm"
], ],
[ [
"Business sponsorship", "Business sponsorship",
"001371.htm" "001371.htm"
], ],
[ [
"Consumer protection", "Consumer protection",
"000439.htm" "000439.htm"
], ],
[ [
"Fair trading compliance", "Fair trading compliance",
"000482.htm", "000482.htm",
[ [
"Prices surveillance", "Prices surveillance",
"000533.htm" "000533.htm"
], ],
[ [
"Product safety", "Product safety",
"000534.htm" "000534.htm"
], ],
[ [
"Trade practices compliance", "Trade practices compliance",
"000583.htm" "000583.htm"
] ]
], ],
[ [
"Financial institutions regulation", "Financial institutions regulation",
"000485.htm" "000485.htm"
], ],
[ [
"Government procurement regulation", "Government procurement regulation",
"000491.htm" "000491.htm"
], ],
[ [
"Industry assistance schemes", "Industry assistance schemes",
"000499.htm" "000499.htm"
], ],
[ [
"Industry development", "Industry development",
"000500.htm" "000500.htm"
], ],
[ [
"Insurance regulation", "Insurance regulation",
"000501.htm", "000501.htm",
[ [
"General insurance", "General insurance",
"000489.htm" "000489.htm"
], ],
[ [
"Life insurance", "Life insurance",
"000505.htm" "000505.htm"
] ]
], ],
[ [
"Professional accreditation", "Professional accreditation",
"000535.htm" "000535.htm"
], ],
[ [
"Small business services", "Small business services",
"000565.htm", "000565.htm",
[ [
"Small business advocacy", "Small business advocacy",
"000563.htm" "000563.htm"
], ],
[ [
"Small business development", "Small business development",
"000564.htm" "000564.htm"
] ]
], ],
[ [
"Stock market regulation", "Stock market regulation",
"000572.htm" "000572.htm"
] ]
], ],
[ [
"CIVIC INFRASTRUCTURE", "CIVIC INFRASTRUCTURE",
"000424.htm", "000424.htm",
[ [
"Civic management", "Civic management",
"000425.htm", "000425.htm",
[ [
"Architectural services", "Architectural services",
"000387.htm" "000387.htm"
], ],
[ [
"Building approval services", "Building approval services",
"000406.htm" "000406.htm"
], ],
[ [
"Building regulations and standards", "Building regulations and standards",
"000408.htm" "000408.htm"
], ],
[ [
"Engineering services", "Engineering services",
"000477.htm" "000477.htm"
], ],
[ [
"Town planning", "Town planning",
"000582.htm" "000582.htm"
] ]
], ],
[ [
"Energy supply", "Energy supply",
"000476.htm" "000476.htm"
], ],
[ [
"Integrated services planning", "Integrated services planning",
"000503.htm" "000503.htm"
], ],
[ [
"Public housing", "Public housing",
"000536.htm", "000536.htm",
[ [
"Public housing construction", "Public housing construction",
"000537.htm" "000537.htm"
], ],
[ [
"Public housing design", "Public housing design",
"000538.htm" "000538.htm"
], ],
[ [
"Public housing maintenance", "Public housing maintenance",
"000540.htm" "000540.htm"
] ]
], ],
[ [
"Public land management", "Public land management",
"000541.htm", "000541.htm",
[ [
"Burial ground management", "Burial ground management",
"000410.htm" "000410.htm"
], ],
[ [
"Cultural centre management", "Cultural centre management",
"000444.htm" "000444.htm"
], ],
[ [
"Garden management", "Garden management",
"000488.htm" "000488.htm"
], ],
[ [
"Memorial maintenance", "Memorial maintenance",
"000509.htm" "000509.htm"
], ],
[ [
"Recreational park management", "Recreational park management",
"000549.htm" "000549.htm"
], ],
[ [
"Sporting facilities management", "Sporting facilities management",
"000571.htm" "000571.htm"
] ]
], ],
[ [
"Regional development", "Regional development",
"000552.htm" "000552.htm"
], ],
[ [
"Transport network maintenance", "Transport network maintenance",
"000586.htm" "000586.htm"
], ],
[ [
"Waste management", "Waste management",
"001349.htm" "001349.htm"
] ]
], ],
[ [
"COMMUNICATIONS", "COMMUNICATIONS",
"000433.htm", "000433.htm",
[ [
"Advertising standards", "Advertising standards",
"000381.htm" "000381.htm"
], ],
[ [
"Broadcasting", "Broadcasting",
"000403.htm", "000403.htm",
[ [
"Broadcasting standards", "Broadcasting standards",
"000404.htm" "000404.htm"
], ],
[ [
"Radio broadcasting", "Radio broadcasting",
"000546.htm" "000546.htm"
], ],
[ [
"Television broadcasting", "Television broadcasting",
"000580.htm" "000580.htm"
] ]
], ],
[ [
"Call centre administration", "Call centre administration",
"000417.htm" "000417.htm"
], ],
[ [
"Electronic commerce", "Electronic commerce",
"000468.htm", "000468.htm",
[ [
"Authentication", "Authentication",
"000399.htm" "000399.htm"
], ],
[ [
"Online transaction standards", "Online transaction standards",
"000526.htm" "000526.htm"
] ]
], ],
[ [
"Government media", "Government media",
"000490.htm" "000490.htm"
], ],
[ [
"Information management standards", "Information management standards",
"000283.htm", "000283.htm",
[ [
"Data management", "Data management",
"000448.htm" "000448.htm"
], ],
[ [
"Information dissemination", "Information dissemination",
"000502.htm" "000502.htm"
], ],
[ [
"Information technology standards", "Information technology standards",
"000282.htm" "000282.htm"
] ]
], ],
[ [
"Media ownership regulation", "Media ownership regulation",
"000508.htm" "000508.htm"
], ],
[ [
"Postal services", "Postal services",
"000530.htm", "000530.htm",
[ [
"Courier services", "Courier services",
"000441.htm" "000441.htm"
], ],
[ [
"Electronic postal services", "Electronic postal services",
"000469.htm" "000469.htm"
], ],
[ [
"Retail postal services", "Retail postal services",
"000554.htm" "000554.htm"
] ]
], ],
[ [
"Publishing", "Publishing",
"000543.htm", "000543.htm",
[ [
"Electronic publishing", "Electronic publishing",
"000470.htm" "000470.htm"
], ],
[ [
"Publishing standards", "Publishing standards",
"000544.htm" "000544.htm"
], ],
[ [
"Website development", "Website development",
"000591.htm" "000591.htm"
] ]
], ],
[ [
"Radio communication", "Radio communication",
"000547.htm", "000547.htm",
[ [
"Apparatus licensing", "Apparatus licensing",
"000385.htm" "000385.htm"
], ],
[ [
"Spectrum management", "Spectrum management",
"000570.htm" "000570.htm"
] ]
], ],
[ [
"Satellite communication", "Satellite communication",
"000560.htm" "000560.htm"
], ],
[ [
"Telecommunications", "Telecommunications",
"000578.htm", "000578.htm",
[ [
"Carriage service providers", "Carriage service providers",
"000420.htm" "000420.htm"
], ],
[ [
"Carrier licensing", "Carrier licensing",
"000421.htm" "000421.htm"
], ],
[ [
"Equipment licensing", "Equipment licensing",
"000480.htm" "000480.htm"
], ],
[ [
"Mobile telephone services", "Mobile telephone services",
"000516.htm" "000516.htm"
], ],
[ [
"Telephone services", "Telephone services",
"000579.htm" "000579.htm"
] ]
] ]
], ],
[ [
"COMMUNITY SERVICES", "COMMUNITY SERVICES",
"000435.htm", "000435.htm",
[ [
"Accommodation services", "Accommodation services",
"000377.htm", "000377.htm",
[ [
"Defence housing", "Defence housing",
"000458.htm" "000458.htm"
], ],
[ [
"Emergency accommodation", "Emergency accommodation",
"000471.htm" "000471.htm"
], ],
[ [
"Public housing entitlements", "Public housing entitlements",
"000539.htm" "000539.htm"
], ],
[ [
"Refuge support", "Refuge support",
"000551.htm" "000551.htm"
] ]
], ],
[ [
"Community support", "Community support",
"000436.htm", "000436.htm",
[ [
"Adoption services", "Adoption services",
"000378.htm" "000378.htm"
], ],
[ [
"Aged care services", "Aged care services",
"000382.htm" "000382.htm"
], ],
[ [
"Child and youth support", "Child and youth support",
"000422.htm" "000422.htm"
], ],
[ [
"Child-care services", "Child-care services",
"000423.htm" "000423.htm"
], ],
[ [
"Defence community programs", "Defence community programs",
"000452.htm" "000452.htm"
], ],
[ [
"Family reunion programs", "Family reunion programs",
"000483.htm" "000483.htm"
], ],
[ [
"Veterans\" entitlements", "Veterans\" entitlements",
"000587.htm" "000587.htm"
] ]
], ],
[ [
"Counselling services", "Counselling services",
"000440.htm" "000440.htm"
], ],
[ [
"Emergency services", "Emergency services",
"000474.htm", "000474.htm",
[ [
"Ambulance services", "Ambulance services",
"000384.htm" "000384.htm"
], ],
[ [
"Emergency funding", "Emergency funding",
"000472.htm" "000472.htm"
], ],
[ [
"Firefighting services", "Firefighting services",
"000487.htm" "000487.htm"
] ]
], ],
[ [
"Financial assistance", "Financial assistance",
"000484.htm", "000484.htm",
[ [
"Benefits", "Benefits",
"000402.htm" "000402.htm"
], ],
[ [
"Income support schemes", "Income support schemes",
"000494.htm" "000494.htm"
] ]
], ],
[ [
"Natural disasters", "Natural disasters",
"000521.htm", "000521.htm",
[ [
"Disaster recovery", "Disaster recovery",
"000462.htm" "000462.htm"
], ],
[ [
"Disaster relief", "Disaster relief",
"000463.htm" "000463.htm"
] ]
], ],
[ [
"Rural community development", "Rural community development",
"000557.htm" "000557.htm"
], ],
[ [
"Social justice and equity", "Social justice and equity",
"000566.htm" "000566.htm"
], ],
[ [
"Transport access schemes", "Transport access schemes",
"000901.htm" "000901.htm"
] ]
], ],
[ [
"CULTURAL AFFAIRS", "CULTURAL AFFAIRS",
"000442.htm", "000442.htm",
[ [
"Arts development", "Arts development",
"000391.htm", "000391.htm",
[ [
"Arts funding", "Arts funding",
"000393.htm" "000393.htm"
], ],
[ [
"Arts incentive schemes", "Arts incentive schemes",
"000394.htm" "000394.htm"
], ],
[ [
"Arts promotion", "Arts promotion",
"000395.htm" "000395.htm"
] ]
], ],
[ [
"Collection access", "Collection access",
"000427.htm", "000427.htm",
[ [
"Descriptive standards", "Descriptive standards",
"000461.htm" "000461.htm"
], ],
[ [
"Finding aids development", "Finding aids development",
"000486.htm" "000486.htm"
], ],
[ [
"Reference services", "Reference services",
"000550.htm" "000550.htm"
] ]
], ],
[ [
"Collection management", "Collection management",
"000430.htm", "000430.htm",
[ [
"Artefact export regulation", "Artefact export regulation",
"000390.htm" "000390.htm"
], ],
[ [
"Collection accessioning", "Collection accessioning",
"000428.htm" "000428.htm"
], ],
[ [
"Collection acquisition", "Collection acquisition",
"000429.htm" "000429.htm"
], ],
[ [
"Collection storage", "Collection storage",
"000432.htm" "000432.htm"
], ],
[ [
"Preservation services", "Preservation services",
"000532.htm" "000532.htm"
] ]
], ],
[ [
"Collection promotion", "Collection promotion",
"000431.htm", "000431.htm",
[ [
"Exhibition programs", "Exhibition programs",
"000481.htm" "000481.htm"
], ],
[ [
"Publicity programs", "Publicity programs",
"000542.htm" "000542.htm"
] ]
], ],
[ [
"Cultural awards and scholarships", "Cultural awards and scholarships",
"000443.htm" "000443.htm"
], ],
[ [
"Cultural festivals", "Cultural festivals",
"000445.htm" "000445.htm"
], ],
[ [
"Cultural gifts programs", "Cultural gifts programs",
"000446.htm" "000446.htm"
], ],
[ [
"Multicultural heritage promotion", "Multicultural heritage promotion",
"000518.htm", "000518.htm",
[ [
"Multicultural festivals", "Multicultural festivals",
"000517.htm" "000517.htm"
], ],
[ [
"Multicultural services", "Multicultural services",
"000519.htm" "000519.htm"
] ]
] ]
], ],
[ [
"DEFENCE", "DEFENCE",
"000449.htm", "000449.htm",
[ [
"Australian Defence Forces", "Australian Defence Forces",
"000397.htm", "000397.htm",
[ [
"Air Force", "Air Force",
"002266.htm" "002266.htm"
], ],
[ [
"Army", "Army",
"000388.htm" "000388.htm"
], ],
[ [
"Badges and insignia", "Badges and insignia",
"000401.htm" "000401.htm"
], ],
[ [
"Cadets", "Cadets",
"000416.htm" "000416.htm"
], ],
[ [
"Defence force commands", "Defence force commands",
"000456.htm" "000456.htm"
], ],
[ [
"Military bands", "Military bands",
"000510.htm" "000510.htm"
], ],
[ [
"Navy", "Navy",
"000524.htm" "000524.htm"
], ],
[ [
"Reserves", "Reserves",
"000553.htm" "000553.htm"
], ],
[ [
"Roulettes", "Roulettes",
"000556.htm" "000556.htm"
] ]
], ],
[ [
"Defence estate management", "Defence estate management",
"000454.htm" "000454.htm"
], ],
[ [
"Defence force careers", "Defence force careers",
"000455.htm", "000455.htm",
[ [
"Defence career development", "Defence career development",
"000450.htm" "000450.htm"
], ],
[ [
"Military employment services", "Military employment services",
"000512.htm" "000512.htm"
] ]
], ],
[ [
"Defence strategic development", "Defence strategic development",
"000574.htm", "000574.htm",
[ [
"Defence efficiency review", "Defence efficiency review",
"000453.htm" "000453.htm"
], ],
[ [
"Defence reform program", "Defence reform program",
"000460.htm" "000460.htm"
] ]
], ],
[ [
"Defence strategic policy", "Defence strategic policy",
"000576.htm", "000576.htm",
[ [
"Strategic decisions", "Strategic decisions",
"000573.htm" "000573.htm"
], ],
[ [
"Strategic planning", "Strategic planning",
"000575.htm" "000575.htm"
] ]
], ],
[ [
"Defence strategic support", "Defence strategic support",
"000577.htm", "000577.htm",
[ [
"Capital equipment programs", "Capital equipment programs",
"000419.htm" "000419.htm"
], ],
[ [
"Defence industry", "Defence industry",
"000459.htm" "000459.htm"
], ],
[ [
"Defence science and technology", "Defence science and technology",
"000905.htm" "000905.htm"
], ],
[ [
"Logistics", "Logistics",
"000506.htm" "000506.htm"
] ]
], ],
[ [
"Emergency management", "Emergency management",
"000473.htm", "000473.htm",
[ [
"Civil community assistance", "Civil community assistance",
"000426.htm" "000426.htm"
], ],
[ [
"Disaster support", "Disaster support",
"000464.htm" "000464.htm"
] ]
], ],
[ [
"Military law", "Military law",
"001814.htm" "001814.htm"
], ],
[ [
"Military operations", "Military operations",
"000515.htm", "000515.htm",
[ [
"Australian theatre of war", "Australian theatre of war",
"000398.htm" "000398.htm"
], ],
[ [
"Military exercises", "Military exercises",
"000514.htm" "000514.htm"
], ],
[ [
"Special operations", "Special operations",
"000569.htm" "000569.htm"
], ],
[ [
"Warfare", "Warfare",
"000589.htm" "000589.htm"
] ]
] ]
], ],
[ [
"EDUCATION AND TRAINING", "EDUCATION AND TRAINING",
"000467.htm", "000467.htm",
[ [
"Arts education", "Arts education",
"000392.htm" "000392.htm"
], ],
[ [
"Community education", "Community education",
"000434.htm", "000434.htm",
[ [
"Adult education programs", "Adult education programs",
"000379.htm" "000379.htm"
], ],
[ [
"Adult migrant education", "Adult migrant education",
"000380.htm" "000380.htm"
], ],
[ [
"Road safety awareness", "Road safety awareness",
"000555.htm" "000555.htm"
] ]
], ],
[ [
"Curriculum development", "Curriculum development",
"000447.htm" "000447.htm"
], ],
[ [
"Early childhood education", "Early childhood education",
"000466.htm" "000466.htm"
], ],
[ [
"Military education and training", "Military education and training",
"000511.htm", "000511.htm",
[ [
"Army reserve training", "Army reserve training",
"000389.htm" "000389.htm"
], ],
[ [
"Defence college training", "Defence college training",
"000451.htm" "000451.htm"
] ]
], ],
[ [
"Overseas skills recognition", "Overseas skills recognition",
"000527.htm" "000527.htm"
], ],
[ [
"School education", "School education",
"000561.htm", "000561.htm",
[ [
"Discipline programs", "Discipline programs",
"000465.htm" "000465.htm"
], ],
[ [
"School transport regulation", "School transport regulation",
"000562.htm" "000562.htm"
], ],
[ [
"Special needs programs", "Special needs programs",
"000568.htm" "000568.htm"
] ]
], ],
[ [
"Tertiary education", "Tertiary education",
"000581.htm" "000581.htm"
], ],
[ [
"Vocational education", "Vocational education",
"000588.htm", "000588.htm",
[ [
"Apprenticeship programs", "Apprenticeship programs",
"000386.htm" "000386.htm"
], ],
[ [
"Hospital teaching programs", "Hospital teaching programs",
"000493.htm" "000493.htm"
], ],
[ [
"Trainee programs", "Trainee programs",
"000584.htm" "000584.htm"
], ],
[ [
"Workplace training", "Workplace training",
"000595.htm" "000595.htm"
] ]
] ]
], ],
[ [
"EMPLOYMENT", "EMPLOYMENT",
"000016.htm", "000016.htm",
[ [
"Human resources development", "Human resources development",
"000348.htm", "000348.htm",
[ [
"Occupational health and safety", "Occupational health and safety",
"000355.htm" "000355.htm"
], ],
[ [
"Recruitment programs", "Recruitment programs",
"000356.htm" "000356.htm"
], ],
[ [
"Termination processes", "Termination processes",
"002103.htm" "002103.htm"
], ],
[ [
"Workers compensation schemes", "Workers compensation schemes",
"000363.htm" "000363.htm"
], ],
[ [
"Workplace discrimination monitoring", "Workplace discrimination monitoring",
"000364.htm" "000364.htm"
], ],
[ [
"Workplace equity and justice programs", "Workplace equity and justice programs",
"000365.htm" "000365.htm"
] ]
], ],
[ [
"Industrial awards and conditions", "Industrial awards and conditions",
"000349.htm", "000349.htm",
[ [
"Award conditions", "Award conditions",
"000366.htm" "000366.htm"
], ],
[ [
"Remuneration review", "Remuneration review",
"000368.htm" "000368.htm"
] ]
], ],
[ [
"Labour market programs", "Labour market programs",
"000347.htm", "000347.htm",
[ [
"Employment services marketing", "Employment services marketing",
"000351.htm" "000351.htm"
], ],
[ [
"Job placement programs", "Job placement programs",
"000352.htm" "000352.htm"
], ],
[ [
"Job vacancy data management", "Job vacancy data management",
"000353.htm" "000353.htm"
] ]
], ],
[ [
"Workplace agreement processes", "Workplace agreement processes",
"000350.htm", "000350.htm",
[ [
"Agreement bargaining processes", "Agreement bargaining processes",
"002141.htm" "002141.htm"
], ],
[ [
"Agreement dispute mediation", "Agreement dispute mediation",
"000370.htm" "000370.htm"
], ],
[ [
"Certified employment conditions", "Certified employment conditions",
"000371.htm" "000371.htm"
], ],
[ [
"Employment advocacy services", "Employment advocacy services",
"000374.htm" "000374.htm"
] ]
] ]
], ],
[ [
"ENVIRONMENT", "ENVIRONMENT",
"000478.htm", "000478.htm",
[ [
"Built environment", "Built environment",
"000409.htm", "000409.htm",
[ [
"Building acoustics", "Building acoustics",
"000405.htm" "000405.htm"
], ],
[ [
"Building preservation", "Building preservation",
"000407.htm" "000407.htm"
] ]
], ],
[ [
"Climate information services", "Climate information services",
"000203.htm" "000203.htm"
], ],
[ [
"Conservation programs", "Conservation programs",
"000438.htm", "000438.htm",
[ [
"Endangered species protection", "Endangered species protection",
"000475.htm" "000475.htm"
], ],
[ [
"Landcare programs", "Landcare programs",
"000504.htm" "000504.htm"
], ],
[ [
"Soil preservation programs", "Soil preservation programs",
"000567.htm" "000567.htm"
] ]
], ],
[ [
"Environmental impact assessment", "Environmental impact assessment",
"000479.htm" "000479.htm"
], ],
[ [
"Historic relic protection", "Historic relic protection",
"000492.htm" "000492.htm"
], ],
[ [
"Marine life protection programs", "Marine life protection programs",
"000507.htm" "000507.htm"
], ],
[ [
"Natural heritage protection", "Natural heritage protection",
"000522.htm", "000522.htm",
[ [
"National park management", "National park management",
"000520.htm" "000520.htm"
], ],
[ [
"Nature reserve management", "Nature reserve management",
"000523.htm" "000523.htm"
], ],
[ [
"Wilderness area management", "Wilderness area management",
"000593.htm" "000593.htm"
], ],
[ [
"Wildlife sanctuary management", "Wildlife sanctuary management",
"000594.htm" "000594.htm"
] ]
], ],
[ [
"Oceans governance", "Oceans governance",
"000525.htm" "000525.htm"
], ],
[ [
"Pollutant prevention programs", "Pollutant prevention programs",
"000529.htm" "000529.htm"
], ],
[ [
"World heritage listings", "World heritage listings",
"000596.htm" "000596.htm"
] ]
], ],
[ [
"FINANCE MANAGEMENT", "FINANCE MANAGEMENT",
"000001.htm", "000001.htm",
[ [
"Commonwealth State funding", "Commonwealth State funding",
"000017.htm" "000017.htm"
], ],
[ [
"Currency", "Currency",
"000018.htm", "000018.htm",
[ [
"Counterfeiting control", "Counterfeiting control",
"000027.htm" "000027.htm"
] ]
], ],
[ [
"Financial investment", "Financial investment",
"000021.htm", "000021.htm",
[ [
"Investment scheme regulation", "Investment scheme regulation",
"000031.htm" "000031.htm"
] ]
], ],
[ [
"Financial system management", "Financial system management",
"002302.htm", "002302.htm",
[ [
"Financial system monitoring", "Financial system monitoring",
"002306.htm" "002306.htm"
], ],
[ [
"Payments management", "Payments management",
"002297.htm" "002297.htm"
] ]
], ],
[ [
"Fiscal policy", "Fiscal policy",
"000022.htm", "000022.htm",
[ [
"Public borrowing", "Public borrowing",
"000032.htm" "000032.htm"
], ],
[ [
"Public debt", "Public debt",
"000033.htm" "000033.htm"
], ],
[ [
"Public expenditure", "Public expenditure",
"000034.htm" "000034.htm"
] ]
], ],
[ [
"Foreign investment control", "Foreign investment control",
"000030.htm" "000030.htm"
], ],
[ [
"International monetary regulation", "International monetary regulation",
"000023.htm" "000023.htm"
], ],
[ [
"Monetary policy", "Monetary policy",
"000020.htm", "000020.htm",
[ [
"Exchange rates", "Exchange rates",
"000028.htm" "000028.htm"
], ],
[ [
"Inflation", "Inflation",
"000029.htm" "000029.htm"
], ],
[ [
"Interest rates", "Interest rates",
"002295.htm" "002295.htm"
] ]
], ],
[ [
"Resource management", "Resource management",
"000024.htm", "000024.htm",
[ [
"Contract management", "Contract management",
"000037.htm" "000037.htm"
], ],
[ [
"Financial administration", "Financial administration",
"000035.htm" "000035.htm"
], ],
[ [
"Financial budgeting", "Financial budgeting",
"000036.htm" "000036.htm"
] ]
], ],
[ [
"Retirement income", "Retirement income",
"000025.htm", "000025.htm",
[ [
"Asset assessment", "Asset assessment",
"000038.htm" "000038.htm"
], ],
[ [
"Retirement saving", "Retirement saving",
"000039.htm" "000039.htm"
], ],
[ [
"Superannuation regulation", "Superannuation regulation",
"000040.htm" "000040.htm"
] ]
], ],
[ [
"Statistical analysis", "Statistical analysis",
"000019.htm" "000019.htm"
], ],
[ [
"Taxation", "Taxation",
"000026.htm", "000026.htm",
[ [
"Income assessment", "Income assessment",
"000041.htm" "000041.htm"
], ],
[ [
"Revenue raising", "Revenue raising",
"000042.htm" "000042.htm"
], ],
[ [
"Taxation compliance", "Taxation compliance",
"000043.htm" "000043.htm"
] ]
] ]
], ],
[ [
"GOVERNANCE", "GOVERNANCE",
"000002.htm", "000002.htm",
[ [
"Civic celebrations", "Civic celebrations",
"000046.htm" "000046.htm"
], ],
[ [
"Constitutional matters", "Constitutional matters",
"000048.htm", "000048.htm",
[ [
"Constitutional conventions", "Constitutional conventions",
"000061.htm" "000061.htm"
], ],
[ [
"Constitutional referenda", "Constitutional referenda",
"000062.htm" "000062.htm"
] ]
], ],
[ [
"Electoral matters", "Electoral matters",
"000049.htm", "000049.htm",
[ [
"Declaration of interests", "Declaration of interests",
"000063.htm" "000063.htm"
], ],
[ [
"Election campaigning", "Election campaigning",
"000064.htm" "000064.htm"
], ],
[ [
"Electoral boundary assessment", "Electoral boundary assessment",
"000065.htm" "000065.htm"
] ]
], ],
[ [
"Honours and awards programs", "Honours and awards programs",
"000050.htm" "000050.htm"
], ],
[ [
"Intergovernmental relations", "Intergovernmental relations",
"000052.htm", "000052.htm",
[ [
"Cross-border cooperation", "Cross-border cooperation",
"000067.htm" "000067.htm"
], ],
[ [
"Intergovernment policy dissemination", "Intergovernment policy dissemination",
"000069.htm" "000069.htm"
] ]
], ],
[ [
"Legislative drafting", "Legislative drafting",
"000053.htm", "000053.htm",
[ [
"Draft Bill amendment process", "Draft Bill amendment process",
"000070.htm" "000070.htm"
], ],
[ [
"Legislation review", "Legislation review",
"000071.htm" "000071.htm"
], ],
[ [
"Preparation of legislative regulations", "Preparation of legislative regulations",
"000072.htm" "000072.htm"
] ]
], ],
[ [
"Official protocol", "Official protocol",
"000054.htm", "000054.htm",
[ [
"Ceremonial events and representation", "Ceremonial events and representation",
"000073.htm" "000073.htm"
], ],
[ [
"Head of Government protocol", "Head of Government protocol",
"000074.htm" "000074.htm"
], ],
[ [
"Official establishment management", "Official establishment management",
"000075.htm" "000075.htm"
], ],
[ [
"Official hospitality", "Official hospitality",
"000076.htm" "000076.htm"
], ],
[ [
"Official visits", "Official visits",
"000077.htm" "000077.htm"
] ]
], ],
[ [
"Parliamentary chamber support", "Parliamentary chamber support",
"000045.htm", "000045.htm",
[ [
"Hansard services", "Hansard services",
"000058.htm" "000058.htm"
], ],
[ [
"Parliamentary papers", "Parliamentary papers",
"000059.htm" "000059.htm"
], ],
[ [
"Tabling of official documents", "Tabling of official documents",
"000060.htm" "000060.htm"
] ]
], ],
[ [
"Parliamentary committee and member support", "Parliamentary committee and member support",
"000047.htm" "000047.htm"
], ],
[ [
"Population census", "Population census",
"000044.htm", "000044.htm",
[ [
"Demographic surveys", "Demographic surveys",
"000055.htm" "000055.htm"
], ],
[ [
"Household census", "Household census",
"000056.htm" "000056.htm"
], ],
[ [
"Population distribution analysis", "Population distribution analysis",
"000057.htm" "000057.htm"
] ]
], ],
[ [
"Public administration", "Public administration",
"002290.htm", "002290.htm",
[ [
"Government auditing", "Government auditing",
"002291.htm" "002291.htm"
], ],
[ [
"Public service", "Public service",
"002292.htm" "002292.htm"
], ],
[ [
"Territories administration", "Territories administration",
"002293.htm" "002293.htm"
] ]
], ],
[ [
"Statistics", "Statistics",
"002289.htm" "002289.htm"
] ]
], ],
[ [
"HEALTH CARE", "HEALTH CARE",
"000003.htm", "000003.htm",
[ [
"Community health services", "Community health services",
"000078.htm", "000078.htm",
[ [
"Clinical health services", "Clinical health services",
"000087.htm" "000087.htm"
], ],
[ [
"Health promotion", "Health promotion",
"000089.htm" "000089.htm"
], ],
[ [
"Primary health care", "Primary health care",
"000090.htm" "000090.htm"
] ]
], ],
[ [
"Health insurance schemes", "Health insurance schemes",
"000079.htm" "000079.htm"
], ],
[ [
"Health protocol administration", "Health protocol administration",
"000080.htm", "000080.htm",
[ [
"Drugs and poisons regulation", "Drugs and poisons regulation",
"000091.htm" "000091.htm"
], ],
[ [
"Food hygiene regulation", "Food hygiene regulation",
"000092.htm" "000092.htm"
], ],
[ [
"Practitioner discipline", "Practitioner discipline",
"000093.htm" "000093.htm"
], ],
[ [
"Practitioner registration", "Practitioner registration",
"000095.htm" "000095.htm"
] ]
], ],
[ [
"Hospital services", "Hospital services",
"000081.htm", "000081.htm",
[ [
"Hospital administration", "Hospital administration",
"000096.htm" "000096.htm"
], ],
[ [
"Patient care", "Patient care",
"000097.htm" "000097.htm"
], ],
[ [
"Pharmaceutical and drug support", "Pharmaceutical and drug support",
"000098.htm" "000098.htm"
] ]
], ],
[ [
"Medical research", "Medical research",
"000083.htm", "000083.htm",
[ [
"Ethical compliance", "Ethical compliance",
"000099.htm" "000099.htm"
], ],
[ [
"Medical aids regulation", "Medical aids regulation",
"000100.htm" "000100.htm"
], ],
[ [
"Medical research funding", "Medical research funding",
"000101.htm" "000101.htm"
], ],
[ [
"National referral laboratory services", "National referral laboratory services",
"000102.htm" "000102.htm"
], ],
[ [
"Population-based research", "Population-based research",
"000103.htm" "000103.htm"
] ]
], ],
[ [
"Public health services", "Public health services",
"000084.htm", "000084.htm",
[ [
"Epidemiology", "Epidemiology",
"000104.htm" "000104.htm"
], ],
[ [
"Health disaster preparedness", "Health disaster preparedness",
"000106.htm" "000106.htm"
], ],
[ [
"Health hazard prevention", "Health hazard prevention",
"000105.htm" "000105.htm"
], ],
[ [
"Medical quarantine services", "Medical quarantine services",
"000108.htm" "000108.htm"
], ],
[ [
"Notifiable disease management", "Notifiable disease management",
"000109.htm" "000109.htm"
] ]
], ],
[ [
"Special needs services", "Special needs services",
"000085.htm", "000085.htm",
[ [
"Dental health services", "Dental health services",
"000111.htm" "000111.htm"
], ],
[ [
"Independent living services", "Independent living services",
"000112.htm" "000112.htm"
], ],
[ [
"Mental health services", "Mental health services",
"000113.htm" "000113.htm"
], ],
[ [
"Residential services", "Residential services",
"000114.htm" "000114.htm"
] ]
], ],
[ [
"Veterans\" health services", "Veterans\" health services",
"000086.htm" "000086.htm"
] ]
], ],
[ [
"IMMIGRATION", "IMMIGRATION",
"000004.htm", "000004.htm",
[ [
"Citizenship", "Citizenship",
"000115.htm", "000115.htm",
[ [
"Naturalisation assessment", "Naturalisation assessment",
"000121.htm" "000121.htm"
], ],
[ [
"Presentation arrangements", "Presentation arrangements",
"000122.htm" "000122.htm"
] ]
], ],
[ [
"Deportation", "Deportation",
"000116.htm" "000116.htm"
], ],
[ [
"Detention programs", "Detention programs",
"000117.htm" "000117.htm"
], ],
[ [
"Migrant services", "Migrant services",
"000118.htm", "000118.htm",
[ [
"Interpreter services", "Interpreter services",
"000123.htm" "000123.htm"
], ],
[ [
"Migrant accommodation services", "Migrant accommodation services",
"000125.htm" "000125.htm"
], ],
[ [
"Migrant settlement programs", "Migrant settlement programs",
"000126.htm" "000126.htm"
] ]
], ],
[ [
"Refugee services", "Refugee services",
"000119.htm" "000119.htm"
], ],
[ [
"Travel authorisation", "Travel authorisation",
"000120.htm", "000120.htm",
[ [
"Permanent entry arrangements", "Permanent entry arrangements",
"000127.htm" "000127.htm"
], ],
[ [
"Temporary entry arrangements", "Temporary entry arrangements",
"000128.htm" "000128.htm"
] ]
] ]
], ],
[ [
"INDIGENOUS AFFAIRS", "INDIGENOUS AFFAIRS",
"002285.htm", "002285.htm",
[ [
"Indigenous cultural heritage", "Indigenous cultural heritage",
"000495.htm", "000495.htm",
[ [
"Cultural artefact repatriation", "Cultural artefact repatriation",
"001772.htm" "001772.htm"
] ]
], ],
[ [
"Indigenous enterprise development", "Indigenous enterprise development",
"000496.htm" "000496.htm"
], ],
[ [
"Indigenous health services", "Indigenous health services",
"000082.htm" "000082.htm"
], ],
[ [
"Indigenous heritage conservation", "Indigenous heritage conservation",
"000497.htm" "000497.htm"
], ],
[ [
"Indigenous reconciliation", "Indigenous reconciliation",
"000051.htm" "000051.htm"
], ],
[ [
"Indigenous welfare programs", "Indigenous welfare programs",
"000498.htm" "000498.htm"
] ]
], ],
[ [
"INTERNATIONAL RELATIONS", "INTERNATIONAL RELATIONS",
"000005.htm", "000005.htm",
[ [
"Consular services", "Consular services",
"000129.htm" "000129.htm"
], ],
[ [
"Defence liaison", "Defence liaison",
"000132.htm", "000132.htm",
[ [
"Defence attach�s", "Defence attach�s",
"000140.htm" "000140.htm"
], ],
[ [
"Defence cooperation programs", "Defence cooperation programs",
"000141.htm" "000141.htm"
], ],
[ [
"Defence personnel exchanges", "Defence personnel exchanges",
"000142.htm" "000142.htm"
], ],
[ [
"Military advisors", "Military advisors",
"000143.htm" "000143.htm"
] ]
], ],
[ [
"Diplomatic missions", "Diplomatic missions",
"000130.htm" "000130.htm"
], ],
[ [
"International affairs", "International affairs",
"000131.htm", "000131.htm",
[ [
"Disarmament and arms control", "Disarmament and arms control",
"000137.htm" "000137.htm"
], ],
[ [
"Nuclear safeguards", "Nuclear safeguards",
"000139.htm" "000139.htm"
] ]
], ],
[ [
"International treaties", "International treaties",
"000133.htm", "000133.htm",
[ [
"Treaty administration", "Treaty administration",
"001384.htm" "001384.htm"
] ]
], ],
[ [
"Overseas aid programs", "Overseas aid programs",
"000134.htm", "000134.htm",
[ [
"Development assistance programs", "Development assistance programs",
"000146.htm" "000146.htm"
], ],
[ [
"Overseas student scholarship programs", "Overseas student scholarship programs",
"000147.htm" "000147.htm"
] ]
], ],
[ [
"Overseas promotion", "Overseas promotion",
"000135.htm" "000135.htm"
], ],
[ [
"Passport services", "Passport services",
"000136.htm" "000136.htm"
] ]
], ],
[ [
"JUSTICE ADMINISTRATION", "JUSTICE ADMINISTRATION",
"000006.htm", "000006.htm",
[ [
"Administrative law", "Administrative law",
"000149.htm", "000149.htm",
[ [
"Administrative decision appeal", "Administrative decision appeal",
"000163.htm" "000163.htm"
], ],
[ [
"Administrative decision review", "Administrative decision review",
"000164.htm" "000164.htm"
], ],
[ [
"Censorship standards", "Censorship standards",
"000165.htm" "000165.htm"
], ],
[ [
"Copyright regulation", "Copyright regulation",
"000166.htm" "000166.htm"
], ],
[ [
"Recordkeeping standards", "Recordkeeping standards",
"000167.htm" "000167.htm"
] ]
], ],
[ [
"Associations and corporate law", "Associations and corporate law",
"000150.htm", "000150.htm",
[ [
"Bankruptcy proceedings", "Bankruptcy proceedings",
"000168.htm" "000168.htm"
], ],
[ [
"Merger regulation", "Merger regulation",
"000169.htm" "000169.htm"
] ]
], ],
[ [
"Civil law", "Civil law",
"000151.htm", "000151.htm",
[ [
"Civil registration", "Civil registration",
"000170.htm" "000170.htm"
], ],
[ [
"Conveyancing", "Conveyancing",
"000171.htm" "000171.htm"
], ],
[ [
"Dispute mediation programs", "Dispute mediation programs",
"000174.htm" "000174.htm"
], ],
[ [
"Family law proceedings", "Family law proceedings",
"000172.htm" "000172.htm"
], ],
[ [
"Probate applications", "Probate applications",
"000173.htm" "000173.htm"
] ]
], ],
[ [
"Commissions of inquiry", "Commissions of inquiry",
"000152.htm" "000152.htm"
], ],
[ [
"Coronial law", "Coronial law",
"000153.htm" "000153.htm"
], ],
[ [
"Court reporting", "Court reporting",
"000154.htm" "000154.htm"
], ],
[ [
"Criminal law", "Criminal law",
"000155.htm" "000155.htm"
], ],
[ [
"Human rights obligations", "Human rights obligations",
"000156.htm" "000156.htm"
], ],
[ [
"Juvenile justice", "Juvenile justice",
"000157.htm" "000157.htm"
], ],
[ [
"Legal aid services", "Legal aid services",
"000158.htm" "000158.htm"
], ],
[ [
"Local laws and ordinances", "Local laws and ordinances",
"000159.htm" "000159.htm"
], ],
[ [
"Native title claims", "Native title claims",
"000160.htm", "000160.htm",
[ [
"Native title mediation programs", "Native title mediation programs",
"000180.htm" "000180.htm"
], ],
[ [
"Native title settlement negotiations", "Native title settlement negotiations",
"000181.htm" "000181.htm"
] ]
], ],
[ [
"Privacy guideline monitoring", "Privacy guideline monitoring",
"000161.htm" "000161.htm"
], ],
[ [
"Prosecution services", "Prosecution services",
"000162.htm" "000162.htm"
] ]
], ],
[ [
"MARITIME SERVICES", "MARITIME SERVICES",
"000007.htm", "000007.htm",
[ [
"Cargo control", "Cargo control",
"000198.htm" "000198.htm"
], ],
[ [
"Harbour management", "Harbour management",
"000183.htm" "000183.htm"
], ],
[ [
"Marina management", "Marina management",
"000184.htm" "000184.htm"
], ],
[ [
"Navigation", "Navigation",
"000185.htm", "000185.htm",
[ [
"Charting sea lanes", "Charting sea lanes",
"000191.htm" "000191.htm"
], ],
[ [
"Light station maintenance", "Light station maintenance",
"000192.htm" "000192.htm"
], ],
[ [
"Navigation systems development", "Navigation systems development",
"000193.htm" "000193.htm"
] ]
], ],
[ [
"Pilotage management", "Pilotage management",
"000182.htm" "000182.htm"
], ],
[ [
"Port regulation", "Port regulation",
"001471.htm" "001471.htm"
], ],
[ [
"Sea passengers", "Sea passengers",
"001487.htm" "001487.htm"
], ],
[ [
"Search and rescue", "Search and rescue",
"000187.htm", "000187.htm",
[ [
"Rescue coordination", "Rescue coordination",
"000194.htm" "000194.htm"
], ],
[ [
"Search technology development", "Search technology development",
"000195.htm" "000195.htm"
] ]
], ],
[ [
"Ship personnel", "Ship personnel",
"000188.htm", "000188.htm",
[ [
"Personnel safety standards", "Personnel safety standards",
"000196.htm" "000196.htm"
], ],
[ [
"Pilot licensing", "Pilot licensing",
"000197.htm" "000197.htm"
] ]
], ],
[ [
"Ship safety", "Ship safety",
"000189.htm", "000189.htm",
[ [
"Seaworthiness", "Seaworthiness",
"000201.htm" "000201.htm"
], ],
[ [
"Ship commissioning", "Ship commissioning",
"000199.htm" "000199.htm"
], ],
[ [
"Ship inspection", "Ship inspection",
"000200.htm" "000200.htm"
] ]
] ]
], ],
[ [
"NATURAL RESOURCES", "NATURAL RESOURCES",
"000009.htm", "000009.htm",
[ [
"Crown land administration", "Crown land administration",
"000218.htm" "000218.htm"
], ],
[ [
"Energy resources", "Energy resources",
"001451.htm", "001451.htm",
[ [
"Fossil fuel management", "Fossil fuel management",
"000226.htm" "000226.htm"
], ],
[ [
"Renewable energy development", "Renewable energy development",
"000227.htm" "000227.htm"
] ]
], ],
[ [
"Land use planning", "Land use planning",
"000220.htm", "000220.htm",
[ [
"Land use zoning", "Land use zoning",
"001429.htm" "001429.htm"
] ]
], ],
[ [
"Land valuation", "Land valuation",
"000222.htm" "000222.htm"
], ],
[ [
"Mineral resources", "Mineral resources",
"000223.htm", "000223.htm",
[ [
"Land rehabilitation programs", "Land rehabilitation programs",
"000231.htm" "000231.htm"
], ],
[ [
"Mining regulations", "Mining regulations",
"000232.htm" "000232.htm"
] ]
], ],
[ [
"Pollution emission control", "Pollution emission control",
"000224.htm" "000224.htm"
], ],
[ [
"Water resources", "Water resources",
"000225.htm", "000225.htm",
[ [
"Water conservation plans", "Water conservation plans",
"000233.htm" "000233.htm"
], ],
[ [
"Water quality monitoring", "Water quality monitoring",
"000234.htm" "000234.htm"
], ],
[ [
"Water usage management", "Water usage management",
"000235.htm" "000235.htm"
], ],
[ [
"Waterway management", "Waterway management",
"000236.htm" "000236.htm"
] ]
] ]
], ],
[ [
"PRIMARY INDUSTRIES", "PRIMARY INDUSTRIES",
"000008.htm", "000008.htm",
[ [
"Chemical and pesticide regulation", "Chemical and pesticide regulation",
"000202.htm" "000202.htm"
], ],
[ [
"Marine and rural regulation", "Marine and rural regulation",
"000204.htm", "000204.htm",
[ [
"Agricultural industry", "Agricultural industry",
"000208.htm" "000208.htm"
], ],
[ [
"Fisheries industry", "Fisheries industry",
"000209.htm" "000209.htm"
], ],
[ [
"Food quality assurance", "Food quality assurance",
"000213.htm" "000213.htm"
], ],
[ [
"Forestry industry", "Forestry industry",
"000210.htm" "000210.htm"
] ]
], ],
[ [
"Marine and rural support", "Marine and rural support",
"000205.htm", "000205.htm",
[ [
"Aquaculture industry", "Aquaculture industry",
"000212.htm" "000212.htm"
], ],
[ [
"Horticultural industry", "Horticultural industry",
"000214.htm" "000214.htm"
], ],
[ [
"Pastoral industry", "Pastoral industry",
"000215.htm" "000215.htm"
], ],
[ [
"Silvicultural industry", "Silvicultural industry",
"000216.htm" "000216.htm"
], ],
[ [
"Viticultural industry", "Viticultural industry",
"000217.htm" "000217.htm"
] ]
], ],
[ [
"Quarantine", "Quarantine",
"000211.htm" "000211.htm"
], ],
[ [
"Rural field day promotion", "Rural field day promotion",
"000206.htm" "000206.htm"
], ],
[ [
"Rural partnership programs", "Rural partnership programs",
"000207.htm" "000207.htm"
] ]
], ],
[ [
"SCIENCE", "SCIENCE",
"000010.htm", "000010.htm",
[ [
"Agricultural sciences", "Agricultural sciences",
"000237.htm" "000237.htm"
], ],
[ [
"Animal and veterinary sciences", "Animal and veterinary sciences",
"000238.htm" "000238.htm"
], ],
[ [
"Applied sciences", "Applied sciences",
"000239.htm", "000239.htm",
[ [
"Engineering and technology sciences", "Engineering and technology sciences",
"000246.htm" "000246.htm"
], ],
[ [
"Weights and measures standards", "Weights and measures standards",
"000247.htm" "000247.htm"
] ]
], ],
[ [
"Biological sciences", "Biological sciences",
"000240.htm", "000240.htm",
[ [
"Biochemistry", "Biochemistry",
"000248.htm" "000248.htm"
], ],
[ [
"Biodiversity preservation", "Biodiversity preservation",
"000249.htm" "000249.htm"
], ],
[ [
"Biotechnology development", "Biotechnology development",
"000250.htm" "000250.htm"
], ],
[ [
"Botany", "Botany",
"000251.htm" "000251.htm"
], ],
[ [
"Entomology", "Entomology",
"000252.htm" "000252.htm"
], ],
[ [
"Genetic engineering", "Genetic engineering",
"000253.htm" "000253.htm"
], ],
[ [
"Physiology", "Physiology",
"000254.htm" "000254.htm"
] ]
], ],
[ [
"Earth sciences", "Earth sciences",
"000241.htm", "000241.htm",
[ [
"Atmospheric sciences", "Atmospheric sciences",
"000255.htm" "000255.htm"
], ],
[ [
"Hydrology", "Hydrology",
"000256.htm" "000256.htm"
], ],
[ [
"Mineral exploration", "Mineral exploration",
"000257.htm" "000257.htm"
], ],
[ [
"Oceanography", "Oceanography",
"000258.htm" "000258.htm"
], ],
[ [
"Seismology", "Seismology",
"000259.htm" "000259.htm"
] ]
], ],
[ [
"Mathematical sciences", "Mathematical sciences",
"000242.htm" "000242.htm"
], ],
[ [
"Medical and health sciences", "Medical and health sciences",
"001229.htm" "001229.htm"
], ],
[ [
"Physical sciences", "Physical sciences",
"000244.htm", "000244.htm",
[ [
"Astronomical sciences", "Astronomical sciences",
"000260.htm" "000260.htm"
], ],
[ [
"Atomic and molecular sciences", "Atomic and molecular sciences",
"000261.htm" "000261.htm"
], ],
[ [
"Nuclear sciences", "Nuclear sciences",
"000262.htm" "000262.htm"
] ]
], ],
[ [
"Spatial information research", "Spatial information research",
"000245.htm" "000245.htm"
] ]
], ],
[ [
"SECURITY", "SECURITY",
"000011.htm", "000011.htm",
[ [
"Corrective services", "Corrective services",
"000263.htm", "000263.htm",
[ [
"Community based corrections", "Community based corrections",
"000270.htm" "000270.htm"
], ],
[ [
"Detention centre management", "Detention centre management",
"000271.htm" "000271.htm"
] ]
], ],
[ [
"External security", "External security",
"000264.htm", "000264.htm",
[ [
"Peacekeeping forces", "Peacekeeping forces",
"000273.htm" "000273.htm"
] ]
], ],
[ [
"Information security", "Information security",
"000265.htm" "000265.htm"
], ],
[ [
"Intelligence", "Intelligence",
"000266.htm", "000266.htm",
[ [
"Forensic analysis", "Forensic analysis",
"000275.htm" "000275.htm"
], ],
[ [
"Intelligence liaison", "Intelligence liaison",
"001159.htm" "001159.htm"
], ],
[ [
"Intelligence support", "Intelligence support",
"000277.htm" "000277.htm"
] ]
], ],
[ [
"Law enforcement", "Law enforcement",
"000267.htm", "000267.htm",
[ [
"Community policing", "Community policing",
"000278.htm" "000278.htm"
], ],
[ [
"Criminology", "Criminology",
"000279.htm" "000279.htm"
], ],
[ [
"Police administration", "Police administration",
"000280.htm" "000280.htm"
], ],
[ [
"Protective services", "Protective services",
"000281.htm" "000281.htm"
] ]
], ],
[ [
"National security", "National security",
"001548.htm", "001548.htm",
[ [
"Coastal surveillance", "Coastal surveillance",
"000269.htm" "000269.htm"
] ]
] ]
], ],
[ [
"SPORT AND RECREATION", "SPORT AND RECREATION",
"000012.htm", "000012.htm",
[ [
"Caravan and camping services", "Caravan and camping services",
"000284.htm" "000284.htm"
], ],
[ [
"Community recreational programs", "Community recreational programs",
"000285.htm", "000285.htm",
[ [
"Gambling support services", "Gambling support services",
"000290.htm" "000290.htm"
], ],
[ [
"Public fitness promotion", "Public fitness promotion",
"000291.htm" "000291.htm"
], ],
[ [
"Social club support", "Social club support",
"000292.htm" "000292.htm"
], ],
[ [
"Volunteer support programs", "Volunteer support programs",
"000293.htm" "000293.htm"
] ]
], ],
[ [
"Gaming industry regulation", "Gaming industry regulation",
"000286.htm" "000286.htm"
], ],
[ [
"Park and reserve services", "Park and reserve services",
"000289.htm" "000289.htm"
], ],
[ [
"Sport and fitness development", "Sport and fitness development",
"000287.htm", "000287.htm",
[ [
"Athlete scholarship programs", "Athlete scholarship programs",
"000295.htm" "000295.htm"
], ],
[ [
"Fundraising and donation schemes", "Fundraising and donation schemes",
"000296.htm" "000296.htm"
], ],
[ [
"Games administration", "Games administration",
"000297.htm" "000297.htm"
], ],
[ [
"Games promotion", "Games promotion",
"000298.htm" "000298.htm"
], ],
[ [
"Sporting grants administration", "Sporting grants administration",
"000299.htm" "000299.htm"
] ]
], ],
[ [
"Sports drugs monitoring", "Sports drugs monitoring",
"000288.htm", "000288.htm",
[ [
"Doping detection research", "Doping detection research",
"000300.htm" "000300.htm"
] ]
] ]
], ],
[ [
"TOURISM", "TOURISM",
"000013.htm", "000013.htm",
[ [
"Tourism industry development", "Tourism industry development",
"000301.htm" "000301.htm"
], ],
[ [
"Tourist event promotion", "Tourist event promotion",
"000302.htm", "000302.htm",
[ [
"Advertising campaigns", "Advertising campaigns",
"000305.htm" "000305.htm"
] ]
], ],
[ [
"Travel missions", "Travel missions",
"000303.htm" "000303.htm"
] ]
], ],
[ [
"TRADE", "TRADE",
"000014.htm", "000014.htm",
[ [
"Export regulation", "Export regulation",
"000311.htm", "000311.htm",
[ [
"Export promotion", "Export promotion",
"000320.htm" "000320.htm"
], ],
[ [
"Prohibited export control", "Prohibited export control",
"000321.htm" "000321.htm"
] ]
], ],
[ [
"Import regulation", "Import regulation",
"000312.htm", "000312.htm",
[ [
"Prohibited import control", "Prohibited import control",
"000323.htm" "000323.htm"
], ],
[ [
"Tariff regulation", "Tariff regulation",
"000322.htm" "000322.htm"
] ]
], ],
[ [
"Intellectual property management", "Intellectual property management",
"000910.htm", "000910.htm",
[ [
"Copyright registration", "Copyright registration",
"000308.htm" "000308.htm"
], ],
[ [
"Design registration", "Design registration",
"000310.htm" "000310.htm"
], ],
[ [
"Patent registration", "Patent registration",
"000315.htm" "000315.htm"
], ],
[ [
"Trademark registration", "Trademark registration",
"000318.htm" "000318.htm"
] ]
], ],
[ [
"International trade agreements", "International trade agreements",
"000313.htm" "000313.htm"
], ],
[ [
"Interstate trade agreements", "Interstate trade agreements",
"000314.htm" "000314.htm"
], ],
[ [
"Trade development programs", "Trade development programs",
"000316.htm" "000316.htm"
], ],
[ [
"Trade expositions", "Trade expositions",
"000317.htm" "000317.htm"
] ]
], ],
[ [
"TRANSPORT", "TRANSPORT",
"000015.htm", "000015.htm",
[ [
"Air transport", "Air transport",
"000324.htm", "000324.htm",
[ [
"Air transport safety", "Air transport safety",
"000332.htm" "000332.htm"
], ],
[ [
"Aircraft standards", "Aircraft standards",
"000330.htm" "000330.htm"
], ],
[ [
"Airport services", "Airport services",
"000331.htm" "000331.htm"
] ]
], ],
[ [
"Freight movement regulation", "Freight movement regulation",
"000325.htm" "000325.htm"
], ],
[ [
"Passenger services", "Passenger services",
"000326.htm" "000326.htm"
], ],
[ [
"Rail transport", "Rail transport",
"000327.htm", "000327.htm",
[ [
"Rail harmonisation standards", "Rail harmonisation standards",
"000333.htm" "000333.htm"
], ],
[ [
"Rail land acquisition regulation", "Rail land acquisition regulation",
"000336.htm" "000336.htm"
], ],
[ [
"Rail transport safety", "Rail transport safety",
"000337.htm" "000337.htm"
], ],
[ [
"Railway maintenance", "Railway maintenance",
"000338.htm" "000338.htm"
], ],
[ [
"Rolling stock regulation", "Rolling stock regulation",
"000339.htm" "000339.htm"
] ]
], ],
[ [
"Road transport", "Road transport",
"000328.htm", "000328.htm",
[ [
"Driving licences administration", "Driving licences administration",
"000340.htm" "000340.htm"
], ],
[ [
"Road surface maintenance", "Road surface maintenance",
"000341.htm" "000341.htm"
], ],
[ [
"Road traffic regulation", "Road traffic regulation",
"000342.htm" "000342.htm"
], ],
[ [
"Road transport safety", "Road transport safety",
"000343.htm" "000343.htm"
], ],
[ [
"Vehicle registration", "Vehicle registration",
"000344.htm" "000344.htm"
], ],
[ [
"Vehicle standards", "Vehicle standards",
"000345.htm" "000345.htm"
] ]
], ],
[ [
"Transport infrastructure development", "Transport infrastructure development",
"000329.htm" "000329.htm"
] ]
] ]
]'); ]');
class ArrayUtil class ArrayUtil
{ {
public static function FilterRecursive(Array $source, $fn) public static function FilterRecursive(Array $source, $fn)
{ {
$result = array(); $result = array();
foreach ($source as $key => $value) foreach ($source as $key => $value)
{ {
if (is_array($value)) if (is_array($value))
{ {
$result[$key] = self::FilterRecursive($value, $fn); $result[$key] = self::FilterRecursive($value, $fn);
continue; continue;
} }
if ($fn($key, $value)) if ($fn($key, $value))
{ {
$result[$key] = $value; // KEEP $result[$key] = $value; // KEEP
continue; continue;
} }
} }
return $result; return $result;
} }
public static function DoRecursive(Array $source) public static function DoRecursive(Array $source)
{ {
$result = array(); $result = array();
foreach ($source as $key => $value) foreach ($source as $key => $value)
{ {
if (is_array($value)) if (is_array($value))
{ {
$result["children"][] = self::DoRecursive($value); $result["children"][] = self::DoRecursive($value);
} else { } else {
$result["name"] = $value; // KEEP $result["name"] = $value; // KEEP
} }
} }
return $result; return $result;
} }
} }
   
// EXAMPLE ANONYMOUS CALLBACK FUNCTION // EXAMPLE ANONYMOUS CALLBACK FUNCTION
$fn = function ($key, $value) $fn = function ($key, $value)
{ {
if (strpos($value, '.htm') !== FALSE) if (strpos($value, '.htm') !== FALSE)
{ {
return FALSE; // DROP return FALSE; // DROP
} }
return TRUE; // KEEP return TRUE; // KEEP
}; };
   
   
$postFilter = ArrayUtil::FilterRecursive($raw, $fn); $postFilter = ArrayUtil::FilterRecursive($raw, $fn);
$postWrangle = ArrayUtil::DoRecursive($postFilter); $postWrangle = ArrayUtil::DoRecursive($postFilter);
   
echo json_encode($postWrangle); echo json_encode($postWrangle);
?> ?>
; ;
// Create a svg canvas // Create a svg canvas
var vis = d3.select("#viz").append("svg:svg") var vis = d3.select("#viz").append("svg:svg")
.attr("width", 1400) .attr("width", 1400)
.attr("height", 1400) .attr("height", 1400)
.append("svg:g") .append("svg:g")
.attr("transform", "translate(450, 450)"); .attr("transform", "translate(450, 450)");
   
// Create a cluster "canvas" // Create a cluster "canvas"
var cluster = d3.layout.cluster() var cluster = d3.layout.cluster()
.size([500,500]); .size([500,500]);
   
var diagonal = d3.svg.diagonal.radial() var diagonal = d3.svg.diagonal.radial()
.projection(function(d) { return [d.y, d.x / 180 * Math.PI]; }); .projection(function(d) { return [d.y, d.x / 180 * Math.PI]; });
   
var nodes = cluster.nodes(treeData); var nodes = cluster.nodes(treeData);
var links = cluster.links(nodes); var links = cluster.links(nodes);
   
var link = vis.selectAll("pathlink") var link = vis.selectAll("pathlink")
.data(links) .data(links)
.enter().append("svg:path") .enter().append("svg:path")
.attr("class", "link") .attr("class", "link")
.attr("d", diagonal) .attr("d", diagonal)
   
var node = vis.selectAll("g.node") var node = vis.selectAll("g.node")
.data(nodes) .data(nodes)
.enter().append("svg:g") .enter().append("svg:g")
.attr("transform", function(d) { return "rotate(" + (d.x - 90) + ")translate(" + d.y + ")"; }) .attr("transform", function(d) { return "rotate(" + (d.x - 90) + ")translate(" + d.y + ")"; })
   
// Add the dot at every node // Add the dot at every node
node.append("svg:circle") node.append("svg:circle")
.attr("r", 3.5); .attr("r", 3.5);
   
node.append("svg:text") node.append("svg:text")
.attr("dx", function(d) { return d.x < 180 ? 8 : -8; }) .attr("dx", function(d) { return d.x < 180 ? 8 : -8; })
.attr("dy", ".31em") .attr("dy", ".31em")
.attr("text-anchor", function(d) { return d.x < 180 ? "start" : "end"; }) .attr("text-anchor", function(d) { return d.x < 180 ? "start" : "end"; })
.attr("transform", function(d) { return d.x < 180 ? null : "rotate(180)"; }) .attr("transform", function(d) { return d.x < 180 ? null : "rotate(180)"; })
.text(function(d) { return d.name; }); .text(function(d) { return d.name; });
// alt // alt
function visit(parent, visitFn, childrenFn) function visit(parent, visitFn, childrenFn)
{ {
if (!parent) return; if (!parent) return;
   
visitFn(parent); visitFn(parent);
   
var children = childrenFn(parent); var children = childrenFn(parent);
if (children) { if (children) {
var count = children.length; var count = children.length;
for (var i = 0; i < count; i++) { for (var i = 0; i < count; i++) {
visit(children[i], visitFn, childrenFn); visit(children[i], visitFn, childrenFn);
} }
} }
} }
   
function buildTree(containerName, customOptions) function buildTree(containerName, customOptions)
{ {
// build the options object // build the options object
var options = $.extend({ var options = $.extend({
nodeRadius: 5, fontSize: 12 nodeRadius: 5, fontSize: 12
}, customOptions); }, customOptions);
   
// Calculate total nodes, max label length // Calculate total nodes, max label length
var totalNodes = 0; var totalNodes = 0;
var maxLabelLength = 0; var maxLabelLength = 0;
visit(treeData, function(d) visit(treeData, function(d)
{ {
totalNodes++; totalNodes++;
maxLabelLength = Math.max(d.name.length, maxLabelLength); maxLabelLength = Math.max(d.name.length, maxLabelLength);
}, function(d) }, function(d)
{ {
return d.children && d.children.length > 0 ? d.children : null; return d.children && d.children.length > 0 ? d.children : null;
}); });
   
// size of the diagram // size of the diagram
var size = { width:$(containerName).outerWidth(), height: totalNodes * 15}; var size = { width:$(containerName).outerWidth(), height: totalNodes * 15};
   
var tree = d3.layout.tree() var tree = d3.layout.tree()
.sort(null) .sort(null)
.size([size.height, size.width - maxLabelLength*options.fontSize]) .size([size.height, size.width - maxLabelLength*options.fontSize])
.children(function(d) .children(function(d)
{ {
return (!d.children || d.children.length === 0) ? null : d.children; return (!d.children || d.children.length === 0) ? null : d.children;
}); });
   
var nodes = tree.nodes(treeData); var nodes = tree.nodes(treeData);
var links = tree.links(nodes); var links = tree.links(nodes);
   
/* /*
<svg> <svg>
<g class="container" /> <g class="container" />
</svg> </svg>
*/ */
var layoutRoot = d3.select(containerName) var layoutRoot = d3.select(containerName)
.append("svg:svg").attr("width", size.width).attr("height", size.height) .append("svg:svg").attr("width", size.width).attr("height", size.height)
.append("svg:g") .append("svg:g")
.attr("class", "container") .attr("class", "container")
.attr("transform", "translate(" + maxLabelLength + ",0)"); .attr("transform", "translate(" + maxLabelLength + ",0)");
   
   
// Edges between nodes as a <path class="link" /> // Edges between nodes as a <path class="link" />
var link = d3.svg.diagonal() var link = d3.svg.diagonal()
.projection(function(d) .projection(function(d)
{ {
return [d.y, d.x]; return [d.y, d.x];
}); });
   
   
layoutRoot.selectAll("path.link") layoutRoot.selectAll("path.link")
.data(links) .data(links)
.enter() .enter()
.append("svg:path") .append("svg:path")
.attr("class", "link") .attr("class", "link")
.attr("d", link); .attr("d", link);
   
   
/* /*
Nodes as Nodes as
<g class="node"> <g class="node">
<circle class="node-dot" /> <circle class="node-dot" />
<text /> <text />
</g> </g>
*/ */
var nodeGroup = layoutRoot.selectAll("g.node") var nodeGroup = layoutRoot.selectAll("g.node")
.data(nodes) .data(nodes)
.enter() .enter()
.append("svg:g") .append("svg:g")
.attr("class", "node") .attr("class", "node")
.attr("transform", function(d) .attr("transform", function(d)
{ {
return "translate(" + d.y + "," + d.x + ")"; return "translate(" + d.y + "," + d.x + ")";
}); });
   
nodeGroup.append("svg:circle") nodeGroup.append("svg:circle")
.attr("class", "node-dot") .attr("class", "node-dot")
.attr("r", options.nodeRadius); .attr("r", options.nodeRadius);
   
nodeGroup.append("svg:text") nodeGroup.append("svg:text")
.attr("text-anchor", function(d) .attr("text-anchor", function(d)
{ {
return d.children ? "end" : "start"; return d.children ? "end" : "start";
}) })
.attr("dx", function(d) .attr("dx", function(d)
{ {
var gap = 2 * options.nodeRadius; var gap = 2 * options.nodeRadius;
return d.children ? -gap : gap; return d.children ? -gap : gap;
}) })
.attr("dy", 3) .attr("dy", 3)
.text(function(d) .text(function(d)
{ {
return d.name; return d.name;
}); });
   
} }
$(function(){ $(function(){
buildTree("#tree-container"); buildTree("#tree-container");
}); });
</script> </script>
   
   
</body> </body>
</html> </html>
<?php <?php
   
include_once("../include/common.inc.php"); include_once("../include/common.inc.php");
   
function shortName($name) { function shortName($name) {
$name = trim($name); $name = trim($name);
if (strstr($name,"Minister ") || strstr($name,"Treasurer") || strstr($name,"Parliamentary Secretary")) { if (strstr($name,"Minister ") || strstr($name,"Treasurer") || strstr($name,"Parliamentary Secretary")) {
$badWords = Array ("Assisting the Prime Minister on","Assisting on"," the "," of "," for "," on "," and "," to ",","," ","'","`"); $badWords = Array ("Assisting the Prime Minister on","Assisting on"," the "," of "," for "," on "," and "," to ",","," ","'","`");
return str_replace($badWords,"",$name); return str_replace($badWords,"",$name);
} }
else { else {
$out = Array(); $out = Array();
preg_match_all('/[A-Z]/', $name, $out); preg_match_all('/[A-Z]/', $name, $out);
return implode("", $out[0]); return implode("", $out[0]);
} }
} }
   
setlocale(LC_CTYPE, 'C'); setlocale(LC_CTYPE, 'C');
   
$headers = Array("#id", "name", "request_email", "short_name", "notes", "publication_scheme", "home_page", "tag_string"); $headers = Array("#id", "name", "request_email", "short_name", "notes", "publication_scheme", "home_page", "tag_string");
   
$db = $server->get_db('disclosr-agencies'); $db = $server->get_db('disclosr-agencies');
   
$tag = Array(); $tag = Array();
try { try {
$rows = $db->get_view("app", "byDeptStateName", null, true)->rows; $rows = $db->get_view("app", "byDeptStateName", null, true)->rows;
//print_r($rows); //print_r($rows);
foreach ($rows as $row) { foreach ($rows as $row) {
$tag[$row->id] = phrase_to_tag(dept_to_portfolio($row->key)); $tag[$row->id] = phrase_to_tag(dept_to_portfolio($row->key));
} }
} catch (SetteeRestClientException $e) { } catch (SetteeRestClientException $e) {
setteErrorHandler($e); setteErrorHandler($e);
die(); die();
} }
   
$foiEmail = Array(); $foiEmail = Array();
try { try {
$rows = $db->get_view("app", "foiEmails", null, true)->rows; $rows = $db->get_view("app", "foiEmails", null, true)->rows;
//print_r($rows); //print_r($rows);
foreach ($rows as $row) { foreach ($rows as $row) {
$foiEmail[$row->key] = $row->value; $foiEmail[$row->key] = $row->value;
} }
} catch (SetteeRestClientException $e) { } catch (SetteeRestClientException $e) {
setteErrorHandler($e); setteErrorHandler($e);
die(); die();
} }
   
$fp = fopen('php://output', 'w'); $fp = fopen('php://output', 'w');
if ($fp && $db) { if ($fp && $db) {
header('Content-Type: text/csv; charset=utf-8'); header('Content-Type: text/csv; charset=utf-8');
header('Content-Disposition: attachment; filename="export.' . date("c") . '.csv"'); header('Content-Disposition: attachment; filename="export.' . date("c") . '.csv"');
header('Pragma: no-cache'); header('Pragma: no-cache');
header('Expires: 0'); header('Expires: 0');
fputcsv($fp, $headers); fputcsv($fp, $headers);
try { try {
$agencies = $db->get_view("app", "byCanonicalName", null, true)->rows; $agencies = $db->get_view("app", "byCanonicalName", null, true)->rows;
//print_r($rows); //print_r($rows);
foreach ($agencies as $agency) { foreach ($agencies as $agency) {
// print_r($agency); // print_r($agency);
   
if (isset($agency->value->foiEmail) && $agency->value->foiEmail != "null" && !isset($agency->value->status)) { if (isset($agency->value->foiEmail) && $agency->value->foiEmail != "null" && !isset($agency->value->status)) {
$row = Array(); $row = Array();
$row["#id"] = $agency->id; $row["#id"] = $agency->id;
$row["name"] = trim($agency->value->name); $row["name"] = trim($agency->value->name);
if (isset($agency->value->foiEmail)) { if (isset($agency->value->foiEmail)) {
$row["request_email"] = $agency->value->foiEmail; $row["request_email"] = $agency->value->foiEmail;
} else { } else {
if ($agency->value->orgType == "FMA-DepartmentOfState") { if ($agency->value->orgType == "FMA-DepartmentOfState") {
$row["request_email"] = "foi@" . GetDomain($agency->value->website); $row["request_email"] = "foi@" . GetDomain($agency->value->website);
} else { } else {
$row["request_email"] = $foiEmail[$agency->value->parentOrg]; $row["request_email"] = $foiEmail[$agency->value->parentOrg];
} }
} }
if (isset($agency->value->shortName)) { if (isset($agency->value->shortName)) {
$row["short_name"] = $agency->value->shortName; $row["short_name"] = $agency->value->shortName;
} else { } else {
$row["short_name"] = shortName($agency->value->name); $row["short_name"] = shortName($agency->value->name);
} }
$row["notes"] = ""; $row["notes"] = "";
$row["publication_scheme"] = (isset($agency->value->infoPublicationSchemeURL) ? $agency->value->infoPublicationSchemeURL : ""); $row["publication_scheme"] = (isset($agency->value->infoPublicationSchemeURL) ? $agency->value->infoPublicationSchemeURL : "");
$row["home_page"] = (isset($agency->value->website) ? $agency->value->website : ""); $row["home_page"] = (isset($agency->value->website) ? $agency->value->website : "");
if ($agency->value->orgType == "FMA-DepartmentOfState") { if ($agency->value->orgType == "FMA-DepartmentOfState") {
$row["tag_string"] = $tag[$agency->value->_id] . " " . $agency->value->orgType; $row["tag_string"] = $tag[$agency->value->_id] . " " . $agency->value->orgType;
} else { } else {
$row["tag_string"] = $tag[$agency->value->parentOrg] . " " . $agency->value->orgType; $row["tag_string"] = $tag[$agency->value->parentOrg] . " " . $agency->value->orgType;
} }
   
fputcsv($fp, array_values($row)); fputcsv($fp, array_values($row));
   
if (isset($agency->value->foiBodies)) { if (isset($agency->value->foiBodies)) {
foreach ($agency->value->foiBodies as $foiBody) { foreach ($agency->value->foiBodies as $foiBody) {
$row['name'] = iconv("UTF-8", "ASCII//TRANSLIT",$foiBody); $row['name'] = iconv("UTF-8", "ASCII//TRANSLIT",$foiBody);
$row["short_name"] = shortName($foiBody); $row["short_name"] = shortName($foiBody);
fputcsv($fp, array_values($row)); fputcsv($fp, array_values($row));
} }
} }
  if (isset($agency->value->positions)) {
  foreach ($agency->value->positions as $position) {
  $row['name'] = iconv("UTF-8", "ASCII//TRANSLIT",$position);
  $row["short_name"] = shortName($position);
  fputcsv($fp, array_values($row));
  }
  }
} }
} }
} catch (SetteeRestClientException $e) { } catch (SetteeRestClientException $e) {
setteErrorHandler($e); setteErrorHandler($e);
} }
   
die; die;
} }
?> ?>
   
   
<!DOCTYPE html> <!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"> <html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
<meta charset="UTF-8"/> <meta charset="UTF-8"/>
<title>Minimal BubbleTree Demo</title> <title>Minimal BubbleTree Demo</title>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.js"></script> <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.js"></script>
<script type="text/javascript" src="javascripts/bubbletree/lib/jquery.history.js"></script> <script type="text/javascript" src="js/bubbletree/lib/jquery.history.js"></script>
<script type="text/javascript" src="javascripts/bubbletree/lib/raphael.js"></script> <script type="text/javascript" src="js/bubbletree/lib/raphael.js"></script>
<script type="text/javascript" src="javascripts/bubbletree/lib/vis4.js"></script> <script type="text/javascript" src="js/bubbletree/lib/vis4.js"></script>
<script type="text/javascript" src="javascripts/bubbletree/lib/Tween.js"></script> <script type="text/javascript" src="js/bubbletree/lib/Tween.js"></script>
<script type="text/javascript" src="javascripts/bubbletree/build/bubbletree.js"></script> <script type="text/javascript" src="js/bubbletree/build/bubbletree.js"></script>
<link rel="stylesheet" type="text/css" href="javascripts/bubbletree/build/bubbletree.css" /> <link rel="stylesheet" type="text/css" href="js/bubbletree/build/bubbletree.css" />
<script type="text/javascript" src="javascripts/bubbletree/styles/cofog.js"></script> <script type="text/javascript" src="js/bubbletree/styles/cofog.js"></script>
   
   
<script type="text/javascript"> <script type="text/javascript">
$(function() { $(function() {
<?php <?php
include_once('include/common.inc.php'); include_once('include/common.inc.php');
   
include("lib/Color.php"); include("lib/Color.php");
$color = new Lux_Color(); $color = new Lux_Color();
   
$portfolios = Array(); $portfolios = Array();
$total = 0; $total = 0;
$db = $server->get_db('disclosr-agencies'); $db = $server->get_db('disclosr-agencies');
try { try {
$rows = $db->get_view("app", "byDeptStateName", null, true)->rows; $rows = $db->get_view("app", "byDeptStateName", null, true)->rows;
foreach ($rows as $row) { foreach ($rows as $row) {
$portfolios[trim(str_replace(Array("Department of", "Department", "the", "'", "`"), "", $row->key))] = $row->value; $portfolios[trim(str_replace(Array("Department of", "Department", "the", "'", "`"), "", $row->key))] = $row->value;
} }
} catch (SetteeRestClientException $e) { } catch (SetteeRestClientException $e) {
setteErrorHandler($e); setteErrorHandler($e);
} }
   
$agencies = Array(); $agencies = Array();
try { try {
$rows = $db->get_view("app", "byCanonicalName", null, true)->rows; $rows = $db->get_view("app", "byCanonicalName", null, true)->rows;
//print_r($rows); //print_r($rows);
foreach ($rows as $row) { foreach ($rows as $row) {
$employees = 0; $employees = 0;
$portfolioid = 0; $portfolioid = 0;
if (isset($row->value->employees)) { if (isset($row->value->employees)) {
$employees = $row->value->employees; $employees = $row->value->employees;
} }
if (isset($row->value->statistics->employees)) { if (isset($row->value->statistics->employees)) {
$agencyEmployeesArray = object_to_array($row->value->statistics->employees); $agencyEmployeesArray = object_to_array($row->value->statistics->employees);
if (isset($agencyEmployeesArray["2010-2011"]["value"])) { if (isset($agencyEmployeesArray["2010-2011"]["value"])) {
$employees = $agencyEmployeesArray["2010-2011"]["value"]; $employees = $agencyEmployeesArray["2010-2011"]["value"];
} else { } else {
// bailout for agencies that are closed for business // bailout for agencies that are closed for business
continue; continue;
} }
} }
if (!($employees > 0)) { if (!($employees > 0)) {
$employees = 0; $employees = 0;
} }
if (isset($row->value->parentOrg)) { if (isset($row->value->parentOrg)) {
$portfolioid = $row->value->parentOrg; $portfolioid = $row->value->parentOrg;
} }
if (isset($row->value->orgType) && $row->value->orgType == "FMA-DepartmentOfState") { if (isset($row->value->orgType) && $row->value->orgType == "FMA-DepartmentOfState") {
$portfolioid = $row->id; $portfolioid = $row->id;
} }
$agencies[$portfolioid][$row->value->name] = $employees; $agencies[$portfolioid][$row->value->name] = $employees;
} }
} catch (SetteeRestClientException $e) { } catch (SetteeRestClientException $e) {
setteErrorHandler($e); setteErrorHandler($e);
} }
//print_r($portfolios); //print_r($portfolios);
//print_r($agencies); //print_r($agencies);
   
// http://martin.ankerl.com/2009/12/09/how-to-create-random-colors-programmatically/ // http://martin.ankerl.com/2009/12/09/how-to-create-random-colors-programmatically/
$golden_ratio_conjugate = 0.618033988749895; $golden_ratio_conjugate = 0.618033988749895;
$h = 0.00+rand(0,10)/10; # use random start value $h = 0.00+rand(0,10)/10; # use random start value
foreach ($portfolios as $portfolioName => $portfolioID) { foreach ($portfolios as $portfolioName => $portfolioID) {
$h += $golden_ratio_conjugate; $h += $golden_ratio_conjugate;
$h = fmod($h,1); $h = fmod($h,1);
$portfolioColor = $color->hsv2hex(Array($h, .3, .99)); $portfolioColor = $color->hsv2hex(Array($h, .3, .99));
$subnodes = Array(); $subnodes = Array();
$portfolioEmployees = 0; $portfolioEmployees = 0;
foreach ($agencies[$portfolioID] as $agencyName => $agencyEmployees) { foreach ($agencies[$portfolioID] as $agencyName => $agencyEmployees) {
$agencyColor = $color->hsv2hex(Array($h / 10, rand(1, 10) / 10, abs(($h * (1 / 10)) - .5) + .5)); $agencyColor = $color->hsv2hex(Array($h / 10, rand(1, 10) / 10, abs(($h * (1 / 10)) - .5) + .5));
$subnodes[] = Array( $subnodes[] = Array(
"label" => str_replace(Array("'", "`"), "", $agencyName), "label" => str_replace(Array("'", "`"), "", $agencyName),
"amount" => $agencyEmployees, "amount" => $agencyEmployees,
//"color" => "#" . $agencyColor //"color" => "#" . $agencyColor
); );
$portfolioEmployees += $agencyEmployees; $portfolioEmployees += $agencyEmployees;
} }
$nodes[] = Array( $nodes[] = Array(
"label" => $portfolioName, "label" => $portfolioName,
"amount" => $portfolioEmployees, "amount" => $portfolioEmployees,
//"color" => "#" . $portfolioColor, //"color" => "#" . $portfolioColor,
"children" => $subnodes "children" => $subnodes
); );
$total += $portfolioEmployees; $total += $portfolioEmployees;
} }
$data = Array( $data = Array(
"label" => "Australian Federal Government", "label" => "Australian Federal Government",
"amount" => $total, "amount" => $total,
//"color" => "#000000", //"color" => "#000000",
"children" => $nodes "children" => $nodes
); );
echo "var data =eval('('+'" . json_encode($data) . "'+')');"; echo "var data =eval('('+'" . json_encode($data) . "'+')');";
?> ?>
   
new BubbleTree({ new BubbleTree({
data: data, data: data,
container: '.bubbletree' container: '.bubbletree'
}); });
}); });
</script> </script>
</head> </head>
<body> <body>
<div class="bubbletree-wrapper"> <div class="bubbletree-wrapper">
<div class="bubbletree"></div> <div class="bubbletree"></div>
</div> </div>
</body> </body>
</html> </html>
   
file:a/graph.php -> file:b/graph.php
<?php <?php
include_once('include/common.inc.php'); include_once('include/common.inc.php');
//include_header(); //include_header();
$format = "html"; $format = "html";
if (isset($_REQUEST['format'])) { if (isset($_REQUEST['format'])) {
$format = $_REQUEST['format']; $format = $_REQUEST['format'];
} }
   
function add_node($id, $label, $parent="") { function add_node($id, $label, $parent="") {
global $format; global $format;
if ($format == "html") { if ($format == "html") {
// echo "nodes[\"$id\"] = graph.newNode({label: \"$label\"});" . PHP_EOL; // echo "nodes[\"$id\"] = graph.newNode({label: \"$label\"});" . PHP_EOL;
} }
if ($format == "dot" && $label != "") { if ($format == "dot" && $label != "") {
echo "$id [label=\"$label\"];". PHP_EOL; echo "$id [label=\"$label\"];". PHP_EOL;
} }
if ($format == "gexf") { if ($format == "gexf") {
echo "<node id='$id' label=\"".htmlentities($label,ENT_XML1)."\" ".($parent != ""? "pid='$parent'><viz:size value='1'/>":"><viz:size value='2'/>") echo "<node id='$id' label=\"".htmlentities($label,ENT_XML1)."\" ".($parent != ""? "pid='$parent'><viz:size value='1'/>":"><viz:size value='2'/>")
."<viz:color b='".rand(0,255)."' g='".rand(0,255)."' r='".rand(0,255)."'/>" ."<viz:color b='".rand(0,255)."' g='".rand(0,255)."' r='".rand(0,255)."'/>"
."</node>". PHP_EOL; ."</node>". PHP_EOL;
} }
} }
   
function add_edge($from, $to, $color) { function add_edge($from, $to, $color) {
global $format; global $format;
if ($format == "html") { if ($format == "html") {
// echo "graph.newEdge(nodes[\"$from\"], nodes['$to'], {color: '$color'});" . PHP_EOL; // echo "graph.newEdge(nodes[\"$from\"], nodes['$to'], {color: '$color'});" . PHP_EOL;
} }
if ($format == "dot") { if ($format == "dot") {
echo "$from -> $to ".($color != ""? "[color=$color]":"").";". PHP_EOL; echo "$from -> $to ".($color != ""? "[color=$color]":"").";". PHP_EOL;
} }
if ($format == "gexf") { if ($format == "gexf") {
echo "<edge id='$from$to' source='$from' target='$to' />". PHP_EOL; echo "<edge id='$from$to' source='$from' target='$to' />". PHP_EOL;
} }
} }
if ($format == "gexf") { if ($format == "gexf") {
//header('Content-Type: text/xml'); //header('Content-Type: text/xml');
header('Content-Type: application/gexf+xml'); header('Content-Type: application/gexf+xml');
echo '<?xml version="1.0" encoding="UTF-8"?> echo '<?xml version="1.0" encoding="UTF-8"?>
<gexf xmlns="http://www.gexf.net/1.2draft" xmlns:viz="http://www.gexf.net/1.2draft/viz" version="1.2"> <gexf xmlns="http://www.gexf.net/1.2draft" xmlns:viz="http://www.gexf.net/1.2draft/viz" version="1.2">
<meta lastmodifieddate="2009-03-20"> <meta lastmodifieddate="2009-03-20">
<creator>Gexf.net</creator> <creator>Gexf.net</creator>
<description>A hello world! file</description> <description>A hello world! file</description>
</meta> </meta>
<graph mode="static" defaultedgetype="directed"> <graph mode="static" defaultedgetype="directed">
<nodes>'. PHP_EOL; <nodes>'. PHP_EOL;
} }
   
if ($format == "dot") { if ($format == "dot") {
echo 'digraph g {'. PHP_EOL; echo 'digraph g {'. PHP_EOL;
} }
$db = $server->get_db('disclosr-agencies'); $db = $server->get_db('disclosr-agencies');
add_node("fedg","Federal Government - Commonwealth of Australia"); add_node("fedg","Federal Government - Commonwealth of Australia");
try { try {
$rows = $db->get_view("app", "byCanonicalName", null, true)->rows; $rows = $db->get_view("app", "byCanonicalName", null, true)->rows;
//print_r($rows); //print_r($rows);
foreach ($rows as $row) { foreach ($rows as $row) {
add_node($row->id, $row->key); add_node($row->id, $row->key);
} }
} catch (SetteeRestClientException $e) { } catch (SetteeRestClientException $e) {
setteErrorHandler($e); setteErrorHandler($e);
} }
if ($format == "gexf") { if ($format == "gexf") {
echo '</nodes> echo '</nodes>
<edges>'. PHP_EOL; <edges>'. PHP_EOL;
} }
try { try {
$rows = $db->get_view("app", "byDeptStateName", null, true)->rows; $rows = $db->get_view("app", "byDeptStateName", null, true)->rows;
//print_r($rows); //print_r($rows);
foreach ($rows as $row) { foreach ($rows as $row) {
add_edge("fedg", $row->value, 'yellow'); add_edge("fedg", $row->value, 'yellow');
} }
} catch (SetteeRestClientException $e) { } catch (SetteeRestClientException $e) {
setteErrorHandler($e); setteErrorHandler($e);
} }
   
try { try {
$rows = $db->get_view("app", "parentOrgs", null, true)->rows; $rows = $db->get_view("app", "parentOrgs", null, true)->rows;
// print_r($rows); // print_r($rows);
foreach ($rows as $row) { foreach ($rows as $row) {
add_edge($row->key, $row->value, 'blue'); add_edge($row->key, $row->value, 'blue');
} }
} catch (SetteeRestClientException $e) { } catch (SetteeRestClientException $e) {
setteErrorHandler($e); setteErrorHandler($e);
} }
if ($format == "html") { if ($format == "html") {
?> ?>
<div id="sigma-example" width="960" style="min-height:800px;background-color: #333;"></div> <div id="sigma-example" width="960" style="min-height:800px;background-color: #333;"></div>
<script src="javascripts/sigma.min.js"></script> <script src="js/sigma.min.js"></script>
<script src="javascripts/sigma/plugins/sigma.parseGexf.js"></script> <script src="js/sigma/plugins/sigma.parseGexf.js"></script>
<script src="javascripts/sigma/plugins/sigma.forceatlas2.js"></script> <script src="js/sigma/plugins/sigma.forceatlas2.js"></script>
<script type="text/javascript">function init() { <script type="text/javascript">function init() {
// Instanciate sigma.js and customize rendering : // Instanciate sigma.js and customize rendering :
var sigInst = sigma.init(document.getElementById('sigma-example')).drawingProperties({ var sigInst = sigma.init(document.getElementById('sigma-example')).drawingProperties({
defaultLabelColor: '#fff', defaultLabelColor: '#fff',
defaultLabelSize: 14, defaultLabelSize: 14,
defaultLabelBGColor: '#fff', defaultLabelBGColor: '#fff',
defaultLabelHoverColor: '#000', defaultLabelHoverColor: '#000',
labelThreshold: 6, labelThreshold: 6,
defaultEdgeType: 'curve' defaultEdgeType: 'curve'
}).graphProperties({ }).graphProperties({
minNodeSize: 0.5, minNodeSize: 0.5,
maxNodeSize: 5, maxNodeSize: 5,
minEdgeSize: 5, minEdgeSize: 5,
maxEdgeSize: 5 maxEdgeSize: 5
}).mouseProperties({ }).mouseProperties({
maxRatio: 32 maxRatio: 32
}); });
   
// Parse a GEXF encoded file to fill the graph // Parse a GEXF encoded file to fill the graph
// (requires "sigma.parseGexf.js" to be included) // (requires "sigma.parseGexf.js" to be included)
sigInst.parseGexf('graph.php?format=gexf'); sigInst.parseGexf('graph.php?format=gexf');
sigInst.bind('downnodes',function(event){ sigInst.bind('downnodes',function(event){
var nodes = event.content; var nodes = event.content;
}); });
// Start the ForceAtlas2 algorithm // Start the ForceAtlas2 algorithm
// (requires "sigma.forceatlas2.js" to be included) // (requires "sigma.forceatlas2.js" to be included)
sigInst.startForceAtlas2(); sigInst.startForceAtlas2();
// Draw the graph : // Draw the graph :
sigInst.draw(); sigInst.draw();
} }
   
if (document.addEventListener) { if (document.addEventListener) {
document.addEventListener("DOMContentLoaded", init, false); document.addEventListener("DOMContentLoaded", init, false);
} else { } else {
window.onload = init; window.onload = init;
} }
</script> </script>
   
<?php <?php
} }
if ($format == "dot") { if ($format == "dot") {
echo "}"; echo "}";
} }
if ($format == "gexf") { if ($format == "gexf") {
echo ' </edges> echo ' </edges>
</graph> </graph>
</gexf>'. PHP_EOL; </gexf>'. PHP_EOL;
} }
//include_footer(); //include_footer();
?> ?>
   
   
<?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 rel="stylesheet" href="<?php echo $basePath ?>stylesheets/foundation.css"> <link rel="stylesheet" href="<?php echo $basePath ?>stylesheets/foundation.css">
<link rel="stylesheet" href="<?php echo $basePath ?>stylesheets/app.css"> <link rel="stylesheet" href="<?php echo $basePath ?>stylesheets/app.css">
   
<!--[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/">
   
<!-- navBar --> <!-- navBar -->
<div id="navbar" class="container"> <div id="navbar" class="container">
<div class="row"> <div class="row">
<div class="four columns"> <div class="four columns">
<h1><a href="/">Disclosr</a></h1> <h1><a href="/">Disclosr</a></h1>
</div> </div>
<div class="eight columns hide-on-phones"> <div class="eight columns hide-on-phones">
<strong class="right"> <strong class="right">
<a href="getAgency.php">Agencies</a> <a href="getAgency.php">Agencies</a>
<a href="about.php">About/FAQ</a> <a href="about.php">About/FAQ</a>
</strong> </strong>
</div> </div>
</div> </div>
</div> </div>
<!-- /navBar --> <!-- /navBar -->
   
<!-- container --> <!-- container -->
<div class="container"> <div class="container">
<?php } <?php }
   
function include_footer() { function include_footer() {
global $basePath; global $basePath;
?> ?>
</div> </div>
<!-- container --> <!-- container -->
   
   
   
   
<!-- Included JS Files --> <!-- Included JS Files -->
<script src="<?php echo $basePath; ?>javascripts/foundation.js"></script> <script src="<?php echo $basePath; ?>js/foundation.js"></script>
<script src="<?php echo $basePath; ?>javascripts/app.js"></script> <script src="<?php echo $basePath; ?>js/app.js"></script>
<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="javascripts/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 }
} }