csvxml/index.php

191 lines
10 KiB
PHP

<?PHP
error_reporting(E_ALL);
ini_set('display_errors', 1);
?>
<head>
<script language="javascript" type="text/javascript">
var tooltips = document.querySelectorAll('.couponcode');
for(var i = 0; i < tooltips.length; i++) {
tooltips[i].addEventListener('mousemove', function fn(e) {
var tooltip = e.target.classList.contains("coupontooltip") ?
e.target :
e.target.querySelector(':scope .coupontooltip');
tooltip.style.left =
e.pageX + tooltip.clientWidth + 10 <
document.body.clientWidth ?
e.pageX + 10 + 'px' :
document.body.clientWidth + 5 - tooltip.clientWidth + 'px';
tooltip.style.top =
e.pageY + tooltip.clientHeight + 10 <
document.body.clientHeight ?
e.pageY + 10 + 'px' :
document.body.clientHeight + 5 - tooltip.clientHeight + 'px';
});
}</script>
</head>
<?PHP
echo '<meta http-equiv="content-type" content="text/html; charset=utf-8"/>';
echo '<link rel="stylesheet" type="text/css" href="css/main.css">';
echo '<div class="title">';
echo 'museum-digital CSV to XML converter';
echo '</div>';
echo '<div class="maincontent">';
echo '<div class="uploader">';
echo '<form enctype="multipart/form-data" action="upload.php" method="POST" style="margin:0px;padding:0px;">';
echo 'Please choose a csv-file to create xml-files: <input name="uploaded" type="file" />';
echo '<input type="submit" value="Upload" />';
echo '</form>';
echo '</div>';
echo '<div class="main_fieldlist">';
require 'values/all_fields.php';
echo '<p>Currently approved tags (column names) for md:import:</p>';
//echo '<table>';
//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' );
$cat_counter = 0;
for ($i = 0; $i < count($allowed); $i++)
{
//echo '<tr>';
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 == 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 == 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 == 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 == 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 == 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 == 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 == 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 == 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 == 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 == 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 == 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 == 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 == 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 == 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 == 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 == 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 == 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 == 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 == 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>';
//print_r($allowed);
echo '</div>';
echo '</div>';