ExcelToJson.php
[Pman.Core] / ExcelToJson.php
index baa1e52..2a111db 100644 (file)
@@ -43,16 +43,17 @@ class Pman_Core_ExcelToJson extends Pman_Roo
         }
         
         $req = array(
-            'LINE', 'ITEM CODE', 'DESCRIPTION', 'QUANTITY', 'AA'
+            'LINE', 'ITEM CODE', 'DESCRIPTION', 'QUANTITY'
         );
         
-        $cols[] = false;
+        $cols = false;
         $rows = array();
         $header = false;
         
         while(false !== ($n = fgetcsv($fh,10000, ',', '"'))) {
             if(!array_filter($n)){
                 $header = true;
+                continue;
             }
             
             if(!$header){
@@ -65,10 +66,11 @@ class Pman_Core_ExcelToJson extends Pman_Roo
                 foreach($n as $k) {
                     $cols[] = strtoupper(trim($k));
                 }
-
+                
                 if (empty($cols)) {
                     continue;
                 }
+               
                 foreach($req as $r) {
                     if (!in_array($r,$cols)) {
                         $cols = false;