|
|
|
@ -35,7 +35,7 @@ class ModuleImportParsers
|
|
|
|
|
|
|
|
|
|
$ii = 0; |
|
|
|
|
|
|
|
|
|
$items = []; |
|
|
|
|
$items = array(); |
|
|
|
|
|
|
|
|
|
while ($item = fgetcsv($handle, 0, $sep, $protect)) |
|
|
|
|
{ |
|
|
|
@ -80,7 +80,7 @@ class ModuleImportParsers
|
|
|
|
|
|
|
|
|
|
$tags = $Excel->sheets[0]['cells'][1]; // Определяем теги |
|
|
|
|
|
|
|
|
|
$items = []; |
|
|
|
|
$items = array(); |
|
|
|
|
|
|
|
|
|
$ii = 0; |
|
|
|
|
|
|
|
|
@ -121,14 +121,14 @@ class ModuleImportParsers
|
|
|
|
|
|
|
|
|
|
$a = array_values($xml); |
|
|
|
|
|
|
|
|
|
$tags = []; // Определяем теги |
|
|
|
|
$tags = array(); // Определяем теги |
|
|
|
|
|
|
|
|
|
foreach ($a[0][0] AS $key => $value) |
|
|
|
|
{ |
|
|
|
|
$tags[] = $key; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$items = []; |
|
|
|
|
$items = array(); |
|
|
|
|
|
|
|
|
|
foreach ($a[0] AS $key => $row) |
|
|
|
|
{ |
|
|
|
@ -150,4 +150,43 @@ class ModuleImportParsers
|
|
|
|
|
|
|
|
|
|
return $result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* !DBF */ |
|
|
|
|
public static function DBF2Array($fname) |
|
|
|
|
{ |
|
|
|
|
$db = dbase_open($fname, 0); |
|
|
|
|
|
|
|
|
|
$cols = dbase_get_header_info($db); |
|
|
|
|
|
|
|
|
|
$count = dbase_numrecords($db); |
|
|
|
|
|
|
|
|
|
$rows = array(); |
|
|
|
|
|
|
|
|
|
$tags = array(); |
|
|
|
|
|
|
|
|
|
foreach($cols AS $k => $v) |
|
|
|
|
{ |
|
|
|
|
$tags[] = $v['name']; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$ii = 1; |
|
|
|
|
|
|
|
|
|
for ($ii; $ii <= $count; $ii++) |
|
|
|
|
{ |
|
|
|
|
$rows[] = dbase_get_record_with_names($db, $ii); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$result = |
|
|
|
|
[ |
|
|
|
|
'num' => $count - $parser_row, |
|
|
|
|
'tags' => $tags, |
|
|
|
|
'rows' => $rows |
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
dbase_close($db); |
|
|
|
|
|
|
|
|
|
unset($cols, $count, $tags, $rows); |
|
|
|
|
|
|
|
|
|
return $result; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|