Prettier JQuery tables
Prettier JQuery tables

--- a/admin/import.php
+++ b/admin/import.php
@@ -1,120 +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 if (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++;
-else if (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++;
-else if (strpos(mysql_error(),"Duplicate entry") === false) 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/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-392F50E0E94CB076|Inspector-General of Taxation','D3174EBA-F3C0-28E6-7A669C23CF0B3040|IP Australia','0ECAB5DF-B75F-EC35-92EA7821EFF77C0D|Medicare Australia','0ECB74A7-BE11-FC3C-8696F7F93D7612C0|Migration Review Tribunal and Refugee Review Tribunal (MRT-RRT)','F8E42DAB-9570-A008-97294775650CCE6E|Murray-Darling Basin Authority','0A18A552-0B56-257B-70BE077385CE2EDC|National Archives of Australia','0ECA8CEA-08C9-6D55-C57A7A102DFFBC8A|National Blood Authority','D2347B3A-F330-0317-68AB0C4F7240B9A5|National Capital Authority','0ECB3416-FEB1-F5E0-FB4760831CA2F66E|National Competition Council','7DEE189B-0A00-07D1-2D1C778EDAEFEF6D|National Film and Sound Archive','D2E7830B-9692-3124-1C2E1D74AAC8FFFF|National Gallery of Australia','0ECA957E-E479-2758-528FA4E576A27A5D|National Health and Medical Research Council','D2EA1497-0BB3-AFBD-76559FA87101FF06|National Library of Australia','D2EC2CF2-FEEE-8FB2-46193EDF8EA2F503|National Museum of Australia','0EC92A40-B2DA-D4FF-16895BCD00F9E20F|National Native Title Tribunal','D33DB6EB-FEE1-F686-7385E65E48749DD2|National Offshore Petroleum Safety Authority','D2EF702D-EF9B-B363-BDA3A4950C5ED57F|National Water Commission','0ECB00AF-04FE-735D-82D0B84D1A19F95A|Office of National Assessments','0EC93653-9FCE-12DD-DAAC73E23DCAE8CA|Office of Parliamentary Counsel','0ECB48E3-9198-6F2C-9737A69F9D15177A|Office of the Auditing and Assurance Standards Board','0ECB4CD6-A6D6-4334-D550948337CE9F56|Office of the Australian Accounting Standards Board','D25ACD14-ABA3-F69F-E1ADA4503ED97C82|Office of the Australian Building and Construction Commissioner (ABCC)','D331236A-BDE0-5CD7-24EF78F052CB2B50|Office of the Australian Information Commissioner','0ECAF6CA-ACBE-E3E7-6DCBF175E012F817|Office of the Commonwealth Ombudsman','0EC93B4D-DC77-6FA0-7E15530A7D7344CB|Office of the Director of Public Prosecutions','39DCC587-FF78-8759-E91BF5B9EC3D1904|Office of the Fair Work Ombudsman','0ECB049D-B7DC-1697-586AB4455B0DF251|Office of the Inspector-General of Intelligence and Security','0ECB0887-D30E-E490-3F16BCB7EF406D8E|Office of the Official Secretary to the Governor-General','E0EAE43E-B918-12DC-9F4E0E03811CACAD|Office of the Renewable Energy Regulator','D726F8EA-D648-B4DF-E25FF1EEE68C9700|Old Parliament House','87A575EB-E6CE-7E8B-1CB3D9B6580FAE5B|Private Health Insurance Ombudsman','0ECB380B-FC93-8003-9A1F04BD55A10F62|Productivity Commission','0ECA9978-D7C8-3F44-2D21C2827407BEF5|Professional Services Review','0ECB64C5-E6E4-3D23-B4409B18EB609B25|Reserve Bank of Australia','0ECB4106-02BC-64C6-1DF8032E549D88E4|Royal Australian Mint','4A350604-FD8E-C7BB-D6C6A14AEE6D8873|Safe Work Australia','D25D96A7-B9B7-21D2-57AA60EAC138107B|Seacare','D2FF2257-0E69-4B7C-FCF6AB672ECC341C|Social Security Appeals Tribunal','D2F16C5B-BCFB-E14D-9B62DEEDF992798B|Sydney Harbour Federation Trust','0ECA84C7-D6C3-3299-9F898B9C201D771B|Therapeutic Goods Administration','D340FD88-0AFE-B091-1F43D9EDBCE164D4|Tourism Australia','EB74EB82-AA02-F70B-DC648859ABFC28DA|Wheat Exports Australia');
 
-$suspended = Array('Airservices Australia','Australia Council for the Arts','Australia-Japan Foundation','Australian Antarctic Division','Australian Broadcasting Corporation','Australian Communications and Media Authority (ACMA)','Australian Electoral Commission','Australian Fair Pay Commission','Australian Film Commission','Australian Film Television and Radio School','Australian Industrial Registry','Australian Institute of Aboriginal and Torres Strait Islander Studies (AIATSIS)','Australian Institute of Family Studies','Australian Institute of Marine Science','Australian Maritime Safety Authority','Australian National Maritime Museum','Australian Nuclear Science and Technology Organisation (ANSTO)','Australian Research Council','Australian Reward Investment Alliance (ARIA)','Australian Sports Anti-Doping Authority (ASADA)','Bureau of Meteorology','Child Support Agency','Civil Aviation Safety Authority','Comcare','Commonwealth Grants Commission','Comsuper','CSIRO','Dairy Adjustment Authority','Department of Communications, Information Technology and the Arts','Department of Education, Science and Training','Department of Employment and Workplace Relations','Department of Families, Community Services & Indigenous Affairs','Department of Finance and Administration','Department of Industry, Tourism and Resources','Department of the Environment and Water Resources','Department of Transport and Regional Services','Director of National Parks','Equal Opportunity for Women in the Workplace Agency','Export Wheat Commission','Future Fund Management Agency','Geoscience Australia','Great Barrier Reef Marine Park Authority','IP Australia','National Archives of Australia','National Archives of Australia','National Capital Authority','National Gallery of Australia','National Library of Australia','National Museum of Australia','National Offshore Petroleum Safety Authority','National Water Commission','National Water Commission','Office of Film and Literature Classification','Office of the Australian Building and Construction Commissioner (ABCC)','Office of the Privacy Commissioner','Office of the Renewable Energy Regulator','Office of Workplace Services','Questacon','Refugee Review Tribunal','Seacare','Social Security Appeals Tribunal','Sydney Harbour Federation Trust','The National Institute of Clinical Studies Ltd','Tourism Australia','Workplace Ombudsman');
+$suspended = Array('8B346DD0-D9A5-585C-1B3174A9B6292AD1|Aboriginal and Torres Strait Islander Services','0ECB16D3-9684-471C-3FFBCCCAB63728B4|Airservices Australia','0EC975AC-F94D-B8B5-FDF5CF053D78F7EA|Australia Council for the Arts','0ECA7934-9725-0D31-1BD08C6ADFD16040|Australia-Japan Foundation','0ECA043A-C02D-1838-E994DF3EC8B0A857|Australian Antarctic Division','0EC96B6B-9A30-F9E4-892DA6860B3985B2|Australian Broadcasting Corporation','0EC9521F-C38A-2FB1-54CEF555CE76807A|Australian Communications and Media Authority (ACMA)','0ECA48E7-B536-E530-CA1F4F8A4056517F|Australian Electoral Commission','0EC9D8CD-D6F8-A695-854B714011D9B2E8|Australian Fair Pay Commission','0EC9703D-9C88-C7FF-E15390103B51CE22|Australian Film Commission','D27DB409-E5C9-15AD-635A70CEF5A8E05C|Australian Film Commission','0EC96705-AED6-462D-E1579FE99DD57511|Australian Film Television and Radio School','D27F93E1-9898-8ED5-5DF9628A1CE78BBF|Australian Film Television and Radio School','0EC9DCED-ED0B-FF25-20323EF5E93EC88E|Australian Industrial Registry','0EC9BF9B-C83C-4EC5-DDE3C845EBF3CCC0|Australian Institute of Aboriginal and Torres Strait Islander Studies (AIATSIS)','D246AE91-0DD2-193E-84F9A3E13664E58E|Australian Institute of Aboriginal and Torres Strait Islander Studies (AIATSIS)','0ECA2851-AD46-9261-B3A77D28C5CC1351|Australian Institute of Family Studies','0EC9BB58-BBA8-3F3D-AD04CBFE4FABC85D|Australian Institute of Marine Science','0ECB1ACC-FAAC-3895-9EC179BC71C3FC54|Australian Maritime Safety Authority','0EC9611A-C5D2-43B5-D4039EED991272E3|Australian National Maritime Museum','0EC9C3D2-CE1C-8C81-085ADA97E2172420|Australian Nuclear Science and Technology Organisation (ANSTO)','0EC9B71F-EDBC-5E42-E44D5595BDF7B3F4|Australian Research Council','0ECA59B7-D4C6-360D-4829CB8A5E15B664|Australian Reward Investment Alliance (ARIA)','0EC95958-08E9-4A16-A79AC1CB828B9535|Australian Sports Anti-Doping Authority (ASADA)','0EC8C3DE-B6EB-88B8-0FD9460AC543DD0C|Biosecurity Australia','0ECA1921-EA6F-1BE2-3E85DBF7BBCDE734|Bureau of Meteorology','0ECAC142-B8B8-CCE0-A4B00E4B67ED0DCB|Child Support Agency','0ECB1FED-D2C6-6214-2CEB31CE9B107ED1|Civil Aviation Safety Authority','0EC9D499-F2DE-F8D9-0239ACA17C2ABFBB|Comcare','0ECA55A3-A0B2-0D36-D383E6A113AD5749|Commonwealth Grants Commission','0ECA4CF9-9312-2F3D-637C98CF2FEEB5A4|Comsuper','0EC9C7FE-F7AC-09BD-3C498B63A9DDDDA4|CSIRO','0EC8B354-F006-A824-A43120384BE56A98|Dairy Adjustment Authority','D3328CCE-DEA4-5516-AA23F77F557454FC|Department of Climate Change','0EC94B72-AD24-B695-3C5C388FBC0C23AA|Department of Communications, Information Technology and the Arts','0EC9B2BB-D5C8-8061-8CC999143D0D291C|Department of Education, Science and Training','0EC9CE2C-A998-C45A-90697489AC42B83B|Department of Employment and Workplace Relations','0ECA21F5-F5FE-7F08-52CD6FFB54E788FE|Department of Families, Community Services & Indigenous Affairs','0ECA32E7-E860-DFD4-0FBDCE1CC8E0FC84|Department of Finance and Administration','8B3539BA-EC97-7510-AF049F389DC0497A|Department of Immigration and Multicultural Affairs','8B361B4A-EAAE-D747-134D9FA97497C70F|Department of Immigration and Multicultural and Indigenous Affairs (DIMIA)','0ECACF65-D93B-D892-1862B65F15C92A6A|Department of Industry, Tourism and Resources','CE419954-CB32-1154-9E61EDB5805C222D|Department of Infrastructure, Transport, Regional Development and Local Government','0EC9F8FB-F224-1E70-F59834C1D5CE12D5|Department of the Environment and Water Resources','D2DFCF42-A87B-181C-2F48D7EEE8849AFD|Department of the Environment, Water, Heritage and the Arts','0ECB0EE4-9D78-A341-363B0D13161C5916|Department of Transport and Regional Services','0ECA0863-0F4E-5FA8-B7C522D16CCAC9BB|Director of National Parks','0EC90E81-DAF0-F67A-7FDC1AE664FF0BEE|Emergency Management Australia','0EC9E429-9FFF-7E05-41ADCC29FE17811C|Equal Opportunity for Women in the Workplace Agency','576FCE5F-E258-4A5C-92C11639C73A0442|Export Wheat Commission','0ECA518C-EF07-86F5-ADCAA84198009116|Future Fund Management Agency','0ECAE1C5-E249-022B-DCC7D944F398E1FD|Geoscience Australia','0ECA0CF1-AEF7-5C78-23878C6A5BF93C36|Great Barrier Reef Marine Park Authority','0ECADD52-F400-97E8-25F98B9FF96FFD08|IP Australia','0EC8D025-D94D-FF1D-97130B40320BAD9A|Land and Water Australia','0EC98433-EB5E-BEB1-1EEC7CADF83918A0|National Archives of Australia','CD603E31-CD1F-AAE5-F233F954A031553E|National Archives of Australia','0ECB12DC-BF41-FF5B-CB306CF040EC3218|National Capital Authority','0EC97A03-EA2E-5AE3-EC3C2C23487ECECA|National Gallery of Australia','0EC98880-F5F1-6560-605A0250EA58D139|National Library of Australia','0EC97FE7-E894-67B2-A8CE40DEF409AC23|National Museum of Australia','0ECAD957-B214-674F-3C94DEEF52BA3F46|National Offshore Petroleum Safety Authority','0ECAFC83-0B5D-045A-EE43EA12B9953CC0|National Water Commission','48499BD1-AFE0-1093-EF06293D78B3FD65|National Water Commission','0EC92FD3-F7B3-B0E0-9A8D8D2B611BB615|Office of Film and Literature Classification','0EC9E84A-A9F7-4EEF-5DDD2FC87C1F1B55|Office of the Australian Building and Construction Commissioner (ABCC)','0EC940DD-9A7E-1ECD-B44DDA0B72B2407F|Office of the Privacy Commissioner','0ECA10FE-AC03-80D8-C8DF1069C707351E|Office of the Renewable Energy Regulator','D3362537-FE00-1892-B408CABF5E0257A7|Office of the Renewable Energy Regulator','0EC9F2EC-C778-46D0-F15FDB1A8F1552F9|Office of Workplace Services','FB2A3EA0-D6FC-DB1D-19B0B72180A8A19B|Questacon','D329A60A-E914-FB37-FBA853A4CE8558EB|Questacon','0ECB788C-CC5C-2969-4B94EFB3913B0E65|Refugee Review Tribunal','A2A6EBF4-A8F5-E60B-5C25ACD3EA0679D8|Screen Australia','0EC9EC88-9B12-CB63-56A58BE69BDF3B6F|Seacare','0ECA2CE0-CBA9-9E13-AA0FB347CF4B5FD1|Social Security Appeals Tribunal','0ECA1510-B4A2-BBA4-D6FDE37DFAAC7C12|Sydney Harbour Federation Trust','0ECAA587-C851-4038-8CDC9CCE9A28F6E6|The National Institute of Clinical Studies Ltd','0ECAD567-E1E7-F5FC-72BA34FDF72F0FC0|Tourism Australia','7A592345-0410-DF1C-4B349EA35F314D3F|Workplace Authority','003B8DE1-D09A-D72F-28CEBC19DB84E866|Workplace Ombudsman','D260B27E-9744-EF72-C065072F24B4A62A|Workplace Ombudsman');
 
 foreach ($active as $agency ) {
+	$agencyParts = explode("|",$agency);
+	$agency = $agencyParts[1];
+	$agencyInsert = "INSERT INTO agency (agencyName) VALUES ('$agency')";
+	$result = mysql_query($agencyInsert);
 	$result = mysql_query("UPDATE agency SET status = 'active' where agencyName = '".mysql_real_escape_string($agency)."';") ;
 	if ($result) echo $agency. " set to active in ". mysql_affected_rows() . " divisions/branches <br>\n";
 	else echo "error".mysql_error();
 }
 foreach ($suspended as $agency) {
+	$agencyParts = explode("|",$agency);
+	$agency = $agencyParts[1];
+	$agencyInsert = "INSERT INTO agency (agencyName) VALUES ('$agency')";
+	$result = mysql_query($agencyInsert);
 	$result = mysql_query("UPDATE agency SET status = 'suspended' where agencyName = '".mysql_real_escape_string($agency)."';") ;
 	if ($result) echo $agency. " set to suspended in ". mysql_affected_rows() . " divisions/branches <br>\n";
 	else echo "error".mysql_error();

--- a/admin/setAgencyURLABN.php
+++ b/admin/setAgencyURLABN.php
@@ -26,9 +26,10 @@
   $result = mysql_query("UPDATE agency SET website = 'http://" . $result->visibleUrl . "', abn = '{$abn[0]}' WHERE agencyName = '$agency';");
   if ($result) echo $agency . " set in " . mysql_affected_rows() . " <br>\n";
   } else {
+	
 	echo "invalid ABN";
 	$result = mysql_query("UPDATE agency SET website = 'http://" . $result->visibleUrl . "' WHERE agencyName = '$agency';");
-  if ($result) echo $agency . " set in " . mysql_affected_rows() . " <br>\n";
+	if ($result) echo $agency . " set in " . mysql_affected_rows() . " <br>\n";
   }
   // fi
   

--- a/cutenews/data/.htaccess
+++ b/cutenews/data/.htaccess

--- a/cutenews/data/emoticons/.htaccess
+++ b/cutenews/data/emoticons/.htaccess

file: