Remove and merge obsolete files csv_laden_hu_alt & csv_laden_iso
This commit is contained in:
39
index2.php
39
index2.php
@ -7,10 +7,41 @@ echo '</div>';
|
||||
echo '<div class="maincontent">';
|
||||
echo '<table border="0" cellpadding="0" cellspacing="0" summary="" width="100%">';
|
||||
echo '<tr>';
|
||||
echo '<td width="50%">';
|
||||
echo 'Please wait ... (transforming)<hr>';
|
||||
require 'csv_laden_iso.php';
|
||||
echo '</td>';
|
||||
echo '<td width="50%">';
|
||||
echo 'Please wait ... (transforming)<hr>';
|
||||
require_once 'inc/zeichen.php';
|
||||
$filename = $_GET['fnam'];
|
||||
$csv_datei = 'csv/' . $filename;
|
||||
|
||||
mkdir("xml", 0777);
|
||||
$fp = fopen ( $csv_datei, 'r' );
|
||||
$y = 0;
|
||||
while ( $zeile = fgetcsv ( $fp, 100000, ';' ) )
|
||||
{
|
||||
$y++;
|
||||
$zieldatei = 'xml/' . $y . '.xml';
|
||||
if (!$handle = fopen($zieldatei, 'w')) {
|
||||
echo "Cannot open file ($zieldatei)";exit;
|
||||
}
|
||||
$somecontent = '<?xml version="1.0" encoding="ISO-8859-1"?>' . "\n"; // normal
|
||||
$somecontent = $somecontent . '<record>' . "\n";
|
||||
|
||||
for ($x = 0; $x < count ( $zeile ); $x++)
|
||||
{
|
||||
$inhalt[$y][$x] = $zeile[$x];
|
||||
//if ($inhalt[$y][$x]=='') $inhalt[$y][$x]='ERSATZ';
|
||||
$somecontent = $somecontent . '<' . tagify(transform($inhalt[1][$x])) . '>' . transform($inhalt[$y][$x]) . '</' . tagify(transform($inhalt[1][$x])) . '>' . "\n"; //normaleinstellung
|
||||
}
|
||||
$somecontent = $somecontent . '</record>';
|
||||
if (fwrite($handle, $somecontent) === FALSE) {
|
||||
echo "Cannot write to file ($filename)";exit;
|
||||
}
|
||||
fclose($handle);
|
||||
}
|
||||
fclose($fp);
|
||||
echo ($y - 1) . ' files created';
|
||||
echo '<br><a href="zipit.php"><img src="img/go.gif"> Download as zip</a>';
|
||||
echo '</td>';
|
||||
echo '</tr>';
|
||||
echo '</table>';
|
||||
echo '</div>';
|
||||
|
Reference in New Issue
Block a user