Support partial data amendments with multi line descriptions
[contractdashboard.git] / admin / partialdata / importamendments.php
blob:a/admin/partialdata/importamendments.php -> blob:b/admin/partialdata/importamendments.php
--- a/admin/partialdata/importamendments.php
+++ b/admin/partialdata/importamendments.php
@@ -17,6 +17,8 @@
 	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
 	curl_setopt($ch, CURLOPT_HEADER, 0);
 	curl_setopt($ch, CURLOPT_TIMEOUT, 45);
+curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
+curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
 	$page = curl_exec($ch);
 	if (curl_errno($ch)) {
 		echo "<font color=red> Database temporarily unavailable: ";
@@ -219,6 +221,10 @@
 	    $cnFields[$fieldName] = $fieldValue;
 	}
 }
+if (isset($cnFields[""])) {
+ $cnFields["description"] .= $cnFields[""];
+ unset($cnFields[""]);
+}
 $cnFields["importFile"] = $url;
 $contractNoticeInsertQ = 'INSERT INTO contractnotice ("' . implode('" , "', array_keys($cnFields)) . '") VALUES ( ';
 		for($key = 0; $key < sizeof($cnFields); $key++) {
@@ -304,7 +310,7 @@
 	if ($dhandle) {
 		// loop through all of the files
 		while (false !== ($fname = readdir($dhandle))) {
-			if (($fname != '.') && ($fname != '..')) {
+			if (($fname != '.') && ($fname != '..') && (strpos($fname,".xls")>0)) {
 				echo "<a href=\"import.php?fname=$fname\">$fname</a>&nbsp;" . filesize($path . $fname) . "&nbsp;" . date("c", filemtime($path . $fname)) . "<br/>";
 				processFile($path . $fname, "contractnotice");
 			}