ausaid scraper
[disclosr.git] / getAgency.php
blob:a/getAgency.php -> blob:b/getAgency.php
--- a/getAgency.php
+++ b/getAgency.php
@@ -119,7 +119,7 @@
 // edit?
 
     $obj = $db->get($_REQUEST['id']);
-    include_header($obj->name);
+    include_header(isset($obj->name) ? $obj->name : "");
 //print_r($row);
     if (sizeof($_POST) > 0) {
 //print_r($_POST);
@@ -200,14 +200,6 @@
 // show all list
     include_header('Agencies');
     try {
-        /* $rows = $db->get_view("app", "showNamesABNs")->rows;
-          //print_r($rows);
-          foreach ($rows as $row) {
-          //   print_r($row);
-          echo '<li><a href="getAgency.php?id=' . $row->key . '">' .
-          (isset($row->value->name) && $row->value->name != "" ? $row->value->name : "NO NAME " . $row->value->abn)
-          . '</a></li>';
-          } */
         $rows = $db->get_view("app", "byCanonicalName")->rows;
         //print_r($rows);
         echo '<ul>';
@@ -215,7 +207,7 @@
             //   print_r($row);
             echo '<li itemscope itemtype="http://schema.org/GovernmentOrganization" typeof="schema:GovernmentOrganization foaf:Organization" about="getAgency.php?id=' . $row->value->_id . '">
 <a href="getAgency.php?id=' . $row->value->_id . '" rel="schema:url foaf:page" property="schema:name foaf:name" itemprop="url"><span itemprop="name">' .
-            $row->value->name
+            (isset($row->value->name) ? $row->value->name : "ERROR NAME MISSING") 
             . '</span></a></li>';
         }
         echo "</ul>";