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

View File

@ -3,7 +3,7 @@ ob_start();
error_reporting(E_ALL); error_reporting(E_ALL);
ini_set('display_errors', 1); ini_set('display_errors', 1);
include ('inc/zeichen.php'); require 'inc/zeichen.php';
$filename = $_GET['fnam']; $filename = $_GET['fnam'];
$csv_datei = 'csv/' . $filename; $csv_datei = 'csv/' . $filename;
@ -34,8 +34,7 @@ for ( $x = 0; $x < count ( $zeile ); $x++ )
{ {
$zeile[$x] = str_replace("\xEF\xBB\xBF", "", $zeile[$x]); $zeile[$x] = str_replace("\xEF\xBB\xBF", "", $zeile[$x]);
$inhalt[$y][$x] = $zeile[$x]; $inhalt[$y][$x] = $zeile[$x];
if (!in_array($inhalt[1][$x], $allowed)) if (!in_array($inhalt[1][$x], $allowed)) {
{
echo '<br><i style="font-style:normal;color:#990000;">ERROR in column ' . $x . ' created by value: ' . $inhalt[1][$x] . '</i>'; echo '<br><i style="font-style:normal;color:#990000;">ERROR in column ' . $x . ' created by value: ' . $inhalt[1][$x] . '</i>';
$error = $error + 1; $error = $error + 1;
} }
@ -48,16 +47,17 @@ if ($error != 0) echo '<br><b style="color:#990000;">Not allowed tags found !</b
//// Check #2 //// Check #2
echo '<br><br>2: Not allowed multiple use of tags (column names)?'; echo '<br><br>2: Not allowed multiple use of tags (column names)?';
$compare = array_unique($zeile); $compare = array_unique($zeile);
function identical_values($arrayA, $arrayB) function identical_values($arrayA, $arrayB)
{ {
sort( $arrayA ); sort( $arrayA );
sort( $arrayB ); sort( $arrayB );
return $arrayA == $arrayB; return $arrayA == $arrayB;
} }
$result = identical_values($zeile, $compare); $result = identical_values($zeile, $compare);
if ($result==false) if ($result == false) {
{
echo '<br><b style="color:#990000;">There are dublicate column names !</b>'; echo '<br><b style="color:#990000;">There are dublicate column names !</b>';
$error = $error + 1; $error = $error + 1;
} }
@ -85,15 +85,17 @@ fclose($fp);
echo '<br><br>3: Mandatory tags available and always filled in?'; echo '<br><br>3: Mandatory tags available and always filled in?';
unset($inv_array); unset($inv_array);
$inv_error = 0; $inv_error = 0;
function get_duplicates($array) function get_duplicates($array)
{ {
return array_unique( array_diff_assoc( $array, array_unique( $array ) ) ); return array_unique( array_diff_assoc( $array, array_unique( $array ) ) );
} }
$mandatory = array('inventory_number','object_type','object_title','object_description'); $mandatory = array('inventory_number','object_type','object_title','object_description');
for ($i = 0; $i < count ($mandatory); $i++) for ($i = 0; $i < count ($mandatory); $i++)
{ {
if (!in_array($mandatory[$i],$erstezeile)) if (!in_array($mandatory[$i], $erstezeile)) {
{
echo '<br><i style="font-style:normal;color:#990000;">Mandatory: Column <b>' . $mandatory[$i] . '</b> missing</i>'; echo '<br><i style="font-style:normal;color:#990000;">Mandatory: Column <b>' . $mandatory[$i] . '</b> missing</i>';
$error = $error + 1; $error = $error + 1;
$inv_error = $inv_error + 1; $inv_error = $inv_error + 1;
@ -103,14 +105,12 @@ for ($i=0;$i<count ($mandatory);$i++)
$spaltenr = array_search($mandatory[$i], $erstezeile); $spaltenr = array_search($mandatory[$i], $erstezeile);
for ($j = 0; $j < $y; $j++) for ($j = 0; $j < $y; $j++)
{ {
if ($inhalt[$j+1][$spaltenr]=='') if ($inhalt[$j + 1][$spaltenr] == '') {
{
echo '<br><i style="font-style:normal;color:#990000;">Missing value for <b>' . $mandatory[$i] . '</b> in row ' . ($j + 1) . '</i>'; echo '<br><i style="font-style:normal;color:#990000;">Missing value for <b>' . $mandatory[$i] . '</b> in row ' . ($j + 1) . '</i>';
$error = $error + 1; $error = $error + 1;
$inv_error = $inv_error + 1; $inv_error = $inv_error + 1;
} }
if ($mandatory[$i]=='inventory_number') if ($mandatory[$i] == 'inventory_number') {
{
$inv_array[] = $inhalt[$j + 1][$spaltenr]; $inv_array[] = $inhalt[$j + 1][$spaltenr];
} }
} }
@ -121,12 +121,10 @@ if ($inv_error==0) echo '<br><i style="font-style:normal;color:#009900;">All man
///// Check #4 ///// Check #4
echo '<br><br>4: Inventory_number unique ?'; echo '<br><br>4: Inventory_number unique ?';
if (in_array('inventory_number',$erstezeile)) if (in_array('inventory_number', $erstezeile)) {
{
$doppelte_inv = get_duplicates($inv_array); $doppelte_inv = get_duplicates($inv_array);
$doppelte_inv = array_values($doppelte_inv); $doppelte_inv = array_values($doppelte_inv);
if (count($doppelte_inv)>0) if (count($doppelte_inv) > 0) {
{
for ($i = 0; $i < count($doppelte_inv); $i++) for ($i = 0; $i < count($doppelte_inv); $i++)
{ {
echo '<br><i style="font-style:normal;color:#990000;">Multiple use of inventory_number <b>' . $doppelte_inv[$i] . '</b></i>'; echo '<br><i style="font-style:normal;color:#990000;">Multiple use of inventory_number <b>' . $doppelte_inv[$i] . '</b></i>';
@ -143,75 +141,55 @@ else
///// Check #5 ///// Check #5
echo '<br><br>5: Dependent colums observed ?<br>'; echo '<br><br>5: Dependent colums observed ?<br>';
if (array_search('object_other_title',$erstezeile)!==false) if (array_search('object_other_title', $erstezeile) !== false) {
{ if (array_search('object_other_title_kind_of', $erstezeile) === false) {
if (array_search('object_other_title_kind_of',$erstezeile)===false)
{
$depencymessage[] = 'One column of object_other_title, object_other_title_kind_of is missing'; $depencymessage[] = 'One column of object_other_title, object_other_title_kind_of is missing';
} }
} }
if (array_search('object_other_title_kind_of',$erstezeile)!==false) if (array_search('object_other_title_kind_of', $erstezeile) !== false) {
{ if (array_search('object_other_title', $erstezeile) === false) {
if (array_search('object_other_title',$erstezeile)===false)
{
$depencymessage[] = 'One column of object_other_title, object_other_title_kind_of is missing'; $depencymessage[] = 'One column of object_other_title, object_other_title_kind_of is missing';
} }
} }
if (array_search('other_object_title',$erstezeile)!==false) if (array_search('other_object_title', $erstezeile) !== false) {
{ if (array_search('other_object_title_in', $erstezeile) === false) {
if (array_search('other_object_title_in',$erstezeile)===false)
{
$depencymessage[] = 'One column of other_object_title, other_object_title_in is missing'; $depencymessage[] = 'One column of other_object_title, other_object_title_in is missing';
} }
} }
if (array_search('other_object_title_in',$erstezeile)!==false) if (array_search('other_object_title_in', $erstezeile) !== false) {
{ if (array_search('other_object_title', $erstezeile) === false) {
if (array_search('other_object_title',$erstezeile)===false)
{
$depencymessage[] = 'One column of other_object_title, other_object_title_in is missing'; $depencymessage[] = 'One column of other_object_title, other_object_title_in is missing';
} }
} }
if (array_search('detailed_description',$erstezeile)!==false) if (array_search('detailed_description', $erstezeile) !== false) {
{ if (array_search('detailed_description_md', $erstezeile) === false or array_search('detailed_description_extern', $erstezeile) === false) {
if (array_search('detailed_description_md',$erstezeile)===false or array_search('detailed_description_extern',$erstezeile)===false)
{
$depencymessage[] = 'One column of detailed_description, detailed_description_md, detailed_description_extern is missing'; $depencymessage[] = 'One column of detailed_description, detailed_description_md, detailed_description_extern is missing';
} }
} }
if (array_search('detailed_description_md',$erstezeile)!==false) if (array_search('detailed_description_md', $erstezeile) !== false) {
{ if (array_search('detailed_description', $erstezeile) === false or array_search('detailed_description_extern', $erstezeile) === false) {
if (array_search('detailed_description',$erstezeile)===false or array_search('detailed_description_extern',$erstezeile)===false)
{
$depencymessage[] = 'One column of detailed_description, detailed_description_md, detailed_description_extern is missing'; $depencymessage[] = 'One column of detailed_description, detailed_description_md, detailed_description_extern is missing';
} }
} }
if (array_search('detailed_description_extern',$erstezeile)!==false) if (array_search('detailed_description_extern', $erstezeile) !== false) {
{ if (array_search('detailed_description', $erstezeile) === false or array_search('detailed_description_md', $erstezeile) === false) {
if (array_search('detailed_description',$erstezeile)===false or array_search('detailed_description_md',$erstezeile)===false)
{
$depencymessage[] = 'One column of detailed_description, detailed_description_md, detailed_description_extern is missing'; $depencymessage[] = 'One column of detailed_description, detailed_description_md, detailed_description_extern is missing';
} }
} }
// dependency of colums: inscription. If one of inscription or inscription_md or inscription_extern is given - all three are necessary // dependency of colums: inscription. If one of inscription or inscription_md or inscription_extern is given - all three are necessary
if (array_search('inscription',$erstezeile)!==false) if (array_search('inscription', $erstezeile) !== false) {
{ if (array_search('inscription_md', $erstezeile) === false or array_search('inscription_extern', $erstezeile) === false) {
if (array_search('inscription_md',$erstezeile)===false or array_search('inscription_extern',$erstezeile)===false)
{
$depencymessage[] = 'One column of inscription, inscription_md, inscription_extern is missing'; $depencymessage[] = 'One column of inscription, inscription_md, inscription_extern is missing';
} }
} }
if (array_search('inscription_md',$erstezeile)!==false) if (array_search('inscription_md', $erstezeile) !== false) {
{ if (array_search('inscription', $erstezeile) === false or array_search('inscription_extern', $erstezeile) === false) {
if (array_search('inscription',$erstezeile)===false or array_search('inscription_extern',$erstezeile)===false)
{
$depencymessage[] = 'One column of inscription, inscription_md, inscription_extern is missing'; $depencymessage[] = 'One column of inscription, inscription_md, inscription_extern is missing';
} }
} }
if (array_search('inscription_extern',$erstezeile)!==false) if (array_search('inscription_extern', $erstezeile) !== false) {
{ if (array_search('inscription', $erstezeile) === false or array_search('inscription_md', $erstezeile) === false) {
if (array_search('inscription',$erstezeile)===false or array_search('inscription_md',$erstezeile)===false)
{
$depencymessage[] = 'One column of inscription, inscription_md, inscription_extern is missing'; $depencymessage[] = 'One column of inscription, inscription_md, inscription_extern is missing';
} }
} }
@ -219,24 +197,18 @@ if (array_search('inscription_extern',$erstezeile)!==false)
// dependency of colums: object_group1 to 5. If one of object_group_name1 or object_group_description1 or object_group_show1 is given - all three are necessary // dependency of colums: object_group1 to 5. If one of object_group_name1 or object_group_description1 or object_group_show1 is given - all three are necessary
for ($og = 1; $og < 6; $og++) for ($og = 1; $og < 6; $og++)
{ {
if (array_search('object_group_name'.$og,$erstezeile)!==false) if (array_search('object_group_name' . $og, $erstezeile) !== false) {
{ if (array_search('object_group_description' . $og, $erstezeile) === false or array_search('object_group_show' . $og, $erstezeile) === false) {
if (array_search('object_group_description'.$og,$erstezeile)===false or array_search('object_group_show'.$og,$erstezeile)===false)
{
$depencymessage[] = 'One column of object_group_name' . $og . ', object_group_description' . $og . ', object_group_show' . $og . ' is missing'; $depencymessage[] = 'One column of object_group_name' . $og . ', object_group_description' . $og . ', object_group_show' . $og . ' is missing';
} }
} }
if (array_search('object_group_description'.$og,$erstezeile)!==false) if (array_search('object_group_description' . $og, $erstezeile) !== false) {
{ if (array_search('object_group_name' . $og, $erstezeile) === false or array_search('object_group_show' . $og, $erstezeile) === false) {
if (array_search('object_group_name'.$og,$erstezeile)===false or array_search('object_group_show'.$og,$erstezeile)===false)
{
$depencymessage[] = 'One column of object_group_name' . $og . ', object_group_description' . $og . ', object_group_show' . $og . ' is missing'; $depencymessage[] = 'One column of object_group_name' . $og . ', object_group_description' . $og . ', object_group_show' . $og . ' is missing';
} }
} }
if (array_search('object_group_show'.$og,$erstezeile)!==false) if (array_search('object_group_show' . $og, $erstezeile) !== false) {
{ if (array_search('object_group_name' . $og, $erstezeile) === false or array_search('object_group_description' . $og, $erstezeile) === false) {
if (array_search('object_group_name'.$og,$erstezeile)===false or array_search('object_group_description'.$og,$erstezeile)===false)
{
$depencymessage[] = 'One column of object_group_name' . $og . ', object_group_description' . $og . ', object_group_show' . $og . ' is missing'; $depencymessage[] = 'One column of object_group_name' . $og . ', object_group_description' . $og . ', object_group_show' . $og . ' is missing';
} }
} }
@ -245,246 +217,182 @@ for ($og=1;$og<6;$og++)
// dependency of colums: images. If one of image_name1 or image_rights1 or image_visible1 is given - all three are necessary // dependency of colums: images. If one of image_name1 or image_rights1 or image_visible1 is given - all three are necessary
for ($im = 1; $im < 29; $im++) for ($im = 1; $im < 29; $im++)
{ {
if (array_search('image_name'.$im,$erstezeile)!==false) if (array_search('image_name' . $im, $erstezeile) !== false) {
{ if (array_search('image_rights' . $im, $erstezeile) === false or array_search('image_visible' . $im, $erstezeile) === false or array_search('image_main' . $im, $erstezeile) === false) {
if (array_search('image_rights'.$im,$erstezeile)===false or array_search('image_visible'.$im,$erstezeile)===false or array_search('image_main'.$im,$erstezeile)===false) $depencymessage[] = 'One column of image_name' . $im . ', image_rights' . $im . ', image_visible' . $im . ', image_main' . $im . ' is missing';
{
$depencymessage[]='One column of image_name'.$im.', image_rights'.$im.', image_visible'.$im.', image_main'.$im.' is missing'; }
} }
if (array_search('image_rights'.$im,$erstezeile)!==false)
{
if (array_search('image_name'.$im,$erstezeile)===false or array_search('image_visible'.$im,$erstezeile)===false or array_search('image_main'.$im,$erstezeile)===false)
{
$depencymessage[]='One column of image_name'.$im.', image_rights'.$im.', image_visible'.$im.', image_main'.$im.' is missing'; }
} }
if (array_search('image_visible'.$im,$erstezeile)!==false) if (array_search('image_rights' . $im, $erstezeile) !== false) {
{ if (array_search('image_name' . $im, $erstezeile) === false or array_search('image_visible' . $im, $erstezeile) === false or array_search('image_main' . $im, $erstezeile) === false) {
if (array_search('image_name'.$im,$erstezeile)===false or array_search('image_rights'.$im,$erstezeile)===false or array_search('image_main'.$im,$erstezeile)===false) $depencymessage[] = 'One column of image_name' . $im . ', image_rights' . $im . ', image_visible' . $im . ', image_main' . $im . ' is missing';
{
$depencymessage[]='One column of image_name'.$im.', image_rights'.$im.', image_visible'.$im.', image_main'.$im.' is missing'; }
} }
if (array_search('image_main'.$im,$erstezeile)!==false) }
{ if (array_search('image_visible' . $im, $erstezeile) !== false) {
if (array_search('image_name'.$im,$erstezeile)===false or array_search('image_rights'.$im,$erstezeile)===false or array_search('image_visible'.$im,$erstezeile)===false) if (array_search('image_name' . $im, $erstezeile) === false or array_search('image_rights' . $im, $erstezeile) === false or array_search('image_main' . $im, $erstezeile) === false) {
{ $depencymessage[] = 'One column of image_name' . $im . ', image_rights' . $im . ', image_visible' . $im . ', image_main' . $im . ' is missing';
}
}
if (array_search('image_main' . $im, $erstezeile) !== false) {
if (array_search('image_name' . $im, $erstezeile) === false or array_search('image_rights' . $im, $erstezeile) === false or array_search('image_visible' . $im, $erstezeile) === false) {
$depencymessage[] = 'One column of image_name' . $im . ', image_rights' . $im . ', image_visible' . $im . ', image_main' . $im . ' is missing'; $depencymessage[] = 'One column of image_name' . $im . ', image_rights' . $im . ', image_visible' . $im . ', image_main' . $im . ' is missing';
} }
} }
} }
// dependency of colums: comparable_objects_other_museums. If one of comparable_objects_other_museums or comparable_objects_other_museums_show_md or comparable_objects_other_museums_show_extern is given - all three are necessary // dependency of colums: comparable_objects_other_museums. If one of comparable_objects_other_museums or comparable_objects_other_museums_show_md or comparable_objects_other_museums_show_extern is given - all three are necessary
if (array_search('comparable_objects_other_museums',$erstezeile)!==false) if (array_search('comparable_objects_other_museums', $erstezeile) !== false) {
{ if (array_search('comparable_objects_other_museums_show_md', $erstezeile) === false or array_search('comparable_objects_other_museums_show_extern', $erstezeile) === false) {
if (array_search('comparable_objects_other_museums_show_md',$erstezeile)===false or array_search('comparable_objects_other_museums_show_extern',$erstezeile)===false)
{
$depencymessage[] = 'One column of comparable_objects_other_museums, comparable_objects_other_museums_show_md, comparable_objects_other_museums_show_extern is missing'; $depencymessage[] = 'One column of comparable_objects_other_museums, comparable_objects_other_museums_show_md, comparable_objects_other_museums_show_extern is missing';
} }
} }
if (array_search('comparable_objects_other_museums_show_md',$erstezeile)!==false) if (array_search('comparable_objects_other_museums_show_md', $erstezeile) !== false) {
{ if (array_search('comparable_objects_other_museums', $erstezeile) === false or array_search('comparable_objects_other_museums_show_extern', $erstezeile) === false) {
if (array_search('comparable_objects_other_museums',$erstezeile)===false or array_search('comparable_objects_other_museums_show_extern',$erstezeile)===false)
{
$depencymessage[] = 'One column of comparable_objects_other_museums, comparable_objects_other_museums_show_md, comparable_objects_other_museums_show_extern is missing'; $depencymessage[] = 'One column of comparable_objects_other_museums, comparable_objects_other_museums_show_md, comparable_objects_other_museums_show_extern is missing';
} }
} }
if (array_search('comparable_objects_other_museums_show_extern',$erstezeile)!==false) if (array_search('comparable_objects_other_museums_show_extern', $erstezeile) !== false) {
{ if (array_search('comparable_objects_other_museums', $erstezeile) === false or array_search('comparable_objects_other_museums_show_md', $erstezeile) === false) {
if (array_search('comparable_objects_other_museums',$erstezeile)===false or array_search('comparable_objects_other_museums_show_md',$erstezeile)===false)
{
$depencymessage[] = 'One column of comparable_objects_other_museums, comparable_objects_other_museums_show_md, comparable_objects_other_museums_show_extern is missing'; $depencymessage[] = 'One column of comparable_objects_other_museums, comparable_objects_other_museums_show_md, comparable_objects_other_museums_show_extern is missing';
} }
} }
if (array_search('dimensions_separate_length_value',$erstezeile)!==false) if (array_search('dimensions_separate_length_value', $erstezeile) !== false) {
{ if (array_search('dimensions_separate_length_unit', $erstezeile) === false) {
if (array_search('dimensions_separate_length_unit',$erstezeile)===false)
{
$depencymessage[] = 'One column of dimensions_separate_length_value, dimensions_separate_length_unit is missing'; $depencymessage[] = 'One column of dimensions_separate_length_value, dimensions_separate_length_unit is missing';
} }
} }
if (array_search('dimensions_separate_length_unit',$erstezeile)!==false) if (array_search('dimensions_separate_length_unit', $erstezeile) !== false) {
{ if (array_search('dimensions_separate_length_value', $erstezeile) === false) {
if (array_search('dimensions_separate_length_value',$erstezeile)===false)
{
$depencymessage[] = 'One column of dimensions_separate_length_value, dimensions_separate_length_unit is missing'; $depencymessage[] = 'One column of dimensions_separate_length_value, dimensions_separate_length_unit is missing';
} }
} }
if (array_search('dimensions_separate_width_value',$erstezeile)!==false) if (array_search('dimensions_separate_width_value', $erstezeile) !== false) {
{ if (array_search('dimensions_separate_width_unit', $erstezeile) === false) {
if (array_search('dimensions_separate_width_unit',$erstezeile)===false)
{
$depencymessage[] = 'One column of dimensions_separate_width_value, dimensions_separate_width_unit is missing'; $depencymessage[] = 'One column of dimensions_separate_width_value, dimensions_separate_width_unit is missing';
} }
} }
if (array_search('dimensions_separate_width_unit',$erstezeile)!==false) if (array_search('dimensions_separate_width_unit', $erstezeile) !== false) {
{ if (array_search('dimensions_separate_width_value', $erstezeile) === false) {
if (array_search('dimensions_separate_width_value',$erstezeile)===false)
{
$depencymessage[] = 'One column of dimensions_separate_width_value, dimensions_separate_width_unit is missing'; $depencymessage[] = 'One column of dimensions_separate_width_value, dimensions_separate_width_unit is missing';
} }
} }
if (array_search('dimensions_separate_height_value',$erstezeile)!==false) if (array_search('dimensions_separate_height_value', $erstezeile) !== false) {
{ if (array_search('dimensions_separate_height_unit', $erstezeile) === false) {
if (array_search('dimensions_separate_height_unit',$erstezeile)===false)
{
$depencymessage[] = 'One column of dimensions_separate_height_value, dimensions_separate_height_unit is missing'; $depencymessage[] = 'One column of dimensions_separate_height_value, dimensions_separate_height_unit is missing';
} }
} }
if (array_search('dimensions_separate_height_unit',$erstezeile)!==false) if (array_search('dimensions_separate_height_unit', $erstezeile) !== false) {
{ if (array_search('dimensions_separate_height_value', $erstezeile) === false) {
if (array_search('dimensions_separate_height_value',$erstezeile)===false)
{
$depencymessage[] = 'One column of dimensions_separate_height_value, dimensions_separate_height_unit is missing'; $depencymessage[] = 'One column of dimensions_separate_height_value, dimensions_separate_height_unit is missing';
} }
} }
if (array_search('dimensions_separate_diameter_value',$erstezeile)!==false) if (array_search('dimensions_separate_diameter_value', $erstezeile) !== false) {
{ if (array_search('dimensions_separate_diameter_unit', $erstezeile) === false) {
if (array_search('dimensions_separate_diameter_unit',$erstezeile)===false)
{
$depencymessage[] = 'One column of dimensions_separate_diameter_value, dimensions_separate_diameter_unit is missing'; $depencymessage[] = 'One column of dimensions_separate_diameter_value, dimensions_separate_diameter_unit is missing';
} }
} }
if (array_search('dimensions_separate_diameter_unit',$erstezeile)!==false) if (array_search('dimensions_separate_diameter_unit', $erstezeile) !== false) {
{ if (array_search('dimensions_separate_diameter_value', $erstezeile) === false) {
if (array_search('dimensions_separate_diameter_value',$erstezeile)===false)
{
$depencymessage[] = 'One column of dimensions_separate_diameter_value, dimensions_separate_diameter_unit is missing'; $depencymessage[] = 'One column of dimensions_separate_diameter_value, dimensions_separate_diameter_unit is missing';
} }
} }
if (array_search('dimensions_separate_wall_thickness_value',$erstezeile)!==false) if (array_search('dimensions_separate_wall_thickness_value', $erstezeile) !== false) {
{ if (array_search('dimensions_separate_wall_thickness_unit', $erstezeile) === false) {
if (array_search('dimensions_separate_wall_thickness_unit',$erstezeile)===false)
{
$depencymessage[] = 'One column of dimensions_separate_wall_thickness_value, dimensions_separate_wall_thickness_unit is missing'; $depencymessage[] = 'One column of dimensions_separate_wall_thickness_value, dimensions_separate_wall_thickness_unit is missing';
} }
} }
if (array_search('dimensions_separate_wall_thickness_unit',$erstezeile)!==false) if (array_search('dimensions_separate_wall_thickness_unit', $erstezeile) !== false) {
{ if (array_search('dimensions_separate_wall_thickness_value', $erstezeile) === false) {
if (array_search('dimensions_separate_wall_thickness_value',$erstezeile)===false)
{
$depencymessage[] = 'One column of dimensions_separate_wall_thickness_value, dimensions_separate_wall_thickness_unit is missing'; $depencymessage[] = 'One column of dimensions_separate_wall_thickness_value, dimensions_separate_wall_thickness_unit is missing';
} }
} }
if (array_search('dimensions_separate_weight_value',$erstezeile)!==false) if (array_search('dimensions_separate_weight_value', $erstezeile) !== false) {
{ if (array_search('dimensions_separate_weight_unit', $erstezeile) === false) {
if (array_search('dimensions_separate_weight_unit',$erstezeile)===false)
{
$depencymessage[] = 'One column of dimensions_separate_weight_value, dimensions_separate_weight_unit is missing'; $depencymessage[] = 'One column of dimensions_separate_weight_value, dimensions_separate_weight_unit is missing';
} }
} }
if (array_search('dimensions_separate_weight_unit',$erstezeile)!==false) if (array_search('dimensions_separate_weight_unit', $erstezeile) !== false) {
{ if (array_search('dimensions_separate_weight_value', $erstezeile) === false) {
if (array_search('dimensions_separate_weight_value',$erstezeile)===false)
{
$depencymessage[] = 'One column of dimensions_separate_weight_value, dimensions_separate_weight_unit is missing'; $depencymessage[] = 'One column of dimensions_separate_weight_value, dimensions_separate_weight_unit is missing';
} }
} }
if (array_search('closer_location',$erstezeile)!==false) if (array_search('closer_location', $erstezeile) !== false) {
{ if (array_search('closer_location_as', $erstezeile) === false) {
if (array_search('closer_location_as',$erstezeile)===false)
{
$depencymessage[] = 'One column of closer_location, closer_location_as is missing'; $depencymessage[] = 'One column of closer_location, closer_location_as is missing';
} }
} }
if (array_search('closer_location_as',$erstezeile)!==false) if (array_search('closer_location_as', $erstezeile) !== false) {
{ if (array_search('closer_location', $erstezeile) === false) {
if (array_search('closer_location',$erstezeile)===false)
{
$depencymessage[] = 'One column of closer_location, closer_location_as is missing'; $depencymessage[] = 'One column of closer_location, closer_location_as is missing';
} }
} }
if (array_search('bought_for',$erstezeile)!==false) if (array_search('bought_for', $erstezeile) !== false) {
{ if (array_search('bought_for_currency', $erstezeile) === false) {
if (array_search('bought_for_currency',$erstezeile)===false)
{
$depencymessage[] = 'One column of bought_for, bought_for_currency is missing'; $depencymessage[] = 'One column of bought_for, bought_for_currency is missing';
} }
} }
if (array_search('bought_for_currency',$erstezeile)!==false) if (array_search('bought_for_currency', $erstezeile) !== false) {
{ if (array_search('bought_for', $erstezeile) === false) {
if (array_search('bought_for',$erstezeile)===false)
{
$depencymessage[] = 'One column of bought_for, bought_for_currency is missing'; $depencymessage[] = 'One column of bought_for, bought_for_currency is missing';
} }
} }
if (array_search('worth_value',$erstezeile)!==false) if (array_search('worth_value', $erstezeile) !== false) {
{ if (array_search('worth_unit', $erstezeile) === false) {
if (array_search('worth_unit',$erstezeile)===false)
{
$depencymessage[] = 'One column of worth_value, worth_unit is missing'; $depencymessage[] = 'One column of worth_value, worth_unit is missing';
} }
} }
if (array_search('worth_unit',$erstezeile)!==false) if (array_search('worth_unit', $erstezeile) !== false) {
{ if (array_search('worth_value', $erstezeile) === false) {
if (array_search('worth_value',$erstezeile)===false)
{
$depencymessage[] = 'One column of worth_value, worth_unit is missing'; $depencymessage[] = 'One column of worth_value, worth_unit is missing';
} }
} }
if (array_search('worth_insurance_value',$erstezeile)!==false) if (array_search('worth_insurance_value', $erstezeile) !== false) {
{ if (array_search('worth_insurance_unit', $erstezeile) === false) {
if (array_search('worth_insurance_unit',$erstezeile)===false)
{
$depencymessage[] = 'One column of worth_insurance_value, worth_insurance_unit is missing'; $depencymessage[] = 'One column of worth_insurance_value, worth_insurance_unit is missing';
} }
} }
if (array_search('worth_insurance_unit',$erstezeile)!==false) if (array_search('worth_insurance_unit', $erstezeile) !== false) {
{ if (array_search('worth_insurance_value', $erstezeile) === false) {
if (array_search('worth_insurance_value',$erstezeile)===false)
{
$depencymessage[] = 'One column of worth_insurance_value, worth_insurance_unit is missing'; $depencymessage[] = 'One column of worth_insurance_value, worth_insurance_unit is missing';
} }
} }
if (array_search('link_url1',$erstezeile)!==false) if (array_search('link_url1', $erstezeile) !== false) {
{ if (array_search('link_show1', $erstezeile) === false) {
if (array_search('link_show1',$erstezeile)===false)
{
$depencymessage[] = 'One column of link_url1, link_show1 is missing'; $depencymessage[] = 'One column of link_url1, link_show1 is missing';
} }
} }
if (array_search('link_show1',$erstezeile)!==false) if (array_search('link_show1', $erstezeile) !== false) {
{ if (array_search('link_url1', $erstezeile) === false) {
if (array_search('link_url1',$erstezeile)===false)
{
$depencymessage[] = 'One column of link_url1, link_show1 is missing'; $depencymessage[] = 'One column of link_url1, link_show1 is missing';
} }
} }
if (array_search('link_url2',$erstezeile)!==false) if (array_search('link_url2', $erstezeile) !== false) {
{ if (array_search('link_show2', $erstezeile) === false) {
if (array_search('link_show2',$erstezeile)===false)
{
$depencymessage[] = 'One column of link_url2, link_show2 is missing'; $depencymessage[] = 'One column of link_url2, link_show2 is missing';
} }
} }
if (array_search('link_show2',$erstezeile)!==false) if (array_search('link_show2', $erstezeile) !== false) {
{ if (array_search('link_url2', $erstezeile) === false) {
if (array_search('link_url2',$erstezeile)===false)
{
$depencymessage[] = 'One column of link_url2, link_show2 is missing'; $depencymessage[] = 'One column of link_url2, link_show2 is missing';
} }
} }
for ($i = 0; $i < count($eventpart); $i++) for ($i = 0; $i < count($eventpart); $i++)
{ {
if (array_search($eventpart[$i],$erstezeile)!==false) if (array_search($eventpart[$i], $erstezeile) !== false) {
{ if (array_search($eventpartsure[$i], $erstezeile) === false) {
if (array_search($eventpartsure[$i],$erstezeile)===false)
{
echo $eventpart[$i]; echo $eventpart[$i];
$depencymessage[] = 'One column of ' . $eventpart[$i] . ', ' . $eventpartsure[$i] . ' is missing'; $depencymessage[] = 'One column of ' . $eventpart[$i] . ', ' . $eventpartsure[$i] . ' is missing';
} }
} }
if (array_search($eventpartsure[$i],$erstezeile)!==false) if (array_search($eventpartsure[$i], $erstezeile) !== false) {
{ if (array_search($eventpart[$i], $erstezeile) === false) {
if (array_search($eventpart[$i],$erstezeile)===false)
{
$depencymessage[] = 'One column of ' . $eventpart[$i] . ', ' . $eventpartsure[$i] . ' is missing'; $depencymessage[] = 'One column of ' . $eventpart[$i] . ', ' . $eventpartsure[$i] . ' is missing';
} }
} }
} }
if (isset($depencymessage) and $depencymessage!='') if (isset($depencymessage) and $depencymessage != '') {
{
echo '<b style="color:#990000;">Dependent columns were not observed !</b>'; echo '<b style="color:#990000;">Dependent columns were not observed !</b>';
for ($i = 0; $i < count ($depencymessage); $i++) for ($i = 0; $i < count ($depencymessage); $i++)
{ {
@ -502,12 +410,10 @@ echo '<br><br>6: Dependency of content observed?';
$depcon_error = 0; $depcon_error = 0;
for ($l = 0; $l < count($crosscheck1); $l++) for ($l = 0; $l < count($crosscheck1); $l++)
{ {
if (in_array($crosscheck1[$l],$erstezeile)) if (in_array($crosscheck1[$l], $erstezeile)) {
{
for ($j = 1; $j < ($y + 1); $j++) for ($j = 1; $j < ($y + 1); $j++)
{ {
if ($inhalt[$j][array_search($crosscheck2[$l],$erstezeile)]!=='' and $inhalt[$j][array_search($crosscheck1[$l],$erstezeile)]=='') if ($inhalt[$j][array_search($crosscheck2[$l], $erstezeile)] !== '' and $inhalt[$j][array_search($crosscheck1[$l], $erstezeile)] == '') {
{
echo '<br>Tag <b>' . $crosscheck2[$l] . '</b> given but no entry for <b>' . $crosscheck1[$l] . '</b> (row ' . $j . ')'; echo '<br>Tag <b>' . $crosscheck2[$l] . '</b> given but no entry for <b>' . $crosscheck1[$l] . '</b> (row ' . $j . ')';
$depcon_error = $depcon_error + 1; $depcon_error = $depcon_error + 1;
} }
@ -516,35 +422,29 @@ for ($l=0;$l<count($crosscheck1);$l++)
} }
for ($l = 0; $l < count($eventpart); $l++) for ($l = 0; $l < count($eventpart); $l++)
{ {
if (in_array($eventpart[$l],$erstezeile)) if (in_array($eventpart[$l], $erstezeile)) {
{
for ($j = 1; $j < ($y + 1); $j++) for ($j = 1; $j < ($y + 1); $j++)
{ {
if ($inhalt[$j][array_search($eventpartsure[$l],$erstezeile)]!=='' and $inhalt[$j][array_search($eventpart[$l],$erstezeile)]=='') if ($inhalt[$j][array_search($eventpartsure[$l], $erstezeile)] !== '' and $inhalt[$j][array_search($eventpart[$l], $erstezeile)] == '') {
{
echo '<br>Tag <b>' . $eventpartsure[$l] . '</b> given but no entry for <b>' . $eventpart[$l] . '</b> (row ' . $j . ')'; echo '<br>Tag <b>' . $eventpartsure[$l] . '</b> given but no entry for <b>' . $eventpart[$l] . '</b> (row ' . $j . ')';
$depcon_error = $depcon_error + 1; $depcon_error = $depcon_error + 1;
} }
} }
} }
} }
if (in_array('dimensions_separate_show_md',$erstezeile)) if (in_array('dimensions_separate_show_md', $erstezeile)) {
{
for ($j = 1; $j < ($y + 1); $j++) for ($j = 1; $j < ($y + 1); $j++)
{ {
if ($inhalt[$j][array_search('dimensions_separate_show_md',$erstezeile)]!=='' and ($inhalt[$j][array_search('dimensions_separate_length_value',$erstezeile)]=='') and $inhalt[$j][array_search('dimensions_separate_width_value',$erstezeile)]=='' and $inhalt[$j][array_search('dimensions_separate_heigt_value',$erstezeile)]=='' and $inhalt[$j][array_search('dimensions_separate_weight_value',$erstezeile)]=='' and $inhalt[$j][array_search('dimensions_separate_diameter_value',$erstezeile)]=='' and $inhalt[$j][array_search('dimensions_separate_wall_thickness_value',$erstezeile)]=='') if ($inhalt[$j][array_search('dimensions_separate_show_md', $erstezeile)] !== '' and ($inhalt[$j][array_search('dimensions_separate_length_value', $erstezeile)] == '') and $inhalt[$j][array_search('dimensions_separate_width_value', $erstezeile)] == '' and $inhalt[$j][array_search('dimensions_separate_heigt_value', $erstezeile)] == '' and $inhalt[$j][array_search('dimensions_separate_weight_value', $erstezeile)] == '' and $inhalt[$j][array_search('dimensions_separate_diameter_value', $erstezeile)] == '' and $inhalt[$j][array_search('dimensions_separate_wall_thickness_value', $erstezeile)] == '') {
{
echo '<br>Tag <b>dimensions_separate_show_md</b> given but no separate values available (row ' . $j . ')'; echo '<br>Tag <b>dimensions_separate_show_md</b> given but no separate values available (row ' . $j . ')';
$depcon_error = $depcon_error + 1; $depcon_error = $depcon_error + 1;
} }
} }
} }
if (in_array('dimensions_separate_show_extern',$erstezeile)) if (in_array('dimensions_separate_show_extern', $erstezeile)) {
{
for ($j = 1; $j < ($y + 1); $j++) for ($j = 1; $j < ($y + 1); $j++)
{ {
if ($inhalt[$j][array_search('dimensions_separate_show_extern',$erstezeile)]!=='' and ($inhalt[$j][array_search('dimensions_separate_length_value',$erstezeile)]=='') and $inhalt[$j][array_search('dimensions_separate_width_value',$erstezeile)]=='' and $inhalt[$j][array_search('dimensions_separate_heigt_value',$erstezeile)]=='' and $inhalt[$j][array_search('dimensions_separate_weight_value',$erstezeile)]=='' and $inhalt[$j][array_search('dimensions_separate_diameter_value',$erstezeile)]=='' and $inhalt[$j][array_search('dimensions_separate_wall_thickness_value',$erstezeile)]=='') if ($inhalt[$j][array_search('dimensions_separate_show_extern', $erstezeile)] !== '' and ($inhalt[$j][array_search('dimensions_separate_length_value', $erstezeile)] == '') and $inhalt[$j][array_search('dimensions_separate_width_value', $erstezeile)] == '' and $inhalt[$j][array_search('dimensions_separate_heigt_value', $erstezeile)] == '' and $inhalt[$j][array_search('dimensions_separate_weight_value', $erstezeile)] == '' and $inhalt[$j][array_search('dimensions_separate_diameter_value', $erstezeile)] == '' and $inhalt[$j][array_search('dimensions_separate_wall_thickness_value', $erstezeile)] == '') {
{
echo '<br>Tag <b>dimensions_separate_show_extern</b> given but no separate values available (row ' . $j . ')'; echo '<br>Tag <b>dimensions_separate_show_extern</b> given but no separate values available (row ' . $j . ')';
$depcon_error = $depcon_error + 1; $depcon_error = $depcon_error + 1;
} }
@ -579,131 +479,107 @@ for ($i=1;$i<=$y;$i++)
{ {
for ($j = 0; $j < count ($inhalt[$i]); $j++) for ($j = 0; $j < count ($inhalt[$i]); $j++)
{ {
if ($inhalt[1][$j]=='object_other_title_kind_of' and !$inhalt[$i][array_search('object_other_title',$erstezeile)]=='') if ($inhalt[1][$j] == 'object_other_title_kind_of' and !$inhalt[$i][array_search('object_other_title', $erstezeile)] == '') {
{
if ($inhalt[$i][$j] != '') $showvalue = '<b style="color:#990000">' . $inhalt[$i][$j] . '</b>'; else $showvalue = '<b style="color:#990000">[empty]</b>'; if ($inhalt[$i][$j] != '') $showvalue = '<b style="color:#990000">' . $inhalt[$i][$j] . '</b>'; else $showvalue = '<b style="color:#990000">[empty]</b>';
if (!in_array($inhalt[$i][$j], $allowed_object_other_title_kind_of)) $errormessage[] = 'Not allowed value in column <b>object_other_title_kind_of</b>: ' . $showvalue . ' (row ' . $i . ')'; if (!in_array($inhalt[$i][$j], $allowed_object_other_title_kind_of)) $errormessage[] = 'Not allowed value in column <b>object_other_title_kind_of</b>: ' . $showvalue . ' (row ' . $i . ')';
} }
if ($inhalt[1][$j]=='other_object_title_in' and !$inhalt[$i][array_search('other_object_title',$erstezeile)]=='') if ($inhalt[1][$j] == 'other_object_title_in' and !$inhalt[$i][array_search('other_object_title', $erstezeile)] == '') {
{
if ($inhalt[$i][$j] != '') $showvalue = '<b style="color:#990000">' . $inhalt[$i][$j] . '</b>'; else $showvalue = '<b style="color:#990000">[empty]</b>'; if ($inhalt[$i][$j] != '') $showvalue = '<b style="color:#990000">' . $inhalt[$i][$j] . '</b>'; else $showvalue = '<b style="color:#990000">[empty]</b>';
if (!in_array($inhalt[$i][$j], $allowed_other_object_title_in)) $errormessage[] = 'Not allowed value in column <b>other_object_title_in</b>: ' . $showvalue . ' (row ' . $i . ')'; if (!in_array($inhalt[$i][$j], $allowed_other_object_title_in)) $errormessage[] = 'Not allowed value in column <b>other_object_title_in</b>: ' . $showvalue . ' (row ' . $i . ')';
} }
if ($inhalt[1][$j]=='closer_location_as' and !$inhalt[$i][array_search('closer_location',$erstezeile)]=='') if ($inhalt[1][$j] == 'closer_location_as' and !$inhalt[$i][array_search('closer_location', $erstezeile)] == '') {
{
if ($inhalt[$i][$j] != '') $showvalue = '<b style="color:#990000">' . $inhalt[$i][$j] . '</b>'; else $showvalue = '<b style="color:#990000">[empty]</b>'; if ($inhalt[$i][$j] != '') $showvalue = '<b style="color:#990000">' . $inhalt[$i][$j] . '</b>'; else $showvalue = '<b style="color:#990000">[empty]</b>';
if (!in_array($inhalt[$i][$j], $allowed_closer_location_as)) $errormessage[] = 'Not allowed value in column <b>closer_location_as</b>: ' . $showvalue . ' (row ' . $i . ')'; if (!in_array($inhalt[$i][$j], $allowed_closer_location_as)) $errormessage[] = 'Not allowed value in column <b>closer_location_as</b>: ' . $showvalue . ' (row ' . $i . ')';
} }
if ($inhalt[1][$j]=='inclusion_kind_of') if ($inhalt[1][$j] == 'inclusion_kind_of') {
{
if ($inhalt[$i][$j] != '') $showvalue = '<b style="color:#990000">' . $inhalt[$i][$j] . '</b>'; else $showvalue = '<b style="color:#990000">[empty]</b>'; if ($inhalt[$i][$j] != '') $showvalue = '<b style="color:#990000">' . $inhalt[$i][$j] . '</b>'; else $showvalue = '<b style="color:#990000">[empty]</b>';
if (!in_array($inhalt[$i][$j], $allowed_inclusion_kind_of)) $errormessage[] = 'Not allowed value in column <b>inclusion_kind_of</b>: ' . $showvalue . ' (row ' . $i . ')'; if (!in_array($inhalt[$i][$j], $allowed_inclusion_kind_of)) $errormessage[] = 'Not allowed value in column <b>inclusion_kind_of</b>: ' . $showvalue . ' (row ' . $i . ')';
} }
if ($inhalt[1][$j]=='bought_for_currency' and !$inhalt[$i][array_search('bought_for',$erstezeile)]=='') if ($inhalt[1][$j] == 'bought_for_currency' and !$inhalt[$i][array_search('bought_for', $erstezeile)] == '') {
{
if ($inhalt[$i][$j] != '') $showvalue = '<b style="color:#990000">' . $inhalt[$i][$j] . '</b>'; else $showvalue = '<b style="color:#990000">[empty]</b>'; if ($inhalt[$i][$j] != '') $showvalue = '<b style="color:#990000">' . $inhalt[$i][$j] . '</b>'; else $showvalue = '<b style="color:#990000">[empty]</b>';
if (!in_array($inhalt[$i][$j], $allowed_currency)) $errormessage[] = 'Not allowed value in column <b>bought_for_currency</b>: ' . $showvalue . ' (row ' . $i . ')'; if (!in_array($inhalt[$i][$j], $allowed_currency)) $errormessage[] = 'Not allowed value in column <b>bought_for_currency</b>: ' . $showvalue . ' (row ' . $i . ')';
} }
if ($inhalt[1][$j]=='worth_unit' and !$inhalt[$i][array_search('worth_value',$erstezeile)]=='') if ($inhalt[1][$j] == 'worth_unit' and !$inhalt[$i][array_search('worth_value', $erstezeile)] == '') {
{
if ($inhalt[$i][$j] != '') $showvalue = '<b style="color:#990000">' . $inhalt[$i][$j] . '</b>'; else $showvalue = '<b style="color:#990000">[empty]</b>'; if ($inhalt[$i][$j] != '') $showvalue = '<b style="color:#990000">' . $inhalt[$i][$j] . '</b>'; else $showvalue = '<b style="color:#990000">[empty]</b>';
if (!in_array($inhalt[$i][$j], $allowed_currency)) $errormessage[] = 'Not allowed value in column <b>worth_unit</b>: ' . $showvalue . ' (row ' . $i . ')'; if (!in_array($inhalt[$i][$j], $allowed_currency)) $errormessage[] = 'Not allowed value in column <b>worth_unit</b>: ' . $showvalue . ' (row ' . $i . ')';
} }
if ($inhalt[1][$j]=='worth_insurance_unit' and !$inhalt[$i][array_search('worth_insurance_value',$erstezeile)]=='') if ($inhalt[1][$j] == 'worth_insurance_unit' and !$inhalt[$i][array_search('worth_insurance_value', $erstezeile)] == '') {
{
if ($inhalt[$i][$j] != '') $showvalue = '<b style="color:#990000">' . $inhalt[$i][$j] . '</b>'; else $showvalue = '<b style="color:#990000">[empty]</b>'; if ($inhalt[$i][$j] != '') $showvalue = '<b style="color:#990000">' . $inhalt[$i][$j] . '</b>'; else $showvalue = '<b style="color:#990000">[empty]</b>';
if (!in_array($inhalt[$i][$j], $allowed_currency)) $errormessage[] = 'Not allowed value in column <b>worth_insurance_unit</b>: ' . $showvalue . ' (row ' . $i . ')'; if (!in_array($inhalt[$i][$j], $allowed_currency)) $errormessage[] = 'Not allowed value in column <b>worth_insurance_unit</b>: ' . $showvalue . ' (row ' . $i . ')';
} }
if ($inhalt[1][$j]=='detailed_description_md' and !$inhalt[$i][array_search('detailed_description',$erstezeile)]=='') if ($inhalt[1][$j] == 'detailed_description_md' and !$inhalt[$i][array_search('detailed_description', $erstezeile)] == '') {
{
if ($inhalt[$i][$j] != '') $showvalue = '<b style="color:#990000">' . $inhalt[$i][$j] . '</b>'; else $showvalue = '<b style="color:#990000">[empty]</b>'; if ($inhalt[$i][$j] != '') $showvalue = '<b style="color:#990000">' . $inhalt[$i][$j] . '</b>'; else $showvalue = '<b style="color:#990000">[empty]</b>';
if (!in_array($inhalt[$i][$j], $allowed_yesno)) $errormessage[] = 'Not allowed value in column <b>detailed_description_md</b>: ' . $showvalue . ' (row ' . $i . ')'; if (!in_array($inhalt[$i][$j], $allowed_yesno)) $errormessage[] = 'Not allowed value in column <b>detailed_description_md</b>: ' . $showvalue . ' (row ' . $i . ')';
} }
if ($inhalt[1][$j]=='detailed_description_extern' and !$inhalt[$i][array_search('detailed_description',$erstezeile)]=='') if ($inhalt[1][$j] == 'detailed_description_extern' and !$inhalt[$i][array_search('detailed_description', $erstezeile)] == '') {
{
if ($inhalt[$i][$j] != '') $showvalue = '<b style="color:#990000">' . $inhalt[$i][$j] . '</b>'; else $showvalue = '<b style="color:#990000">[empty]</b>'; if ($inhalt[$i][$j] != '') $showvalue = '<b style="color:#990000">' . $inhalt[$i][$j] . '</b>'; else $showvalue = '<b style="color:#990000">[empty]</b>';
if (!in_array($inhalt[$i][$j], $allowed_yesno)) $errormessage[] = 'Not allowed value in column <b>detailed_description_extern</b>: ' . $showvalue . ' (row ' . $i . ')'; if (!in_array($inhalt[$i][$j], $allowed_yesno)) $errormessage[] = 'Not allowed value in column <b>detailed_description_extern</b>: ' . $showvalue . ' (row ' . $i . ')';
} }
if ($inhalt[1][$j]=='inscription_md' and !$inhalt[$i][array_search('inscription',$erstezeile)]=='') if ($inhalt[1][$j] == 'inscription_md' and !$inhalt[$i][array_search('inscription', $erstezeile)] == '') {
{
if ($inhalt[$i][$j] != '') $showvalue = '<b style="color:#990000">' . $inhalt[$i][$j] . '</b>'; else $showvalue = '<b style="color:#990000">[empty]</b>'; if ($inhalt[$i][$j] != '') $showvalue = '<b style="color:#990000">' . $inhalt[$i][$j] . '</b>'; else $showvalue = '<b style="color:#990000">[empty]</b>';
if (!in_array($inhalt[$i][$j], $allowed_yesno)) $errormessage[] = 'Not allowed value in column <b>inscription_md</b>: ' . $showvalue . ' (row ' . $i . ')'; if (!in_array($inhalt[$i][$j], $allowed_yesno)) $errormessage[] = 'Not allowed value in column <b>inscription_md</b>: ' . $showvalue . ' (row ' . $i . ')';
} }
if ($inhalt[1][$j]=='inscription_extern' and !$inhalt[$i][array_search('inscription',$erstezeile)]=='') if ($inhalt[1][$j] == 'inscription_extern' and !$inhalt[$i][array_search('inscription', $erstezeile)] == '') {
{
if ($inhalt[$i][$j] != '') $showvalue = '<b style="color:#990000">' . $inhalt[$i][$j] . '</b>'; else $showvalue = '<b style="color:#990000">[empty]</b>'; if ($inhalt[$i][$j] != '') $showvalue = '<b style="color:#990000">' . $inhalt[$i][$j] . '</b>'; else $showvalue = '<b style="color:#990000">[empty]</b>';
if (!in_array($inhalt[$i][$j], $allowed_yesno)) $errormessage[] = 'Not allowed value in column <b>inscription_extern</b>: ' . $showvalue . ' (row ' . $i . ')'; if (!in_array($inhalt[$i][$j], $allowed_yesno)) $errormessage[] = 'Not allowed value in column <b>inscription_extern</b>: ' . $showvalue . ' (row ' . $i . ')';
} }
if ($inhalt[1][$j]=='dimensions_separate_length_unit' and !$inhalt[$i][array_search('dimensions_separate_length_value',$erstezeile)]=='') if ($inhalt[1][$j] == 'dimensions_separate_length_unit' and !$inhalt[$i][array_search('dimensions_separate_length_value', $erstezeile)] == '') {
{
if ($inhalt[$i][$j] != '') $showvalue = '<b style="color:#990000">' . $inhalt[$i][$j] . '</b>'; else $showvalue = '<b style="color:#990000">[empty]</b>'; if ($inhalt[$i][$j] != '') $showvalue = '<b style="color:#990000">' . $inhalt[$i][$j] . '</b>'; else $showvalue = '<b style="color:#990000">[empty]</b>';
if (!in_array($inhalt[$i][$j], $allowed_measurements)) $errormessage[] = 'Not allowed value in column <b>dimensions_separate_length_unit</b>: ' . $showvalue . ' (row ' . $i . ')'; if (!in_array($inhalt[$i][$j], $allowed_measurements)) $errormessage[] = 'Not allowed value in column <b>dimensions_separate_length_unit</b>: ' . $showvalue . ' (row ' . $i . ')';
} }
if ($inhalt[1][$j]=='dimensions_separate_width_unit' and !$inhalt[$i][array_search('dimensions_separate_width_value',$erstezeile)]=='') if ($inhalt[1][$j] == 'dimensions_separate_width_unit' and !$inhalt[$i][array_search('dimensions_separate_width_value', $erstezeile)] == '') {
{
if ($inhalt[$i][$j] != '') $showvalue = '<b style="color:#990000">' . $inhalt[$i][$j] . '</b>'; else $showvalue = '<b style="color:#990000">[empty]</b>'; if ($inhalt[$i][$j] != '') $showvalue = '<b style="color:#990000">' . $inhalt[$i][$j] . '</b>'; else $showvalue = '<b style="color:#990000">[empty]</b>';
if (!in_array($inhalt[$i][$j], $allowed_measurements)) $errormessage[] = 'Not allowed value in column <b>dimensions_separate_width_unit</b>: ' . $showvalue . ' (row ' . $i . ')'; if (!in_array($inhalt[$i][$j], $allowed_measurements)) $errormessage[] = 'Not allowed value in column <b>dimensions_separate_width_unit</b>: ' . $showvalue . ' (row ' . $i . ')';
} }
if ($inhalt[1][$j]=='dimensions_separate_height_unit' and !$inhalt[$i][array_search('dimensions_separate_height_value',$erstezeile)]=='') if ($inhalt[1][$j] == 'dimensions_separate_height_unit' and !$inhalt[$i][array_search('dimensions_separate_height_value', $erstezeile)] == '') {
{
if ($inhalt[$i][$j] != '') $showvalue = '<b style="color:#990000">' . $inhalt[$i][$j] . '</b>'; else $showvalue = '<b style="color:#990000">[empty]</b>'; if ($inhalt[$i][$j] != '') $showvalue = '<b style="color:#990000">' . $inhalt[$i][$j] . '</b>'; else $showvalue = '<b style="color:#990000">[empty]</b>';
if (!in_array($inhalt[$i][$j], $allowed_measurements)) $errormessage[] = 'Not allowed value in column <b>dimensions_separate_height_unit</b>: ' . $showvalue . ' (row ' . $i . ')'; if (!in_array($inhalt[$i][$j], $allowed_measurements)) $errormessage[] = 'Not allowed value in column <b>dimensions_separate_height_unit</b>: ' . $showvalue . ' (row ' . $i . ')';
} }
if ($inhalt[1][$j]=='dimensions_separate_diameter_unit' and !$inhalt[$i][array_search('dimensions_separate_diameter_value',$erstezeile)]=='') if ($inhalt[1][$j] == 'dimensions_separate_diameter_unit' and !$inhalt[$i][array_search('dimensions_separate_diameter_value', $erstezeile)] == '') {
{
if ($inhalt[$i][$j] != '') $showvalue = '<b style="color:#990000">' . $inhalt[$i][$j] . '</b>'; else $showvalue = '<b style="color:#990000">[empty]</b>'; if ($inhalt[$i][$j] != '') $showvalue = '<b style="color:#990000">' . $inhalt[$i][$j] . '</b>'; else $showvalue = '<b style="color:#990000">[empty]</b>';
if (!in_array($inhalt[$i][$j], $allowed_measurements)) $errormessage[] = 'Not allowed value in column <b>dimensions_separate_diameter_unit</b>: ' . $showvalue . ' (row ' . $i . ')'; if (!in_array($inhalt[$i][$j], $allowed_measurements)) $errormessage[] = 'Not allowed value in column <b>dimensions_separate_diameter_unit</b>: ' . $showvalue . ' (row ' . $i . ')';
} }
if ($inhalt[1][$j]=='dimensions_separate_wall_thickness_unit' and !$inhalt[$i][array_search('dimensions_separate_wall_thickness_value',$erstezeile)]=='') if ($inhalt[1][$j] == 'dimensions_separate_wall_thickness_unit' and !$inhalt[$i][array_search('dimensions_separate_wall_thickness_value', $erstezeile)] == '') {
{
if ($inhalt[$i][$j] != '') $showvalue = '<b style="color:#990000">' . $inhalt[$i][$j] . '</b>'; else $showvalue = '<b style="color:#990000">[empty]</b>'; if ($inhalt[$i][$j] != '') $showvalue = '<b style="color:#990000">' . $inhalt[$i][$j] . '</b>'; else $showvalue = '<b style="color:#990000">[empty]</b>';
if (!in_array($inhalt[$i][$j], $allowed_measurements)) $errormessage[] = 'Not allowed value in column <b>dimensions_separate_wall_thickness_unit</b>: ' . $showvalue . ' (row ' . $i . ')'; if (!in_array($inhalt[$i][$j], $allowed_measurements)) $errormessage[] = 'Not allowed value in column <b>dimensions_separate_wall_thickness_unit</b>: ' . $showvalue . ' (row ' . $i . ')';
} }
if ($inhalt[1][$j]=='dimensions_separate_weight_unit' and !$inhalt[$i][array_search('dimensions_separate_weight_value',$erstezeile)]=='') if ($inhalt[1][$j] == 'dimensions_separate_weight_unit' and !$inhalt[$i][array_search('dimensions_separate_weight_value', $erstezeile)] == '') {
{
if ($inhalt[$i][$j] != '') $showvalue = '<b style="color:#990000">' . $inhalt[$i][$j] . '</b>'; else $showvalue = '<b style="color:#990000">[empty]</b>'; if ($inhalt[$i][$j] != '') $showvalue = '<b style="color:#990000">' . $inhalt[$i][$j] . '</b>'; else $showvalue = '<b style="color:#990000">[empty]</b>';
if (!in_array($inhalt[$i][$j], $allowed_weight)) $errormessage[] = 'Not allowed value in column <b>dimensions_separate_weight_unit</b>: ' . $showvalue . ' (row ' . $i . ')'; if (!in_array($inhalt[$i][$j], $allowed_weight)) $errormessage[] = 'Not allowed value in column <b>dimensions_separate_weight_unit</b>: ' . $showvalue . ' (row ' . $i . ')';
} }
if ($inhalt[1][$j]=='dimensions_separate_show_md') if ($inhalt[1][$j] == 'dimensions_separate_show_md') {
{
if ($inhalt[$i][$j] != '') $showvalue = '<b style="color:#990000">' . $inhalt[$i][$j] . '</b>'; else $showvalue = '<b style="color:#990000">[empty]</b>'; if ($inhalt[$i][$j] != '') $showvalue = '<b style="color:#990000">' . $inhalt[$i][$j] . '</b>'; else $showvalue = '<b style="color:#990000">[empty]</b>';
if (!in_array($inhalt[$i][$j], $allowed_yesno)) $errormessage[] = 'Not allowed value in column <b>dimensions_separate_show_md</b>: ' . $showvalue . ' (row ' . $i . ')'; if (!in_array($inhalt[$i][$j], $allowed_yesno)) $errormessage[] = 'Not allowed value in column <b>dimensions_separate_show_md</b>: ' . $showvalue . ' (row ' . $i . ')';
} }
if ($inhalt[1][$j]=='dimensions_separate_show_extern') if ($inhalt[1][$j] == 'dimensions_separate_show_extern') {
{
if ($inhalt[$i][$j] != '') $showvalue = '<b style="color:#990000">' . $inhalt[$i][$j] . '</b>'; else $showvalue = '<b style="color:#990000">[empty]</b>'; if ($inhalt[$i][$j] != '') $showvalue = '<b style="color:#990000">' . $inhalt[$i][$j] . '</b>'; else $showvalue = '<b style="color:#990000">[empty]</b>';
if (!in_array($inhalt[$i][$j], $allowed_yesno)) $errormessage[] = 'Not allowed value in column <b>dimensions_separate_show_extern</b>: ' . $showvalue . ' (row ' . $i . ')'; if (!in_array($inhalt[$i][$j], $allowed_yesno)) $errormessage[] = 'Not allowed value in column <b>dimensions_separate_show_extern</b>: ' . $showvalue . ' (row ' . $i . ')';
} }
for ($og = 1; $og < 6; $og++) for ($og = 1; $og < 6; $og++)
{ {
if ($inhalt[1][$j]=='object_group_show'.$og and !$inhalt[$i][array_search('object_group_name'.$og,$erstezeile)]=='') if ($inhalt[1][$j] == 'object_group_show' . $og and !$inhalt[$i][array_search('object_group_name' . $og, $erstezeile)] == '') {
{
if ($inhalt[$i][$j] != '') $showvalue = '<b style="color:#990000">' . $inhalt[$i][$j] . '</b>'; else $showvalue = '<b style="color:#990000">[empty]</b>'; if ($inhalt[$i][$j] != '') $showvalue = '<b style="color:#990000">' . $inhalt[$i][$j] . '</b>'; else $showvalue = '<b style="color:#990000">[empty]</b>';
if ($i > 1 and !in_array($inhalt[$i][$j], $allowed_yesno)) $errormessage[] = 'Not allowed value in column <b>object_group_show' . $og . '</b>: ' . $showvalue . ' (row ' . $i . ')'; if ($i > 1 and !in_array($inhalt[$i][$j], $allowed_yesno)) $errormessage[] = 'Not allowed value in column <b>object_group_show' . $og . '</b>: ' . $showvalue . ' (row ' . $i . ')';
} }
} }
for ($im = 1; $im < 29; $im++) for ($im = 1; $im < 29; $im++)
{ {
if ($inhalt[1][$j]=='image_visible'.$im and !$inhalt[$i][array_search('image_name'.$im,$erstezeile)]=='') if ($inhalt[1][$j] == 'image_visible' . $im and !$inhalt[$i][array_search('image_name' . $im, $erstezeile)] == '') {
{
if ($inhalt[$i][$j] != '') $showvalue = '<b style="color:#990000">' . $inhalt[$i][$j] . '</b>'; else $showvalue = '<b style="color:#990000">[empty]</b>'; if ($inhalt[$i][$j] != '') $showvalue = '<b style="color:#990000">' . $inhalt[$i][$j] . '</b>'; else $showvalue = '<b style="color:#990000">[empty]</b>';
if ($i > 1 and !in_array($inhalt[$i][$j], $allowed_yesno)) $errormessage[] = 'Not allowed value in column <b>image_visible' . $im . '</b>: ' . $showvalue . ' (row ' . $i . ')'; if ($i > 1 and !in_array($inhalt[$i][$j], $allowed_yesno)) $errormessage[] = 'Not allowed value in column <b>image_visible' . $im . '</b>: ' . $showvalue . ' (row ' . $i . ')';
} }
if ($inhalt[1][$j]=='image_main'.$im and !$inhalt[$i][array_search('image_name'.$im,$erstezeile)]=='') if ($inhalt[1][$j] == 'image_main' . $im and !$inhalt[$i][array_search('image_name' . $im, $erstezeile)] == '') {
{
if ($inhalt[$i][$j] != '') $showvalue = '<b style="color:#990000">' . $inhalt[$i][$j] . '</b>'; else $showvalue = '<b style="color:#990000">[empty]</b>'; if ($inhalt[$i][$j] != '') $showvalue = '<b style="color:#990000">' . $inhalt[$i][$j] . '</b>'; else $showvalue = '<b style="color:#990000">[empty]</b>';
if ($i > 1 and !in_array($inhalt[$i][$j], $allowed_yesno)) $errormessage[] = 'Not allowed value in column <b>image_main' . $im . '</b>: ' . $showvalue . ' (row ' . $i . ')'; if ($i > 1 and !in_array($inhalt[$i][$j], $allowed_yesno)) $errormessage[] = 'Not allowed value in column <b>image_main' . $im . '</b>: ' . $showvalue . ' (row ' . $i . ')';
} }
if ($inhalt[1][$j]=='image_rights'.$im and !$inhalt[$i][array_search('image_name'.$im,$erstezeile)]=='') if ($inhalt[1][$j] == 'image_rights' . $im and !$inhalt[$i][array_search('image_name' . $im, $erstezeile)] == '') {
{
if ($inhalt[$i][$j] != '') $showvalue = '<b style="color:#990000">' . $inhalt[$i][$j] . '</b>'; else $showvalue = '<b style="color:#990000">[empty]</b>'; if ($inhalt[$i][$j] != '') $showvalue = '<b style="color:#990000">' . $inhalt[$i][$j] . '</b>'; else $showvalue = '<b style="color:#990000">[empty]</b>';
if ($i > 1 and !in_array($inhalt[$i][$j], $allowed_image_rights)) $errormessage[] = 'Not allowed value in column <b>image_rights' . $im . '</b>: ' . $showvalue . ' (row ' . $i . ')'; if ($i > 1 and !in_array($inhalt[$i][$j], $allowed_image_rights)) $errormessage[] = 'Not allowed value in column <b>image_rights' . $im . '</b>: ' . $showvalue . ' (row ' . $i . ')';
} }
} }
for ($k = 0; $k < count($eventpartsure); $k++) for ($k = 0; $k < count($eventpartsure); $k++)
{ {
if ($inhalt[1][$j]==$eventpartsure[$k] and !$inhalt[$i][array_search($eventpart[$k],$erstezeile)]=='') if ($inhalt[1][$j] == $eventpartsure[$k] and !$inhalt[$i][array_search($eventpart[$k], $erstezeile)] == '') {
{
if ($inhalt[$i][$j] != '') $showvalue = '<b style="color:#990000">' . $inhalt[$i][$j] . '</b>'; else $showvalue = '<b style="color:#990000">[empty]</b>'; if ($inhalt[$i][$j] != '') $showvalue = '<b style="color:#990000">' . $inhalt[$i][$j] . '</b>'; else $showvalue = '<b style="color:#990000">[empty]</b>';
if ($i > 1 and !in_array($inhalt[$i][$j], $allowed_yesno)) $errormessage[] = 'Not allowed value in column <b>' . $eventpartsure[$k] . '</b>: ' . $showvalue . ' (row ' . $i . ')'; if ($i > 1 and !in_array($inhalt[$i][$j], $allowed_yesno)) $errormessage[] = 'Not allowed value in column <b>' . $eventpartsure[$k] . '</b>: ' . $showvalue . ' (row ' . $i . ')';
} }
@ -711,8 +587,7 @@ for ($i=1;$i<=$y;$i++)
} }
} }
if (isset($errormessage) and $errormessage!='') if (isset($errormessage) and $errormessage != '') {
{
echo '<b style="color:#990000;">Columns with controlled values contain invalid values !</b>'; echo '<b style="color:#990000;">Columns with controlled values contain invalid values !</b>';
for ($i = 0; $i < count ($errormessage); $i++) for ($i = 0; $i < count ($errormessage); $i++)
{ {
@ -731,18 +606,17 @@ echo '<br><br>8: Main image or main resource given?<br>';
$hasanyimage = 0; $hasanyimage = 0;
for ($im = 1; $im < 29; $im++) for ($im = 1; $im < 29; $im++)
{ {
if (array_search('image_name'.$im,$erstezeile)!='') {$imagemain[$im]['name']=array_search('image_name'.$im,$erstezeile);$hasanyimage++;} if (array_search('image_name' . $im, $erstezeile) != '') {$imagemain[$im]['name'] = array_search('image_name' . $im, $erstezeile);$hasanyimage++;
}
if (array_search('image_visible' . $im, $erstezeile) != '') $imagemain[$im]['visible'] = array_search('image_visible' . $im, $erstezeile); if (array_search('image_visible' . $im, $erstezeile) != '') $imagemain[$im]['visible'] = array_search('image_visible' . $im, $erstezeile);
if (array_search('image_main' . $im, $erstezeile) != '') $imagemain[$im]['main'] = array_search('image_main' . $im, $erstezeile); if (array_search('image_main' . $im, $erstezeile) != '') $imagemain[$im]['main'] = array_search('image_main' . $im, $erstezeile);
} }
if ($hasanyimage > 0) if ($hasanyimage > 0) {
{
$imagemain = array_values($imagemain); $imagemain = array_values($imagemain);
for ($i = 1; $i <= $y; $i++) for ($i = 1; $i <= $y; $i++)
{ {
if ($i>1) if ($i > 1) {
{
$maimg[$i] = 0; $maimg[$i] = 0;
//check if in a row any image_name is given //check if in a row any image_name is given
$hatimg[$i] = 0; $hatimg[$i] = 0;
@ -750,18 +624,16 @@ if ($hasanyimage > 0)
{ {
if ($inhalt[$i][$imagemain[$im]['name']] != '') $hatimg[$i]++; if ($inhalt[$i][$imagemain[$im]['name']] != '') $hatimg[$i]++;
} }
if ($hatimg[$i]>0) if ($hatimg[$i] > 0) {
{
// first check: how many main-images? // first check: how many main-images?
for ($im = 0; $im < count($imagemain); $im++) for ($im = 0; $im < count($imagemain); $im++)
{ {
if ($inhalt[$i][$imagemain[$im]['main']] == 'y') {$maimg[$i]++;$merk=$im;} if ($inhalt[$i][$imagemain[$im]['main']] == 'y') {$maimg[$i]++;$merk = $im;
}
} }
// if there is exacly one main-image, is it visible? // if there is exacly one main-image, is it visible?
if ($maimg[$i]==1) if ($maimg[$i] == 1) {
{ if ($inhalt[$i][$imagemain[$merk]['visible']] == 'n') {
if ($inhalt[$i][$imagemain[$merk]['visible']] =='n')
{
$errormessage[] = '<b style="font-weight:normal;color:#990000">Main image in row ' . $i . ' is not visible</b>'; $errormessage[] = '<b style="font-weight:normal;color:#990000">Main image in row ' . $i . ' is not visible</b>';
} }
} }
@ -771,8 +643,7 @@ if ($hasanyimage > 0)
if ($i > 1 and $maimg[$i] > 1 and $hatimg[$i] > 0) $errormessage[] = '<b style="font-weight:normal;color:#990000">There are ' . $maimg[$i] . ' main images given in row ' . $i . '</b>'; if ($i > 1 and $maimg[$i] > 1 and $hatimg[$i] > 0) $errormessage[] = '<b style="font-weight:normal;color:#990000">There are ' . $maimg[$i] . ' main images given in row ' . $i . '</b>';
} }
if (isset($errormessage) and $errormessage!='') if (isset($errormessage) and $errormessage != '') {
{
echo '<b style="color:#990000;">There is not one main image for each object !</b>'; echo '<b style="color:#990000;">There is not one main image for each object !</b>';
for ($i = 0; $i < count ($errormessage); $i++) for ($i = 0; $i < count ($errormessage); $i++)
{ {
@ -791,8 +662,7 @@ else
} }
echo '<hr>'; echo '<hr>';
if ($error+$depcon_error>0) if ($error + $depcon_error > 0) {
{
echo 'Error(s) found: ' . ($error + $depcon_error); echo 'Error(s) found: ' . ($error + $depcon_error);
} }
else else
@ -800,4 +670,3 @@ else
echo '<a href="index5.php?fnam=' . $_GET['fnam'] . '"><img src="img/go.gif"> Create XML for md:import (iso 8859-1)</a><br>'; echo '<a href="index5.php?fnam=' . $_GET['fnam'] . '"><img src="img/go.gif"> Create XML for md:import (iso 8859-1)</a><br>';
echo '<a href="index6.php?fnam=' . $_GET['fnam'] . '"><img src="img/go.gif"> Create XML for md:import (utf8)</a><br>'; echo '<a href="index6.php?fnam=' . $_GET['fnam'] . '"><img src="img/go.gif"> Create XML for md:import (utf8)</a><br>';
} }
?>

View File

@ -1,6 +1,6 @@
<?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;
@ -12,8 +12,7 @@ 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
@ -32,8 +31,7 @@ while ( $zeile = fgetcsv ( $fp, 100000, ';' ) )
$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>";
@ -43,4 +41,3 @@ while ( $zeile = fgetcsv ( $fp, 100000, ';' ) )
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

@ -4,7 +4,7 @@ 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;
@ -19,8 +19,7 @@ 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 ///////////////////////////////////
@ -40,8 +39,7 @@ while ( $zeile = fgetcsv ( $fp, 100000, ';' ) )
$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>";
@ -51,4 +49,3 @@ while ( $zeile = fgetcsv ( $fp, 100000, ';' ) )
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,7 +1,7 @@
<?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;
@ -14,8 +14,7 @@ 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 ///////////////////////////////////
@ -36,8 +35,7 @@ while ( $zeile = fgetcsv ( $fp, 100000, ';' ) )
$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>";
@ -46,4 +44,3 @@ while ( $zeile = fgetcsv ( $fp, 100000, ';' ) )
} }
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,6 +1,6 @@
<?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;
@ -11,8 +11,7 @@ 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
@ -25,8 +24,7 @@ while ( $zeile = fgetcsv ( $fp, 100000, ';' ) )
$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);
@ -34,4 +32,3 @@ while ( $zeile = fgetcsv ( $fp, 100000, ';' ) )
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,7 +3,7 @@
//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;
@ -14,8 +14,7 @@ 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 ///////////////////////////////////
@ -30,8 +29,7 @@ while ( $zeile = fgetcsv ( $fp, 100000, ';' ) )
$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);
@ -39,4 +37,3 @@ while ( $zeile = fgetcsv ( $fp, 100000, ';' ) )
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>';
?>

177
index.php
View File

@ -37,7 +37,7 @@ 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>';
@ -46,64 +46,122 @@ $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++;
}
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;'; echo '<span class="couponcode" style="display:inline-block;padding:3px;border:1px solid #666666;border-radius:2px;margin:2px;';
@ -130,4 +188,3 @@ for ($i=0;$i<count($allowed);$i++)
//print_r($allowed); //print_r($allowed);
echo '</div>'; echo '</div>';
echo '</div>'; echo '</div>';
?>

View File

@ -9,9 +9,8 @@ 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

@ -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

@ -11,9 +11,8 @@ 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

@ -9,9 +9,8 @@ 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

@ -9,7 +9,7 @@ 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

@ -10,22 +10,19 @@ $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 everything is ok we try to upload it
if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target)) if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target)) {
{
echo "The file <b>" . basename( $_FILES['uploaded']['name']) . "</b> has been uploaded<hr>"; echo "The file <b>" . basename( $_FILES['uploaded']['name']) . "</b> has been uploaded<hr>";
echo '<a href="index2.php?fnam=' . basename( $_FILES['uploaded']['name']) . '"><img src="img/go.gif"> Create XML (iso8859)</a><br>'; 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 '<a href="index4.php?fnam=' . basename( $_FILES['uploaded']['name']) . '"><img src="img/go.gif"> Create XML (utf-8)</a><br>';
@ -37,4 +34,3 @@ else
} }
} }
echo '</div>'; echo '</div>';
?>

View File

@ -692,4 +692,3 @@ array ('illustrated_annotation2', 'n', ''),
); );
?>

View File

@ -1,5 +1,5 @@
<?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/';
@ -49,9 +49,9 @@ function rrmdir($dir) {
reset($objects); reset($objects);
rmdir($dir); rmdir($dir);
} }
} }
$dir_name = 'xml'; $dir_name = 'xml';
rrmdir($dir_name); rrmdir($dir_name);
?>