diff --git a/docs/README.md b/docs/README.md index 4121d0d7..94c8c097 100755 --- a/docs/README.md +++ b/docs/README.md @@ -53,7 +53,7 @@ Highest to lowest: * Refactoring enabling faster implementation of future functionality * UI improvements -Design philosophy: Focus on core functionality and leverage existing apps and tools to make PiAlert integratable into other workflows. +Design philosophy: Focus on core functionality and leverage existing apps and tools to make PiAlert integrate into other workflows. Examples: diff --git a/front/php/server/devices.php b/front/php/server/devices.php index 1700a627..a557d885 100755 --- a/front/php/server/devices.php +++ b/front/php/server/devices.php @@ -477,6 +477,7 @@ function ImportCSV() { global $db; + $skipped = ""; $error = ""; // sql @@ -492,12 +493,13 @@ function ImportCSV() { // Parse data from CSV file line by line (max 10000 lines) + $index = 0; foreach($data as $row) { // Check if not empty and skipping first line $rowArray = explode(',',$row); - if(count($rowArray) > 20) + if(count($rowArray) > 23) { $cleanMac = str_replace("\"","",$rowArray[0]); @@ -513,19 +515,21 @@ function ImportCSV() { break; } } + } else{ + $skipped = $skipped . ($index+1) . ","; } - + $index = $index + 1; } if($error == "") { // import succesful - echo lang('BackDevices_DBTools_ImportCSV'); + echo lang('BackDevices_DBTools_ImportCSV') . "(Skipped lines: " .$skipped .")"; } else{ // an error occurred while writing to the DB, display the last error message - echo lang('BackDevices_DBTools_ImportCSVError')."\n\n$sql \n\n".$result; + echo lang('BackDevices_DBTools_ImportCSVError')."\n".$error."\n$sql \n\n".$result; } } else {