ExcelToJson.php
[Pman.Core] / ExcelToJson.php
index 9c5675e..cad6033 100644 (file)
@@ -30,31 +30,8 @@ class Pman_Core_ExcelToJson extends Pman_Roo
         require_once 'File/Convert.php';
         $fc = new File_Convert($img->getStoreName(), $img->mimetype );
         $csv = $fc->convert('text/csv');
-        $this->importCsv($csv);
-    }
-    
-    function importCsv($csv)
-    {
-        ini_set("auto_detect_line_endings", true);
-        
-        $fh = fopen($csv, 'r');
-        if (!$fh) {
-            $this->jerr("invalid file");
-        }
-        
-        $rows = array();
+        $data = $this->importCsv($csv);
+        $this->jdata($data);
         
-        while(false !== ($n = fgetcsv($fh,10000, ',', '"'))) {
-            print_r(array_filter($n));
-        }
-        exit;
-        if (empty($cols)) {
-            $this->jerr("could not find a row with " . implode(' / ', $req));
-        }
-        
-        fclose($fh);
-        
-        exit;
     }
-    
-}
+}
\ No newline at end of file