diff --git a/csv_check.php b/csv_check.php index 97df1a2..ac767bf 100644 --- a/csv_check.php +++ b/csv_check.php @@ -54,17 +54,7 @@ foreach ($availableFields as $categoryName => $fieldCategory) { } -$allowed_object_other_title_kind_of = array('object_other_title_kind_of', 'Wissenschaft', 'Alltagssprache', 'Umgangssprache', 'Dialekt', 'Tudományos', 'Köznyelvi', 'Nyelvjárás'); -$allowed_other_object_title_in = array('other_object_title_in', 'Wissenschaft', 'Alltagssprache', 'Umgangssprache', 'Dialekt', 'Tudományos', 'Köznyelvi', 'Nyelvjárás'); -$allowed_closer_location_as = array('closer_location_as', 'Aufnahmeort', 'Fundort', 'Früherer Ort', 'Felvétel késztésének helye','Lelőhely', 'Történelmi elnevezés'); $allowed_inclusion_kind_of = array('inclusion_kind_of', 'Schenkung', 'Kauf', 'Grabung', 'Notbergung', 'Erbschaft', 'Stiftung', 'Enteignung', 'Ursprungsbestand', 'Ajándékozás','Vétel','Feltárás','Hivatalos átadás','Csere','Gyűjtés','Saját előállítás','Törzsanyag','Letét', 'endowment', 'dispossession', 'old stock', ''); -$allowed_currency = array('bought_for_currency', 'worth_unit', 'worth_insurance_unit', 'DM', 'Euro', 'Forint', 'Lari', 'Mark', 'Pengő', 'Real', 'RM', 'Rupiah', 'Złoty','US-Dollar'); -$allowed_measurements = array('dimensions_separate_length_unit', 'dimensions_separate_width_unit', 'dimensions_separate_height_unit', 'dimensions_separate_diameter_unit', 'dimensions_separate_wall_thickness_unit -', 'm', 'dm', 'cm', 'mm'); -$allowed_weight = array('dimensions_separate_weight_unit', 't', 'kg', 'g'); -$allowed_yesno = array('detailed_description_md', 'detailed_description_extern', 'inscription_md', 'inscription_extern', 'dimensions_separate_show_md', 'dimensions_separate_show_extern', 'object_group_show1', 'object_group_show2', 'object_group_show3', 'object_group_show4', 'object_group_show5', 'image_visible1', 'image_visible2', 'image_visible3', 'image_visible4', 'image_visible5', 'image_visible6', 'image_visible7', 'image_visible8', 'image_visible9', 'image_visible10', 'image_visible11', 'image_visible12', 'image_visible13', 'image_visible14', 'image_visible15', 'image_visible16', 'image_visible17', 'image_visible18', 'image_visible19', 'image_visible20', 'image_visible21', 'image_visible22', 'image_visible23', 'image_visible24', 'image_visible25', 'image_visible26', 'image_visible27', 'image_visible28', 'image_main1', 'image_main2', 'image_main3', 'image_main4', 'image_main5', 'image_main6', 'image_main7', 'image_main8', 'image_main9', 'image_main10', 'image_main11', 'image_main12', 'image_main13', 'image_main14', 'image_main15', 'image_main16', 'image_main17', 'image_main18', 'image_main19', 'image_main20', 'image_main21', 'image_main22', 'image_main23', 'image_main24', 'image_main25', 'image_main26', 'image_main27', 'image_main28','y', 'n'); -$crosscheck1 = array('object_other_title','detailed_description','detailed_description','inscription','inscription','dimensions_separate_length_value', 'dimensions_separate_width_value', 'dimensions_separate_height_value', 'dimensions_separate_diameter_value', 'dimensions_separate_wall_thickness_value', 'dimensions_separate_weight_value','closer_location','bought_for','worth_value','worth_insurance_value'); -$crosscheck2 = array('object_other_title_kind_of','detailed_description_md','detailed_description_extern','inscription_md','inscription_extern','dimensions_separate_length_unit', 'dimensions_separate_width_unit', 'dimensions_separate_height_unit', 'dimensions_separate_diameter_unit', 'dimensions_separate_wall_thickness_unit', 'dimensions_separate_weight_unit','closer_location_as','bought_for_currency','worth_unit','worth_insurance_unit'); ///// Check #1 //echo '
';print_r($allowed);echo ''; @@ -72,7 +62,7 @@ echo '1: Only allowed tags (column names) used?'; $fp = fopen ( $csv_datei, 'r' ); $y = 1; $error = 0; -$zeile = fgetcsv ( $fp, 100000, ';' ); +$zeile = fgetcsv( $fp, 100000, ';' ); for ($x = 0; $x < count($zeile); $x++) { $zeile[$x] = str_replace("\xEF\xBB\xBF", "", $zeile[$x]); @@ -212,24 +202,29 @@ else { ///// Check #6 echo '
{$columnName}
on row {$i}
: " . $value . " (allowed values: " . implode(", ", $fieldsWithAllowedValueSet[$columnName]) . ")";
}
@@ -298,8 +312,7 @@ for ($i = 2; $i <= $y; $i++) {
if (isset($errormessage) and $errormessage != '') {
echo 'Columns with controlled values contain invalid values !';
- for ($i = 0; $i < count ($errormessage); $i++)
- {
+ for ($i = 0; $i < count ($errormessage); $i++) {
echo '