ExcelToJson.php
[Pman.Core] / ExcelToJson.php
index 55c5623..e10f739 100644 (file)
@@ -46,20 +46,21 @@ class Pman_Core_ExcelToJson extends Pman_Roo
             'LINE', 'ITEM CODE', 'DESCRIPTION', 'QUANTITY', 'AA'
         );
         
-        $cols[] = false;
+        $cols = false;
         $rows = array();
         $header = false;
         
         while(false !== ($n = fgetcsv($fh,10000, ',', '"'))) {
             if(!array_filter($n)){
                 $header = true;
+                continue;
             }
             
             if(!$header){
                $rows[$n[0]] = $n[1];
                continue;
             }
-            print_r('run');exit;
+            
             if(!$cols){
                 $cols = array();
                 foreach($n as $k) {
@@ -69,7 +70,7 @@ class Pman_Core_ExcelToJson extends Pman_Roo
                 if (empty($cols)) {
                     continue;
                 }
-                print_r($cols);exit;
+               
                 foreach($req as $r) {
                     if (!in_array($r,$cols)) {
                         print_r($r);
@@ -86,7 +87,7 @@ class Pman_Core_ExcelToJson extends Pman_Roo
             $rows[] = $row;
             
         }
-         exit;
+        
         if (empty($cols)) {
             $this->jerr("could not find a row with " . implode(' / ', $req));
         }