return parent::getAuth();
}
- function post()
+ function post($v)
{
$this->transObj = DB_DataObject::Factory('invhist_transfer');
require_once 'File/Convert.php';
$fc = new File_Convert($img->getStoreName(), $img->mimetype );
- $csv = $fc->convert('text/csv');
- $data = $this->importCsv($csv);
- $this->jdata($data['ret'], false, isset($data['extra']) ? $data['extra'] : array() );
+ $csv = $fc->convert('text/csv');
+ $ret = $this->importCsv($csv);
+
+
+
+ $this->jdata($ret['data'], false, isset($ret['extra']) ? $ret['extra'] : array() );
}
$cols = false;
$header = false;
$rows = array();
- $ret = array();
+ $extra = array();
while(false !== ($n = fgetcsv($fh,10000, ',', '"'))) {
- if(!array_filter($n)){
+
+
+ if(!strlen(trim(implode('', $n)))){ // blank line;
if ($header) {
continue;
}
}
if(!$header){
- $ret[preg_replace(array('/\s/', '/\:/'), '', $n[0])] = $n[1];
+ $extra[preg_replace(array('/\s/', '/\:/'), '', $n[0])] = $n[1];
continue;
}
}
fclose($fh);
- return array('extra' => $ret, 'data' => $rows);;
+
+
+ return array('extra' => $extra, 'data' => $rows);;
}
}
\ No newline at end of file