Ran PHPCBF on PHP files

This commit is contained in:
Joshua Ramon Enslin 2019-08-27 00:31:46 +02:00 committed by Stefan Rohde-Enslin
parent f7140573e1
commit 4abb415054
16 changed files with 857 additions and 954 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
/csv /csv
/translation-importer

File diff suppressed because one or more lines are too long

View File

@ -1,46 +1,43 @@
<?php <?php
ob_start(); ob_start();
include_once ('inc/zeichen.php'); require_once 'inc/zeichen.php';
$filename=$_GET['fnam']; $filename = $_GET['fnam'];
$csv_datei = 'csv/'.$filename; $csv_datei = 'csv/' . $filename;
mkdir("xml",0777); mkdir("xml", 0777);
$fp = fopen ( $csv_datei, 'r' ); $fp = fopen ( $csv_datei, 'r' );
$y = 0; $y = 0;
while ( $zeile = fgetcsv ( $fp, 100000, ';' ) ) while ( $zeile = fgetcsv ( $fp, 100000, ';' ) )
{ {
$y++; $y++;
//echo '<b>Zeile='.$y.' Anzahl in Zeile: '.count ( $zeile ).'</b><br>'; //echo '<b>Zeile='.$y.' Anzahl in Zeile: '.count ( $zeile ).'</b><br>';
$zieldatei = 'xml/'.$y.'.xml'; $zieldatei = 'xml/' . $y . '.xml';
if (!$handle = fopen($zieldatei, 'w')) if (!$handle = fopen($zieldatei, 'w')) {
{ echo "Cannot open file ($zieldatei)";exit;
echo "Cannot open file ($zieldatei)";exit; }
} $somecontent = '<?xml version="1.0" encoding="ISO-8859-1"?>' . "\n"; // normal
$somecontent='<?xml version="1.0" encoding="ISO-8859-1"?>'."\n"; // normal $somecontent = $somecontent . '<record>' . "\n";
$somecontent=$somecontent.'<record>'."\n";
for ( $x = 0; $x < count ( $zeile ); $x++ ) for ($x = 0; $x < count ( $zeile ); $x++)
{ {
$inhalt[$y][$x]=$zeile[$x]; $inhalt[$y][$x] = $zeile[$x];
//echo '<b>'.$inhalt[1][$x].'</b> --> '.$zeile[$x].'<br>'; //echo '<b>'.$inhalt[1][$x].'</b> --> '.$zeile[$x].'<br>';
if ($inhalt[$y][$x]=='') $inhalt[$y][$x]='ERSATZ'; if ($inhalt[$y][$x] == '') $inhalt[$y][$x] = 'ERSATZ';
//$somecontent=$somecontent.'<'.tagify(transform($inhalt[1][$x])).'>'.utf8_decode(transform($inhalt[$y][$x])).'</'.tagify(transform($inhalt[1][$x])).'>'."\n"; // für utf8 //$somecontent=$somecontent.'<'.tagify(transform($inhalt[1][$x])).'>'.utf8_decode(transform($inhalt[$y][$x])).'</'.tagify(transform($inhalt[1][$x])).'>'."\n"; // für utf8
//$somecontent=$somecontent.'<'.tagify(transform($inhalt[1][$x])).'>'.(($inhalt[$y][$x])).'</'.tagify(transform($inhalt[1][$x])).'>'."\n"; //für ungarn sonst weg ////////////////////////////////////////////////////////////// //$somecontent=$somecontent.'<'.tagify(transform($inhalt[1][$x])).'>'.(($inhalt[$y][$x])).'</'.tagify(transform($inhalt[1][$x])).'>'."\n"; //für ungarn sonst weg //////////////////////////////////////////////////////////////
$somecontent=$somecontent.'<'.tagify(transform($inhalt[1][$x])).'>'.transform($inhalt[$y][$x]).'</'.tagify(transform($inhalt[1][$x])).'>'."\n"; //normaleinstellung $somecontent = $somecontent . '<' . tagify(transform($inhalt[1][$x])) . '>' . transform($inhalt[$y][$x]) . '</' . tagify(transform($inhalt[1][$x])) . '>' . "\n"; //normaleinstellung
} }
$somecontent=$somecontent.'</record>'; $somecontent = $somecontent . '</record>';
//if ($y>1) //if ($y>1)
//{ //{
if (fwrite($handle, $somecontent) === FALSE) if (fwrite($handle, $somecontent) === FALSE) {
{ echo "Cannot write to file ($filename)";exit;
echo "Cannot write to file ($filename)";exit; }
} // echo "Success, wrote to file ($filename)<br><br>";
// echo "Success, wrote to file ($filename)<br><br>"; //}
//} fclose($handle);
fclose($handle);
} }
fclose($fp); fclose($fp);
echo ($y-1).' files created'; echo ($y - 1) . ' files created';
echo '<br><a href="zipit.php"><img src="img/go.gif"> Download as zip</a>'; echo '<br><a href="zipit.php"><img src="img/go.gif"> Download as zip</a>';
?>

View File

@ -1,12 +1,12 @@
<?php <?php
ob_start(); ob_start();
error_reporting(E_ALL); error_reporting(E_ALL);
ini_set('display_errors',1); ini_set('display_errors', 1);
echo '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />'; // für ungarn sonst weg ////////////////////// echo '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />'; // für ungarn sonst weg //////////////////////
include ('inc/zeichen.php'); require 'inc/zeichen.php';
$filename=$_GET['fnam']; $filename = $_GET['fnam'];
$csv_datei = 'csv/'.$filename; $csv_datei = 'csv/' . $filename;
if (!file_exists("xml")) { if (!file_exists("xml")) {
mkdir("xml", 0700); mkdir("xml", 0700);
@ -16,39 +16,36 @@ $fp = fopen ( $csv_datei, 'r' );
$y = 0; $y = 0;
while ( $zeile = fgetcsv ( $fp, 100000, ';' ) ) while ( $zeile = fgetcsv ( $fp, 100000, ';' ) )
{ {
$y++; $y++;
//echo '<b>Zeile='.$y.' Anzahl in Zeile: '.count ( $zeile ).'</b><br>'; //echo '<b>Zeile='.$y.' Anzahl in Zeile: '.count ( $zeile ).'</b><br>';
$zieldatei = 'xml/'.$y.'.xml'; $zieldatei = 'xml/' . $y . '.xml';
if (!$handle = fopen($zieldatei, 'w')) if (!$handle = fopen($zieldatei, 'w')) {
{ echo "Cannot open file ($zieldatei)";exit;
echo "Cannot open file ($zieldatei)";exit; }
} $somecontent = '<?xml version="1.0" encoding="UTF-8"?>' . "\n"; // für Ungarn ///////////////////////////////////
$somecontent='<?xml version="1.0" encoding="UTF-8"?>'."\n"; // für Ungarn /////////////////////////////////// /*$somecontent='<?xml version="1.0" encoding="ISO-8859-1"?>'."\n"; // normal */
/*$somecontent='<?xml version="1.0" encoding="ISO-8859-1"?>'."\n"; // normal */ $somecontent = $somecontent . '<record>' . "\n";
$somecontent=$somecontent.'<record>'."\n";
for ( $x = 0; $x < count ( $zeile ); $x++ ) for ($x = 0; $x < count ( $zeile ); $x++)
{ {
$inhalt[$y][$x]=$zeile[$x]; $inhalt[$y][$x] = $zeile[$x];
//echo '<b>'.$inhalt[1][$x].'</b> --> '.$zeile[$x].'<br>'; //echo '<b>'.$inhalt[1][$x].'</b> --> '.$zeile[$x].'<br>';
if ($inhalt[$y][$x]=='') $inhalt[$y][$x]='ERSATZ'; if ($inhalt[$y][$x] == '') $inhalt[$y][$x] = 'ERSATZ';
//$somecontent=$somecontent.'<'.tagify(transform($inhalt[1][$x])).'>'.utf8_decode(transform($inhalt[$y][$x])).'</'.tagify(transform($inhalt[1][$x])).'>'."\n"; // für utf8 //$somecontent=$somecontent.'<'.tagify(transform($inhalt[1][$x])).'>'.utf8_decode(transform($inhalt[$y][$x])).'</'.tagify(transform($inhalt[1][$x])).'>'."\n"; // für utf8
$somecontent=$somecontent.'<'.tagify(transform($inhalt[1][$x])).'>'.(($inhalt[$y][$x])).'</'.tagify(transform($inhalt[1][$x])).'>'."\n"; //für ungarn sonst weg ////////////////////////////////////////////////////////////// $somecontent = $somecontent . '<' . tagify(transform($inhalt[1][$x])) . '>' . (($inhalt[$y][$x])) . '</' . tagify(transform($inhalt[1][$x])) . '>' . "\n"; //für ungarn sonst weg //////////////////////////////////////////////////////////////
//$somecontent=$somecontent.'<'.tagify(transform($inhalt[1][$x])).'>'.transform($inhalt[$y][$x]).'</'.tagify(transform($inhalt[1][$x])).'>'."\n"; //normaleinstellung //$somecontent=$somecontent.'<'.tagify(transform($inhalt[1][$x])).'>'.transform($inhalt[$y][$x]).'</'.tagify(transform($inhalt[1][$x])).'>'."\n"; //normaleinstellung
} }
$somecontent=$somecontent.'</record>'; $somecontent = $somecontent . '</record>';
//if ($y>1) //if ($y>1)
//{ //{
if (fwrite($handle, $somecontent) === FALSE) if (fwrite($handle, $somecontent) === FALSE) {
{ echo "Cannot write to file ($filename)";exit;
echo "Cannot write to file ($filename)";exit; }
} // echo "Success, wrote to file ($filename)<br><br>";
// echo "Success, wrote to file ($filename)<br><br>"; //}
//} fclose($handle);
fclose($handle);
} }
fclose($fp); fclose($fp);
echo ($y-1).' files created'; echo ($y - 1) . ' files created';
echo '<br><a href="zipit.php"><img src="img/go.gif"> Download as zip</a>'; echo '<br><a href="zipit.php"><img src="img/go.gif"> Download as zip</a>';
?>

View File

@ -1,49 +1,46 @@
<?php <?php
ob_start(); ob_start();
echo '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />'; // für ungarn sonst weg ////////////////////// echo '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />'; // für ungarn sonst weg //////////////////////
include ('inc/zeichen.php'); require 'inc/zeichen.php';
$filename=$_GET['fnam']; $filename = $_GET['fnam'];
$csv_datei = 'csv/'.$filename; $csv_datei = 'csv/' . $filename;
mkdir("xml",0777); mkdir("xml", 0777);
$fp = fopen ( $csv_datei, 'r' ); $fp = fopen ( $csv_datei, 'r' );
$y = 0; $y = 0;
while ( $zeile = fgetcsv ( $fp, 100000, ';' ) ) while ( $zeile = fgetcsv ( $fp, 100000, ';' ) )
//while ( $zeile = fgetcsv ( $fp, 100000, ',' ) ) //while ( $zeile = fgetcsv ( $fp, 100000, ',' ) )
{ {
$y++; $y++;
//echo '<b>Zeile='.$y.' Anzahl in Zeile: '.count ( $zeile ).'</b><br>'; //echo '<b>Zeile='.$y.' Anzahl in Zeile: '.count ( $zeile ).'</b><br>';
$zieldatei = 'xml/'.$y.'.xml'; $zieldatei = 'xml/' . $y . '.xml';
if (!$handle = fopen($zieldatei, 'w')) if (!$handle = fopen($zieldatei, 'w')) {
{ echo "Cannot open file ($zieldatei)";exit;
echo "Cannot open file ($zieldatei)";exit; }
} $somecontent = '<?xml version="1.0" encoding="UTF-8"?>' . "\n"; // für Ungarn ///////////////////////////////////
$somecontent='<?xml version="1.0" encoding="UTF-8"?>'."\n"; // für Ungarn /////////////////////////////////// /*$somecontent='<?xml version="1.0" encoding="ISO-8859-1"?>'."\n"; // normal */
/*$somecontent='<?xml version="1.0" encoding="ISO-8859-1"?>'."\n"; // normal */ $somecontent = $somecontent . '<record>' . "\n";
$somecontent=$somecontent.'<record>'."\n";
for ( $x = 0; $x < count ( $zeile ); $x++ ) for ($x = 0; $x < count ( $zeile ); $x++)
{ {
$inhalt[$y][$x]=$zeile[$x]; $inhalt[$y][$x] = $zeile[$x];
//echo '<b>'.$inhalt[1][$x].'</b> --> '.$zeile[$x].'<br>'; //echo '<b>'.$inhalt[1][$x].'</b> --> '.$zeile[$x].'<br>';
if ($inhalt[$y][$x]=='') $inhalt[$y][$x]='ERSATZ'; if ($inhalt[$y][$x] == '') $inhalt[$y][$x] = 'ERSATZ';
//$somecontent=$somecontent.'<'.tagify(transform($inhalt[1][$x])).'>'.utf8_decode(transform($inhalt[$y][$x])).'</'.tagify(transform($inhalt[1][$x])).'>'."\n"; // für utf8 //$somecontent=$somecontent.'<'.tagify(transform($inhalt[1][$x])).'>'.utf8_decode(transform($inhalt[$y][$x])).'</'.tagify(transform($inhalt[1][$x])).'>'."\n"; // für utf8
$somecontent=$somecontent.'<'.tagify(transform($inhalt[1][$x])).'>'.(($inhalt[$y][$x])).'</'.tagify(transform($inhalt[1][$x])).'>'."\n"; //für ungarn sonst weg ////////////////////////////////////////////////////////////// $somecontent = $somecontent . '<' . tagify(transform($inhalt[1][$x])) . '>' . (($inhalt[$y][$x])) . '</' . tagify(transform($inhalt[1][$x])) . '>' . "\n"; //für ungarn sonst weg //////////////////////////////////////////////////////////////
//$somecontent=$somecontent.'<'.tagify(transform($inhalt[1][$x])).'>'.transform($inhalt[$y][$x]).'</'.tagify(transform($inhalt[1][$x])).'>'."\n"; //normaleinstellung //$somecontent=$somecontent.'<'.tagify(transform($inhalt[1][$x])).'>'.transform($inhalt[$y][$x]).'</'.tagify(transform($inhalt[1][$x])).'>'."\n"; //normaleinstellung
} }
echo $y.'<br>'; echo $y . '<br>';
$somecontent=$somecontent.'</record>'; $somecontent = $somecontent . '</record>';
//if ($y>1) //if ($y>1)
//{ //{
if (fwrite($handle, $somecontent) === FALSE) if (fwrite($handle, $somecontent) === FALSE) {
{ echo "Cannot write to file ($filename)";exit;
echo "Cannot write to file ($filename)";exit; }
} // echo "Success, wrote to file ($filename)<br><br>";
// echo "Success, wrote to file ($filename)<br><br>"; //}
//} fclose($handle);
fclose($handle);
} }
fclose($fp); fclose($fp);
echo '<a href="zipit.php">download as zip</a>'; echo '<a href="zipit.php">download as zip</a>';
?>

View File

@ -1,37 +1,34 @@
<?PHP <?PHP
ob_start(); ob_start();
include_once ('inc/zeichen.php'); require_once 'inc/zeichen.php';
$filename=$_GET['fnam']; $filename = $_GET['fnam'];
$csv_datei = 'csv/'.$filename; $csv_datei = 'csv/' . $filename;
mkdir("xml",0777); mkdir("xml", 0777);
$fp = fopen ( $csv_datei, 'r' ); $fp = fopen ( $csv_datei, 'r' );
$y = 0; $y = 0;
while ( $zeile = fgetcsv ( $fp, 100000, ';' ) ) while ( $zeile = fgetcsv ( $fp, 100000, ';' ) )
{ {
$y++; $y++;
$zieldatei = 'xml/'.$y.'.xml'; $zieldatei = 'xml/' . $y . '.xml';
if (!$handle = fopen($zieldatei, 'w')) if (!$handle = fopen($zieldatei, 'w')) {
{ echo "Cannot open file ($zieldatei)";exit;
echo "Cannot open file ($zieldatei)";exit; }
} $somecontent = '<?xml version="1.0" encoding="ISO-8859-1"?>' . "\n"; // normal
$somecontent='<?xml version="1.0" encoding="ISO-8859-1"?>'."\n"; // normal $somecontent = $somecontent . '<record>' . "\n";
$somecontent=$somecontent.'<record>'."\n";
for ( $x = 0; $x < count ( $zeile ); $x++ ) for ($x = 0; $x < count ( $zeile ); $x++)
{ {
$inhalt[$y][$x]=$zeile[$x]; $inhalt[$y][$x] = $zeile[$x];
//if ($inhalt[$y][$x]=='') $inhalt[$y][$x]='ERSATZ'; //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 . '<' . tagify(transform($inhalt[1][$x])) . '>' . transform($inhalt[$y][$x]) . '</' . tagify(transform($inhalt[1][$x])) . '>' . "\n"; //normaleinstellung
} }
$somecontent=$somecontent.'</record>'; $somecontent = $somecontent . '</record>';
if (fwrite($handle, $somecontent) === FALSE) if (fwrite($handle, $somecontent) === FALSE) {
{ echo "Cannot write to file ($filename)";exit;
echo "Cannot write to file ($filename)";exit; }
} fclose($handle);
fclose($handle);
} }
fclose($fp); fclose($fp);
echo ($y-1).' files created'; echo ($y - 1) . ' files created';
echo '<br><a href="zipit.php"><img src="img/go.gif"> Download as zip</a>'; echo '<br><a href="zipit.php"><img src="img/go.gif"> Download as zip</a>';
?>

View File

@ -3,40 +3,37 @@
//ini_set('display_errors',1); //ini_set('display_errors',1);
ob_start(); ob_start();
echo '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />'; // für ungarn sonst weg ////////////////////// echo '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />'; // für ungarn sonst weg //////////////////////
include ('inc/zeichen.php'); require 'inc/zeichen.php';
$filename=$_GET['fnam']; $filename = $_GET['fnam'];
$csv_datei = 'csv/'.$filename; $csv_datei = 'csv/' . $filename;
mkdir("xml",0777); mkdir("xml", 0777);
$fp = fopen ( $csv_datei, 'r' ); $fp = fopen ( $csv_datei, 'r' );
$y = 0; $y = 0;
while ( $zeile = fgetcsv ( $fp, 100000, ';' ) ) while ( $zeile = fgetcsv ( $fp, 100000, ';' ) )
{ {
$y++; $y++;
$zieldatei = 'xml/'.$y.'.xml'; $zieldatei = 'xml/' . $y . '.xml';
if (!$handle = fopen($zieldatei, 'w')) if (!$handle = fopen($zieldatei, 'w')) {
{ echo "Cannot open file ($zieldatei)";exit;
echo "Cannot open file ($zieldatei)";exit; }
} $somecontent = '<?xml version="1.0" encoding="UTF-8"?>' . "\n"; // für Ungarn ///////////////////////////////////
$somecontent='<?xml version="1.0" encoding="UTF-8"?>'."\n"; // für Ungarn /////////////////////////////////// $somecontent = $somecontent . '<record>' . "\n";
$somecontent=$somecontent.'<record>'."\n";
for ( $x = 0; $x < count ( $zeile ); $x++ ) for ($x = 0; $x < count ( $zeile ); $x++)
{ {
$inhalt[$y][$x]=$zeile[$x]; $inhalt[$y][$x] = $zeile[$x];
$inhalt[$y][$x] = preg_replace('/[\x00-\x1F\x7F]/u', '', $inhalt[$y][$x]); $inhalt[$y][$x] = preg_replace('/[\x00-\x1F\x7F]/u', '', $inhalt[$y][$x]);
$inhalt[$y][$x] = str_replace('>',']',str_replace('<','[',$inhalt[$y][$x])); $inhalt[$y][$x] = str_replace('>', ']', str_replace('<', '[', $inhalt[$y][$x]));
//if ($y!=1) $inhalt[$y][$x] = '<![CDATA['.$inhalt[$y][$x].']]>'; //if ($y!=1) $inhalt[$y][$x] = '<![CDATA['.$inhalt[$y][$x].']]>';
$somecontent=$somecontent.'<'.tagify(transform($inhalt[1][$x])).'>'.(($inhalt[$y][$x])).'</'.tagify(transform($inhalt[1][$x])).'>'."\n"; //für ungarn sonst weg } $somecontent = $somecontent . '<' . tagify(transform($inhalt[1][$x])) . '>' . (($inhalt[$y][$x])) . '</' . tagify(transform($inhalt[1][$x])) . '>' . "\n"; //für ungarn sonst weg }
} }
$somecontent=$somecontent.'</record>'; $somecontent = $somecontent . '</record>';
if (fwrite($handle, $somecontent) === FALSE) if (fwrite($handle, $somecontent) === FALSE) {
{ echo "Cannot write to file ($filename)";exit;
echo "Cannot write to file ($filename)";exit; }
} fclose($handle);
fclose($handle);
} }
fclose($fp); fclose($fp);
echo ($y-1).' files created'; echo ($y - 1) . ' files created';
echo '<br><a href="zipit.php"><img src="img/go.gif"> Download as zip</a>'; echo '<br><a href="zipit.php"><img src="img/go.gif"> Download as zip</a>';
?>

229
index.php
View File

@ -1,6 +1,6 @@
<?PHP <?PHP
error_reporting(E_ALL); error_reporting(E_ALL);
ini_set('display_errors',1); ini_set('display_errors', 1);
?> ?>
<head> <head>
<script language="javascript" type="text/javascript"> <script language="javascript" type="text/javascript">
@ -37,97 +37,154 @@ echo '<input type="submit" value="Upload" />';
echo '</form>'; echo '</form>';
echo '</div>'; echo '</div>';
echo '<div class="main_fieldlist">'; echo '<div class="main_fieldlist">';
include('values/all_fields.php'); require 'values/all_fields.php';
echo '<p>Currently approved tags (column names) for md:import:</p>'; echo '<p>Currently approved tags (column names) for md:import:</p>';
//echo '<table>'; //echo '<table>';
//echo '<th>Name</th><th>Mandatory</th><th>Allowed</th><th>Remarks</th><th>Dependencies</th>'; //echo '<th>Name</th><th>Mandatory</th><th>Allowed</th><th>Remarks</th><th>Dependencies</th>';
$categories=array('basic','other object title','detailed description','inscription','material_technique separate','separate dimensions','comparable objects','closer location','categorisation', 'object administration', 'object history', 'worth', 'state', 'location', 'rights (object)', 'remarks', 'links', 'literature', 'object_group', 'tags', 'events: related place', 'events: related actor', 'events: related time', 'images', 'resources', 'events: production', 'events: finding', 'events: publication', 'events: template creation', 'events: depiction_who', 'events: depiction_place', 'events: use', 'events: writing', 'events: colleting', 'events: painting', 'events: taking', 'events: receiving', 'events: printing plate production', 'events: sending', 'events: issuing', 'events: signing', 'events: type description', 'events:drawing', 'events: copying', 'events: has lived', 'events: commissioned', 'events: printed', 'events: spoken', 'events: sung', 'events: decor designed', 'events: form designed', 'events: modelled', 'events: signed', 'events: mentioning', 'events: burying', 'events: intellectual creation', 'events: painting on', 'events: illustrated' ); $categories = array('basic','other object title','detailed description','inscription','material_technique separate','separate dimensions','comparable objects','closer location','categorisation', 'object administration', 'object history', 'worth', 'state', 'location', 'rights (object)', 'remarks', 'links', 'literature', 'object_group', 'tags', 'events: related place', 'events: related actor', 'events: related time', 'images', 'resources', 'events: production', 'events: finding', 'events: publication', 'events: template creation', 'events: depiction_who', 'events: depiction_place', 'events: use', 'events: writing', 'events: colleting', 'events: painting', 'events: taking', 'events: receiving', 'events: printing plate production', 'events: sending', 'events: issuing', 'events: signing', 'events: type description', 'events:drawing', 'events: copying', 'events: has lived', 'events: commissioned', 'events: printed', 'events: spoken', 'events: sung', 'events: decor designed', 'events: form designed', 'events: modelled', 'events: signed', 'events: mentioning', 'events: burying', 'events: intellectual creation', 'events: painting on', 'events: illustrated' );
$cat_counter=0; $cat_counter = 0;
for ($i=0;$i<count($allowed);$i++) for ($i = 0; $i < count($allowed); $i++)
{ {
//echo '<tr>'; //echo '<tr>';
if ($i==0) {echo '<br/><b>'.$categories[$cat_counter].'</b><br/>';$cat_counter++;} if ($i == 0) {echo '<br/><b>' . $categories[$cat_counter] . '</b><br/>';$cat_counter++;
if ($i==10) {echo '<br/><br/><b>'.$categories[$cat_counter].'</b><br/>';$cat_counter++;} }
if ($i==12) {echo '<br/><br/><b>'.$categories[$cat_counter].'</b><br/>';$cat_counter++;} if ($i == 10) {echo '<br/><br/><b>' . $categories[$cat_counter] . '</b><br/>';$cat_counter++;
if ($i==15) {echo '<br/><br/><b>'.$categories[$cat_counter].'</b><br/>';$cat_counter++;} }
if ($i==18) {echo '<br/><br/><b>'.$categories[$cat_counter].'</b><br/>';$cat_counter++;} if ($i == 12) {echo '<br/><br/><b>' . $categories[$cat_counter] . '</b><br/>';$cat_counter++;
if ($i==20) {echo '<br/><br/><b>'.$categories[$cat_counter].'</b><br/>';$cat_counter++;} }
if ($i==36) {echo '<br/><br/><b>'.$categories[$cat_counter].'</b><br/>';$cat_counter++;} if ($i == 15) {echo '<br/><br/><b>' . $categories[$cat_counter] . '</b><br/>';$cat_counter++;
if ($i==39) {echo '<br/><br/><b>'.$categories[$cat_counter].'</b><br/>';$cat_counter++;} }
if ($i==41) {echo '<br/><br/><b>'.$categories[$cat_counter].'</b><br/>';$cat_counter++;} if ($i == 18) {echo '<br/><br/><b>' . $categories[$cat_counter] . '</b><br/>';$cat_counter++;
if ($i==47) {echo '<br/><br/><b>'.$categories[$cat_counter].'</b><br/>';$cat_counter++;} }
if ($i==53) {echo '<br/><br/><b>'.$categories[$cat_counter].'</b><br/>';$cat_counter++;} if ($i == 20) {echo '<br/><br/><b>' . $categories[$cat_counter] . '</b><br/>';$cat_counter++;
if ($i==57) {echo '<br/><br/><b>'.$categories[$cat_counter].'</b><br/>';$cat_counter++;} }
if ($i==65) {echo '<br/><br/><b>'.$categories[$cat_counter].'</b><br/>';$cat_counter++;} if ($i == 36) {echo '<br/><br/><b>' . $categories[$cat_counter] . '</b><br/>';$cat_counter++;
if ($i==67) {echo '<br/><br/><b>'.$categories[$cat_counter].'</b><br/>';$cat_counter++;} }
if ($i==75) {echo '<br/><br/><b>'.$categories[$cat_counter].'</b><br/>';$cat_counter++;} if ($i == 39) {echo '<br/><br/><b>' . $categories[$cat_counter] . '</b><br/>';$cat_counter++;
if ($i==78) {echo '<br/><br/><b>'.$categories[$cat_counter].'</b><br/>';$cat_counter++;} }
if ($i==82) {echo '<br/><br/><b>'.$categories[$cat_counter].'</b><br/>';$cat_counter++;} if ($i == 41) {echo '<br/><br/><b>' . $categories[$cat_counter] . '</b><br/>';$cat_counter++;
if ($i==86) {echo '<br/><br/><b>'.$categories[$cat_counter].'</b><br/>';$cat_counter++;} }
if ($i==108) {echo '<br/><br/><b>'.$categories[$cat_counter].'</b><br/>';$cat_counter++;} if ($i == 47) {echo '<br/><br/><b>' . $categories[$cat_counter] . '</b><br/>';$cat_counter++;
if ($i==123) {echo '<br/><br/><b>'.$categories[$cat_counter].'</b><br/>';$cat_counter++;} }
if ($i==133) {echo '<br/><br/><b>'.$categories[$cat_counter].'</b><br/>';$cat_counter++;} if ($i == 53) {echo '<br/><br/><b>' . $categories[$cat_counter] . '</b><br/>';$cat_counter++;
if ($i==137) {echo '<br/><br/><b>'.$categories[$cat_counter].'</b><br/>';$cat_counter++;} }
if ($i==141) {echo '<br/><br/><b>'.$categories[$cat_counter].'</b><br/>';$cat_counter++;} if ($i == 57) {echo '<br/><br/><b>' . $categories[$cat_counter] . '</b><br/>';$cat_counter++;
if ($i==145) {echo '<br/><br/><b>'.$categories[$cat_counter].'</b><br/>';$cat_counter++;} }
if ($i==215) {echo '<br/><br/><b>'.$categories[$cat_counter].'</b><br/>';$cat_counter++;} if ($i == 65) {echo '<br/><br/><b>' . $categories[$cat_counter] . '</b><br/>';$cat_counter++;
if ($i==233) {echo '<br/><br/><b>'.$categories[$cat_counter].'</b><br/>';$cat_counter++;} }
if ($i==247) {echo '<br/><br/><b>'.$categories[$cat_counter].'</b><br/>';$cat_counter++;} if ($i == 67) {echo '<br/><br/><b>' . $categories[$cat_counter] . '</b><br/>';$cat_counter++;
if ($i==261) {echo '<br/><br/><b>'.$categories[$cat_counter].'</b><br/>';$cat_counter++;} }
if ($i==275) {echo '<br/><br/><b>'.$categories[$cat_counter].'</b><br/>';$cat_counter++;} if ($i == 75) {echo '<br/><br/><b>' . $categories[$cat_counter] . '</b><br/>';$cat_counter++;
if ($i==289) {echo '<br/><br/><b>'.$categories[$cat_counter].'</b><br/>';$cat_counter++;} }
if ($i==293) {echo '<br/><br/><b>'.$categories[$cat_counter].'</b><br/>';$cat_counter++;} /**/ if ($i == 78) {echo '<br/><br/><b>' . $categories[$cat_counter] . '</b><br/>';$cat_counter++;
if ($i==297) {echo '<br/><br/><b>'.$categories[$cat_counter].'</b><br/>';$cat_counter++;} }
if ($i==311) {echo '<br/><br/><b>'.$categories[$cat_counter].'</b><br/>';$cat_counter++;} if ($i == 82) {echo '<br/><br/><b>' . $categories[$cat_counter] . '</b><br/>';$cat_counter++;
if ($i==325) {echo '<br/><br/><b>'.$categories[$cat_counter].'</b><br/>';$cat_counter++;} }
if ($i==339) {echo '<br/><br/><b>'.$categories[$cat_counter].'</b><br/>';$cat_counter++;} if ($i == 86) {echo '<br/><br/><b>' . $categories[$cat_counter] . '</b><br/>';$cat_counter++;
if ($i==353) {echo '<br/><br/><b>'.$categories[$cat_counter].'</b><br/>';$cat_counter++;} }
if ($i==367) {echo '<br/><br/><b>'.$categories[$cat_counter].'</b><br/>';$cat_counter++;} if ($i == 108) {echo '<br/><br/><b>' . $categories[$cat_counter] . '</b><br/>';$cat_counter++;
if ($i==381) {echo '<br/><br/><b>'.$categories[$cat_counter].'</b><br/>';$cat_counter++;} }
if ($i==395) {echo '<br/><br/><b>'.$categories[$cat_counter].'</b><br/>';$cat_counter++;} if ($i == 123) {echo '<br/><br/><b>' . $categories[$cat_counter] . '</b><br/>';$cat_counter++;
if ($i==409) {echo '<br/><br/><b>'.$categories[$cat_counter].'</b><br/>';$cat_counter++;} }
if ($i==423) {echo '<br/><br/><b>'.$categories[$cat_counter].'</b><br/>';$cat_counter++;} if ($i == 133) {echo '<br/><br/><b>' . $categories[$cat_counter] . '</b><br/>';$cat_counter++;
if ($i==437) {echo '<br/><br/><b>'.$categories[$cat_counter].'</b><br/>';$cat_counter++;} }
if ($i==451) {echo '<br/><br/><b>'.$categories[$cat_counter].'</b><br/>';$cat_counter++;} if ($i == 137) {echo '<br/><br/><b>' . $categories[$cat_counter] . '</b><br/>';$cat_counter++;
if ($i==465) {echo '<br/><br/><b>'.$categories[$cat_counter].'</b><br/>';$cat_counter++;} }
if ($i==479) {echo '<br/><br/><b>'.$categories[$cat_counter].'</b><br/>';$cat_counter++;} if ($i == 141) {echo '<br/><br/><b>' . $categories[$cat_counter] . '</b><br/>';$cat_counter++;
if ($i==489) {echo '<br/><br/><b>'.$categories[$cat_counter].'</b><br/>';$cat_counter++;} }
if ($i==503) {echo '<br/><br/><b>'.$categories[$cat_counter].'</b><br/>';$cat_counter++;} if ($i == 145) {echo '<br/><br/><b>' . $categories[$cat_counter] . '</b><br/>';$cat_counter++;
if ($i==517) {echo '<br/><br/><b>'.$categories[$cat_counter].'</b><br/>';$cat_counter++;} }
if ($i==531) {echo '<br/><br/><b>'.$categories[$cat_counter].'</b><br/>';$cat_counter++;} if ($i == 215) {echo '<br/><br/><b>' . $categories[$cat_counter] . '</b><br/>';$cat_counter++;
if ($i==545) {echo '<br/><br/><b>'.$categories[$cat_counter].'</b><br/>';$cat_counter++;} }
if ($i==559) {echo '<br/><br/><b>'.$categories[$cat_counter].'</b><br/>';$cat_counter++;} if ($i == 233) {echo '<br/><br/><b>' . $categories[$cat_counter] . '</b><br/>';$cat_counter++;
if ($i==573) {echo '<br/><br/><b>'.$categories[$cat_counter].'</b><br/>';$cat_counter++;} }
if ($i==587) {echo '<br/><br/><b>'.$categories[$cat_counter].'</b><br/>';$cat_counter++;} if ($i == 247) {echo '<br/><br/><b>' . $categories[$cat_counter] . '</b><br/>';$cat_counter++;
if ($i==601) {echo '<br/><br/><b>'.$categories[$cat_counter].'</b><br/>';$cat_counter++;} }
if ($i==615) {echo '<br/><br/><b>'.$categories[$cat_counter].'</b><br/>';$cat_counter++;} if ($i == 261) {echo '<br/><br/><b>' . $categories[$cat_counter] . '</b><br/>';$cat_counter++;
if ($i==629) {echo '<br/><br/><b>'.$categories[$cat_counter].'</b><br/>';$cat_counter++;} }
if ($i==643) {echo '<br/><br/><b>'.$categories[$cat_counter].'</b><br/>';$cat_counter++;} if ($i == 275) {echo '<br/><br/><b>' . $categories[$cat_counter] . '</b><br/>';$cat_counter++;
if ($i==657) {echo '<br/><br/><b>'.$categories[$cat_counter].'</b><br/>';$cat_counter++;} }
/* if ($i == 289) {echo '<br/><br/><b>' . $categories[$cat_counter] . '</b><br/>';$cat_counter++;
*/ }
echo '<span class="couponcode" style="display:inline-block;padding:3px;border:1px solid #666666;border-radius:2px;margin:2px;'; if ($i == 293) {echo '<br/><br/><b>' . $categories[$cat_counter] . '</b><br/>';$cat_counter++;
if ($allowed[$i][1]=='y') echo 'background-color:#eeee99;'; else echo 'background-color:#eeeeee;'; } /**/
echo '">'; if ($i == 297) {echo '<br/><br/><b>' . $categories[$cat_counter] . '</b><br/>';$cat_counter++;
echo '<span class="coupontooltip">'; }
echo '<p style="text-align:center;padding:0px;margin:0px;line-height:18px;">'.$allowed[$i][0].'</p><hr>'; if ($i == 311) {echo '<br/><br/><b>' . $categories[$cat_counter] . '</b><br/>';$cat_counter++;
if (isset($allowed[$i][1])) echo '<p>Mandatory: '.$allowed[$i][1]."</p>"; }
if (isset($allowed[$i][5])) echo '<p class="hint" style="background-color:black;">'.$allowed[$i][5].'</p>'; if ($i == 325) {echo '<br/><br/><b>' . $categories[$cat_counter] . '</b><br/>';$cat_counter++;
if (isset($allowed[$i][2])) echo '<p>Format: '.$allowed[$i][2]."</p>"; }
if (isset($allowed[$i][3])) echo '<p>Allowed values: '.$allowed[$i][3]."</p>"; if ($i == 339) {echo '<br/><br/><b>' . $categories[$cat_counter] . '</b><br/>';$cat_counter++;
if (isset($allowed[$i][4])) echo '<p>Dependencies: '.$allowed[$i][4]."</p>"; }
echo '</span>'; if ($i == 353) {echo '<br/><br/><b>' . $categories[$cat_counter] . '</b><br/>';$cat_counter++;
echo '<a'; }
echo '>'.$allowed[$i][0].'</a>'; if ($i == 367) {echo '<br/><br/><b>' . $categories[$cat_counter] . '</b><br/>';$cat_counter++;
echo '</span>'; }
// echo '<td>'.$allowed[$i][1].'</td>'; if ($i == 381) {echo '<br/><br/><b>' . $categories[$cat_counter] . '</b><br/>';$cat_counter++;
// echo '<td>'.$allowed[$i][2].'</td>'; }
// echo '<td>'.$allowed[$i][3].'</td>'; if ($i == 395) {echo '<br/><br/><b>' . $categories[$cat_counter] . '</b><br/>';$cat_counter++;
// echo '<td>'.$allowed[$i][4].'</td>'; }
//echo '</tr>'; if ($i == 409) {echo '<br/><br/><b>' . $categories[$cat_counter] . '</b><br/>';$cat_counter++;
}
if ($i == 423) {echo '<br/><br/><b>' . $categories[$cat_counter] . '</b><br/>';$cat_counter++;
}
if ($i == 437) {echo '<br/><br/><b>' . $categories[$cat_counter] . '</b><br/>';$cat_counter++;
}
if ($i == 451) {echo '<br/><br/><b>' . $categories[$cat_counter] . '</b><br/>';$cat_counter++;
}
if ($i == 465) {echo '<br/><br/><b>' . $categories[$cat_counter] . '</b><br/>';$cat_counter++;
}
if ($i == 479) {echo '<br/><br/><b>' . $categories[$cat_counter] . '</b><br/>';$cat_counter++;
}
if ($i == 489) {echo '<br/><br/><b>' . $categories[$cat_counter] . '</b><br/>';$cat_counter++;
}
if ($i == 503) {echo '<br/><br/><b>' . $categories[$cat_counter] . '</b><br/>';$cat_counter++;
}
if ($i == 517) {echo '<br/><br/><b>' . $categories[$cat_counter] . '</b><br/>';$cat_counter++;
}
if ($i == 531) {echo '<br/><br/><b>' . $categories[$cat_counter] . '</b><br/>';$cat_counter++;
}
if ($i == 545) {echo '<br/><br/><b>' . $categories[$cat_counter] . '</b><br/>';$cat_counter++;
}
if ($i == 559) {echo '<br/><br/><b>' . $categories[$cat_counter] . '</b><br/>';$cat_counter++;
}
if ($i == 573) {echo '<br/><br/><b>' . $categories[$cat_counter] . '</b><br/>';$cat_counter++;
}
if ($i == 587) {echo '<br/><br/><b>' . $categories[$cat_counter] . '</b><br/>';$cat_counter++;
}
if ($i == 601) {echo '<br/><br/><b>' . $categories[$cat_counter] . '</b><br/>';$cat_counter++;
}
if ($i == 615) {echo '<br/><br/><b>' . $categories[$cat_counter] . '</b><br/>';$cat_counter++;
}
if ($i == 629) {echo '<br/><br/><b>' . $categories[$cat_counter] . '</b><br/>';$cat_counter++;
}
if ($i == 643) {echo '<br/><br/><b>' . $categories[$cat_counter] . '</b><br/>';$cat_counter++;
}
if ($i == 657) {echo '<br/><br/><b>' . $categories[$cat_counter] . '</b><br/>';$cat_counter++;
}
/*
*/
echo '<span class="couponcode" style="display:inline-block;padding:3px;border:1px solid #666666;border-radius:2px;margin:2px;';
if ($allowed[$i][1] == 'y') echo 'background-color:#eeee99;'; else echo 'background-color:#eeeeee;';
echo '">';
echo '<span class="coupontooltip">';
echo '<p style="text-align:center;padding:0px;margin:0px;line-height:18px;">' . $allowed[$i][0] . '</p><hr>';
if (isset($allowed[$i][1])) echo '<p>Mandatory: ' . $allowed[$i][1] . "</p>";
if (isset($allowed[$i][5])) echo '<p class="hint" style="background-color:black;">' . $allowed[$i][5] . '</p>';
if (isset($allowed[$i][2])) echo '<p>Format: ' . $allowed[$i][2] . "</p>";
if (isset($allowed[$i][3])) echo '<p>Allowed values: ' . $allowed[$i][3] . "</p>";
if (isset($allowed[$i][4])) echo '<p>Dependencies: ' . $allowed[$i][4] . "</p>";
echo '</span>';
echo '<a';
echo '>' . $allowed[$i][0] . '</a>';
echo '</span>';
// echo '<td>'.$allowed[$i][1].'</td>';
// echo '<td>'.$allowed[$i][2].'</td>';
// echo '<td>'.$allowed[$i][3].'</td>';
// echo '<td>'.$allowed[$i][4].'</td>';
//echo '</tr>';
} }
//echo '</table>'; //echo '</table>';
//print_r($allowed); //print_r($allowed);
echo '</div>'; echo '</div>';
echo '</div>'; echo '</div>';
?>

View File

@ -1,5 +1,5 @@
<?PHP <?PHP
$semikoma=$_GET['semikoma']; $semikoma = $_GET['semikoma'];
echo '<link rel="stylesheet" type="text/css" href="css/main.css">'; echo '<link rel="stylesheet" type="text/css" href="css/main.css">';
echo '<div class="title">'; echo '<div class="title">';
echo 'museum-digital CSV to XML converter'; echo 'museum-digital CSV to XML converter';
@ -8,10 +8,9 @@ echo '<div class="maincontent">';
echo '<table border="0" cellpadding="0" cellspacing="0" summary="" width="100%">'; echo '<table border="0" cellpadding="0" cellspacing="0" summary="" width="100%">';
echo '<tr>'; echo '<tr>';
echo '<td width="50%">'; echo '<td width="50%">';
echo 'Please wait ... (transforming)<hr>'; echo 'Please wait ... (transforming)<hr>';
include('csv_laden_iso.php'); require 'csv_laden_iso.php';
echo '</td>'; echo '</td>';
echo '</tr>'; echo '</tr>';
echo '</table>'; echo '</table>';
echo '</div>'; echo '</div>';
?>

View File

@ -4,12 +4,12 @@ echo '<div class="title">';
echo 'museum-digital CSV to XML converter'; echo 'museum-digital CSV to XML converter';
echo '</div>'; echo '</div>';
echo '<div class="maincontent">'; echo '<div class="maincontent">';
$semikoma=$_GET['semikoma']; $semikoma = $_GET['semikoma'];
echo '<table border="0" cellpadding="0" cellspacing="0" summary="" width="100%" style="border-bottom:1px solid #000000;padding-bottom:3px;margin-bottom:5px;">'; echo '<table border="0" cellpadding="0" cellspacing="0" summary="" width="100%" style="border-bottom:1px solid #000000;padding-bottom:3px;margin-bottom:5px;">';
echo '<tr>'; echo '<tr>';
echo '<td width="80%">'; echo '<td width="80%">';
echo 'Please wait ... (checking validity)'; echo 'Please wait ... (checking validity)';
echo '</td>'; echo '</td>';
echo '<td style="text-align:right;padding-top:0px;padding-bottom:0px;">'; echo '<td style="text-align:right;padding-top:0px;padding-bottom:0px;">';
echo '<form action="index.php" style="margin:0px;padding:0px;">'; echo '<form action="index.php" style="margin:0px;padding:0px;">';
echo '<input type="submit" value="Reload" />'; echo '<input type="submit" value="Reload" />';
@ -17,6 +17,5 @@ echo '</form>';
echo '</td>'; echo '</td>';
echo '</tr>'; echo '</tr>';
echo '</table>'; echo '</table>';
include('csv_check.php'); require 'csv_check.php';
echo '</div>'; echo '</div>';
?>

View File

@ -1,7 +1,7 @@
<?PHP <?PHP
//error_reporting(E_ALL); //error_reporting(E_ALL);
//ini_set('display_errors',1); //ini_set('display_errors',1);
$semikoma=$_GET['semikoma']; $semikoma = $_GET['semikoma'];
echo '<link rel="stylesheet" type="text/css" href="css/main.css">'; echo '<link rel="stylesheet" type="text/css" href="css/main.css">';
echo '<div class="title">'; echo '<div class="title">';
echo 'museum-digital CSV to XML converter'; echo 'museum-digital CSV to XML converter';
@ -10,10 +10,9 @@ echo '<div class="maincontent">';
echo '<table border="0" cellpadding="0" cellspacing="0" summary="" width="100%">'; echo '<table border="0" cellpadding="0" cellspacing="0" summary="" width="100%">';
echo '<tr>'; echo '<tr>';
echo '<td width="50%">'; echo '<td width="50%">';
echo 'Please wait ... (transforming)<hr>'; echo 'Please wait ... (transforming)<hr>';
include('csv_laden_utf.php'); require 'csv_laden_utf.php';
echo '</td>'; echo '</td>';
echo '</tr>'; echo '</tr>';
echo '</table>'; echo '</table>';
echo '</div>'; echo '</div>';
?>

View File

@ -4,14 +4,13 @@ echo '<div class="title">';
echo 'museum-digital CSV to XML converter'; echo 'museum-digital CSV to XML converter';
echo '</div>'; echo '</div>';
echo '<div class="maincontent">'; echo '<div class="maincontent">';
$semikoma=$_GET['semikoma']; $semikoma = $_GET['semikoma'];
echo '<table border="0" cellpadding="0" cellspacing="0" summary="" width="100%">'; echo '<table border="0" cellpadding="0" cellspacing="0" summary="" width="100%">';
echo '<tr>'; echo '<tr>';
echo '<td width="50%">'; echo '<td width="50%">';
echo 'Please wait ... (transforming)<hr>'; echo 'Please wait ... (transforming)<hr>';
include('csv_laden.php'); require 'csv_laden.php';
echo '</td>'; echo '</td>';
echo '</tr>'; echo '</tr>';
echo '</table>'; echo '</table>';
echo '</div>'; echo '</div>';
?>

View File

@ -4,12 +4,12 @@ echo '<div class="title">';
echo 'museum-digital CSV to XML converter'; echo 'museum-digital CSV to XML converter';
echo '</div>'; echo '</div>';
echo '<div class="maincontent">'; echo '<div class="maincontent">';
$semikoma=$_GET['semikoma']; $semikoma = $_GET['semikoma'];
echo '<table border="0" cellpadding="0" cellspacing="0" summary="" width="100%">'; echo '<table border="0" cellpadding="0" cellspacing="0" summary="" width="100%">';
echo '<tr>'; echo '<tr>';
echo '<td width="50%">'; echo '<td width="50%">';
echo 'Please wait ... (transforming)<hr>'; echo 'Please wait ... (transforming)<hr>';
include('csv_laden_hu.php'); require 'csv_laden_hu.php';
echo '</td>'; echo '</td>';
echo '</tr>'; echo '</tr>';
echo '</table>'; echo '</table>';

View File

@ -4,37 +4,33 @@ echo '<div class="title">';
echo 'museum-digital CSV to XML converter'; echo 'museum-digital CSV to XML converter';
echo '</div>'; echo '</div>';
echo '<div class="maincontent">'; echo '<div class="maincontent">';
$target = "csv/"; $target = "csv/";
$target = $target . basename( $_FILES['uploaded']['name']) ; $target = $target . basename( $_FILES['uploaded']['name']);
$targetpart = basename( $_FILES['uploaded']['name']); $targetpart = basename( $_FILES['uploaded']['name']);
$ok=1; $ok = 1;
$semikoma=$_POST['deli']; $semikoma = $_POST['deli'];
//This is our size condition //This is our size condition
if ($uploaded_size > 40000000) if ($uploaded_size > 40000000) {
{ echo "Your file is too large.<br>";
echo "Your file is too large.<br>"; $ok = 0;
$ok=0; }
}
//Here we check that $ok was not set to 0 by an error
//Here we check that $ok was not set to 0 by an error if ($ok == 0) {
if ($ok==0) echo "Sorry your file was not uploaded";
{ }
echo "Sorry your file was not uploaded"; else
} {
else //If everything is ok we try to upload it
{ if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target)) {
//If everything is ok we try to upload it echo "The file <b>" . basename( $_FILES['uploaded']['name']) . "</b> has been uploaded<hr>";
if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target)) echo '<a href="index2.php?fnam=' . basename( $_FILES['uploaded']['name']) . '"><img src="img/go.gif"> Create XML (iso8859)</a><br>';
{ echo '<a href="index4.php?fnam=' . basename( $_FILES['uploaded']['name']) . '"><img src="img/go.gif"> Create XML (utf-8)</a><br>';
echo "The file <b>". basename( $_FILES['uploaded']['name']). "</b> has been uploaded<hr>"; echo '<a href="index3.php?fnam=' . basename( $_FILES['uploaded']['name']) . '"><img src="img/go.gif"> Check validity for museum-digital import</a>';
echo '<a href="index2.php?fnam='.basename( $_FILES['uploaded']['name']).'"><img src="img/go.gif"> Create XML (iso8859)</a><br>'; }
echo '<a href="index4.php?fnam='.basename( $_FILES['uploaded']['name']).'"><img src="img/go.gif"> Create XML (utf-8)</a><br>'; else
echo '<a href="index3.php?fnam='.basename( $_FILES['uploaded']['name']).'"><img src="img/go.gif"> Check validity for museum-digital import</a>'; {
} echo "Sorry, there was a problem uploading your file.";
else }
{
echo "Sorry, there was a problem uploading your file.";
}
} }
echo '</div>'; echo '</div>';
?>

View File

@ -6,8 +6,8 @@
3: allowed values (eg. "m", "cm", ...) 3: allowed values (eg. "m", "cm", ...)
4: dependent fields 4: dependent fields
5: remarks 5: remarks
*/ */
$allowed=array( $allowed = array(
array ('inventory_number','y','text/utf8','freetext','none','Only unique values allowed'), array ('inventory_number','y','text/utf8','freetext','none','Only unique values allowed'),
array ('institution_name','n','text/utf8','freetext','none','If name of institution is given it has to be exactly the same as already known in museum-digital'), array ('institution_name','n','text/utf8','freetext','none','If name of institution is given it has to be exactly the same as already known in museum-digital'),
array ('collection_name1','n','text/utf8','freetext','none','Use if object belongs to a collection. If collection is already in museum-digital, please use exactly the same name'), array ('collection_name1','n','text/utf8','freetext','none','Use if object belongs to a collection. If collection is already in museum-digital, please use exactly the same name'),
@ -58,7 +58,7 @@ array ('closer_location_as', 'n', 'text/utf8', 'de: "Aufnahmeort", "Fundort", "F
3: allowed values (eg. "m", "cm", ...) 3: allowed values (eg. "m", "cm", ...)
4: dependent fields 4: dependent fields
5: remarks 5: remarks
*/ */
array ('entry_number', 'n', 'text/utf8','freetext','none','The entry number of the object if available'), array ('entry_number', 'n', 'text/utf8','freetext','none','The entry number of the object if available'),
array ('other_inventory_number', 'n', 'text/utf8','freetext','none','All other inventory numbers (older ones presumably) in one field'), array ('other_inventory_number', 'n', 'text/utf8','freetext','none','All other inventory numbers (older ones presumably) in one field'),
array ('subject_group', 'n', 'text/utf8','freetext','none','If the object is part of an subject group this information should be given here'), array ('subject_group', 'n', 'text/utf8','freetext','none','If the object is part of an subject group this information should be given here'),
@ -692,4 +692,3 @@ array ('illustrated_annotation2', 'n', ''),
); );
?>

View File

@ -1,26 +1,26 @@
<?PHP <?PHP
include_once("inc/zip.php"); require_once "inc/zip.php";
$fileTime = date("D, d M Y H:i:s T"); $fileTime = date("D, d M Y H:i:s T");
$fileDir='xml/'; $fileDir = 'xml/';
$zip = new Zip(); $zip = new Zip();
//$zip->setComment("Example Zip file.\nCreated on " . date('l jS \of F Y h:i:s A')); //$zip->setComment("Example Zip file.\nCreated on " . date('l jS \of F Y h:i:s A'));
//$zip->addFile("Hello World!", "hello.txt"); //$zip->addFile("Hello World!", "hello.txt");
if ($handle = opendir($fileDir)) { if ($handle = opendir($fileDir)) {
/* This is the correct way to loop over the directory. */ /* This is the correct way to loop over the directory. */
while (false !== ($file = readdir($handle))) { while (false !== ($file = readdir($handle))) {
if (strpos($file, ".xml") !== false) { if (strpos($file, ".xml") !== false) {
$pathData = pathinfo($fileDir . $file); $pathData = pathinfo($fileDir . $file);
$fileName = $pathData['filename']; $fileName = $pathData['filename'];
if ($file!='1.xml') if ($file != '1.xml')
$zip->addFile(file_get_contents($fileDir . $file), $file, filectime($fileDir . $file)); $zip->addFile(file_get_contents($fileDir . $file), $file, filectime($fileDir . $file));
} }
} }
} }
if (ini_get('zlib.output_compression')) { if (ini_get('zlib.output_compression')) {
ini_set('zlib.output_compression', 'Off'); ini_set('zlib.output_compression', 'Off');
} }
$zip->finalize(); // Not scrictly necessary, the next line will call it anyway. $zip->finalize(); // Not scrictly necessary, the next line will call it anyway.
@ -35,23 +35,23 @@ header("Connection: close");
header("Content-Type: application/zip"); header("Content-Type: application/zip");
header('Content-Disposition: attachment; filename="csv_xml.zip";' ); header('Content-Disposition: attachment; filename="csv_xml.zip";' );
header("Content-Transfer-Encoding: binary"); header("Content-Transfer-Encoding: binary");
header("Content-Length: ". $length); header("Content-Length: " . $length);
echo $zipData; echo $zipData;
function rrmdir($dir) { function rrmdir($dir) {
if (is_dir($dir)) { if (is_dir($dir)) {
$objects = scandir($dir); $objects = scandir($dir);
foreach ($objects as $object) { foreach ($objects as $object) {
if ($object != "." && $object != "..") { if ($object != "." && $object != "..") {
if (filetype($dir."/".$object) == "dir") rrmdir($dir."/".$object); else unlink($dir."/".$object); if (filetype($dir . "/" . $object) == "dir") rrmdir($dir . "/" . $object); else unlink($dir . "/" . $object);
} }
} }
reset($objects); reset($objects);
rmdir($dir); rmdir($dir);
} }
}
$dir_name='xml'; }
$dir_name = 'xml';
rrmdir($dir_name); rrmdir($dir_name);
?>