full text description search
[contractdashboard.git] / admin / import.php
blob:a/admin/import.php -> blob:b/admin/import.php
--- a/admin/import.php
+++ b/admin/import.php
@@ -86,8 +86,7 @@
         "Agency Postcode" => "contactPostcode",
         "" => ""
     );
-    
-    $headers;
+
 
     while (($data = fgetcsv($handle, 1000, "\t")) !== false) {
         $num = count($data);
@@ -172,7 +171,7 @@
     }
     ksort($files);
     foreach ($files as $date => $fname) {
-        echo "<a href=\"import.php?fname=$fname\">$fname</a>&nbsp;" . filesize($path . $fname) . "&nbsp;" . $date . "<br/>";
+        echo "<a href=\"importdatagov.php?fname=$fname\">$fname</a>&nbsp;" . filesize($path . $fname) . "&nbsp;" . $date . "<br/>";
     }
 } else {
     $success = 0;
@@ -187,12 +186,15 @@
     flush();
     // run post import data processing
     // 
-$dbConn->exec("update datasets set \"lastUpdated\" = NOW() where title = 'Contract Notices'");
-// cn
+    if ($success > 0) {
+$conn->exec("update datasets set \"lastUpdated\" = NOW() where title = 'Contract Notices'");
     echo "link amend<br>";
     include ("linkAmendments.php");
     echo "update UNSPSC<br>";
     include ("updateUNSPSC.php");
+    }
+// cn
+
 // agency
 //include ("setAgencyStatus.php");
 //include ("setAgencyURLABN.php");