includes/nav cleanup
[disclosr.git] / getAgency.php
blob:a/getAgency.php -> blob:b/getAgency.php
--- a/getAgency.php
+++ b/getAgency.php
@@ -33,7 +33,13 @@
             } if (strpos($key, "has") === 0) {
                 echo "<label for='$key'><input type='checkbox' id='$key' name='$key' value='$value'> $key</label>";
             } else {
-                echo "<label>$key</label><input  class='input-text' type='text' id='$key' name='$key' value='$value'/></tr>";
+                echo "<label>$key</label><input  class='input-text' type='text' id='$key' name='$key' value='$value'/>";
+                if ((strpos($key,"URL") > 0 || $key == 'website')&& $value != "") {
+                   echo "<a href='$value'>view</a>"; 
+                }
+                if ($key == 'abn') {
+                   echo "<a href='http://www.abr.business.gov.au/SearchByAbn.aspx?SearchText=$value'>view abn</a>";
+                }
             }
         }
     }
@@ -62,7 +68,9 @@
         //print_r($_POST);
         if (isset($_POST['_id']) && $db->get_rev($_POST['_id']) == $_POST['_rev']) {
             echo "Edited version was latest version, continue saving";
-            $row = $db->save($_POST);
+            $newdoc = $_POST;
+            $newdoc['metadata']['lastModified'] = time();
+            $row = $db->save($newdoc);
         } else {
             echo "ALERT doc revised by someone else while editing.";
         }