--- a/getAgency.php +++ b/getAgency.php @@ -4,12 +4,13 @@ function displayValue($key, $value, $mode) { global $db, $schemas; + $ignoreKeys = Array("metadata" ,"metaTags", "statistics","rtkURLs","rtkDescriptions"); if ($mode == "view") { - if (strpos($key, "_") === 0 || $key == "metadata") + if (strpos($key, "_") === 0 || in_array($key,$ignoreKeys)) return; echo ""; - echo ""; + echo ""; if (isset($schemas['agency']["properties"][$key])) { echo $schemas['agency']["properties"][$key]['x-title'] . "
" . $schemas['agency']["properties"][$key]['description'] . ""; } @@ -119,7 +120,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); @@ -159,8 +160,38 @@ } if ($mode == "view") { - echo '
'; - echo '"; + echo '
+
+
+ +
+
'; + echo '
'; + echo '
+

' . $row['name'] . '

'; + if (isset($row['description'])) { + echo '

'.$row['description'].'

'; + } + echo '

' . $row['name'] . "

'; echo ""; } if ($mode == "edit") { @@ -192,6 +223,10 @@ } if ($mode == "view") { echo "
Field NameField Value
"; + echo ' + + + '; } if ($mode == "edit") { echo ''; @@ -199,30 +234,45 @@ } else { // show all list include_header('Agencies'); + echo '
+
+
+ +
+
+
+

Australian Government Agencies

+

Explore collected information about Australian Government Agencies below.

+ +
+
+
'; try { - /* $rows = $db->get_view("app", "showNamesABNs")->rows; - //print_r($rows); - foreach ($rows as $row) { - // print_r($row); - echo '
  • ' . - (isset($row->value->name) && $row->value->name != "" ? $row->value->name : "NO NAME " . $row->value->abn) - . '
  • '; - } */ $rows = $db->get_view("app", "byCanonicalName")->rows; //print_r($rows); - echo '
      '; - foreach ($rows as $row) { + $rowCount = count($rows); + foreach ($rows as $i => $row) { + if ($i % ($rowCount/3) == 0 && $i != 0 && $i != $rowCount -2 ) echo '
    '; // print_r($row); - echo '
  • + echo '
  • '; - } - echo ""; + (isset($row->value->name) ? $row->value->name : "ERROR NAME MISSING") + . '

    '; + } + } catch (SetteeRestClientException $e) { setteErrorHandler($e); } + echo '
    +
    +
    +
    '; } + include_footer(); ?>