commit f7140573e1f5873553c7ce8937e77dec3ede2704 Author: Stefan Rohde-Enslin Date: Sun Aug 25 21:45:52 2019 +0200 Initial. diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b7c032e --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/csv diff --git a/css/OpenSans-Light.ttf b/css/OpenSans-Light.ttf new file mode 100644 index 0000000..0d38189 Binary files /dev/null and b/css/OpenSans-Light.ttf differ diff --git a/css/OpenSans-Regular.ttf b/css/OpenSans-Regular.ttf new file mode 100644 index 0000000..db43334 Binary files /dev/null and b/css/OpenSans-Regular.ttf differ diff --git a/css/main.css b/css/main.css new file mode 100644 index 0000000..d47c13d --- /dev/null +++ b/css/main.css @@ -0,0 +1,43 @@ +@font-face { + font-family: opensans-regular; + src: url(./OpenSans-Regular.ttf); +} +body {margin:0px;padding:0px;background-color:#fefeff;font-family:opensans-regular;font-size:0.90em;} +div.title {height:50px;width:100%;text-align:center;background-color:9999cc;line-height:50px;font-size:1.2em;} +div.maincontent {padding:10px;line-height:21px;} +div.uploader {padding:10px 10px 12px 10px;line-height:21px;border:1px solid #666666;border-radius:3px;} +a {text-decoration:none;color:#000000;} + +.couponcode:hover .coupontooltip { + display: block; +} + +.coupontooltip { + display: none; + background: #cc6600; + border: 1px solid black; + border-radius:4px; + margin-left: -5px; + margin-top: 26px; + padding: 10px; + position: absolute; + z-index: 1000; + max-width:400px; + height:auto; + color: white; + font-size: 0.95em; +} + +.couponcode { + margin:100px; +} + + +p { + padding:0px 5px 0px 5px; + margin:0px; +} +p.hint {margin:5px 0px 5px 0px;} + +th {text-align:left;} +td {vertical-align:top;} \ No newline at end of file diff --git a/csv_check.php b/csv_check.php new file mode 100644 index 0000000..fa28983 --- /dev/null +++ b/csv_check.php @@ -0,0 +1,803 @@ +';print_r($allowed);echo ''; +echo '1: Only allowed tags (column names) used?'; +$fp = fopen ( $csv_datei, 'r' ); +$y = 1; +$error=0; +$zeile = fgetcsv ( $fp, 100000, ';' ); +for ( $x = 0; $x < count ( $zeile ); $x++ ) +{ + $zeile[$x] = str_replace("\xEF\xBB\xBF","",$zeile[$x]); + $inhalt[$y][$x] = $zeile[$x]; + if (!in_array($inhalt[1][$x], $allowed)) + { + echo '
ERROR in column '.$x.' created by value: '.$inhalt[1][$x].''; + $error=$error+1; + } + //echo '
';var_dump($inhalt[1][$x]); +} +fclose($fp); +$erstezeile = $zeile; +if ($error != 0) echo '
Not allowed tags found !'; else echo '
Only allowed tags used !'; + +//// Check #2 +echo '

2: Not allowed multiple use of tags (column names)?'; +$compare=array_unique($zeile); +function identical_values( $arrayA , $arrayB ) +{ + sort( $arrayA ); + sort( $arrayB ); + return $arrayA == $arrayB; +} + +$result = identical_values($zeile,$compare); +if ($result==false) +{ + echo '
There are dublicate column names !'; + $error=$error+1; +} +else +{ + echo '
No dublicate column names !'; +} + + +//// Get values into memory for following checks +$fp = fopen ( $csv_datei, 'r' ); +$y=0; +while ( $zeile = fgetcsv ( $fp, 100000, ';' ) ) +{ + $y++; + //echo '
';print_r($zeile); + for ( $x = 0; $x < count ( $zeile ); $x++ ) + { + $inhalt[$y][$x] = str_replace("'","\'",$zeile[$x]); + } +} +fclose($fp); + +///// Check #3 +echo '

3: Mandatory tags available and always filled in?'; +unset($inv_array); +$inv_error=0; +function get_duplicates( $array ) +{ + return array_unique( array_diff_assoc( $array, array_unique( $array ) ) ); +} +$mandatory=array('inventory_number','object_type','object_title','object_description'); +for ($i=0;$iMandatory: Column '.$mandatory[$i].' missing'; + $error=$error+1; + $inv_error=$inv_error+1; + } + else + { + $spaltenr=array_search($mandatory[$i],$erstezeile); + for ($j=0;$j<$y;$j++) + { + if ($inhalt[$j+1][$spaltenr]=='') + { + echo '
Missing value for '.$mandatory[$i].' in row '.($j+1).''; + $error=$error+1; + $inv_error=$inv_error+1; + } + if ($mandatory[$i]=='inventory_number') + { + $inv_array[]=$inhalt[$j+1][$spaltenr]; + } + } + } +} +if ($inv_error==0) echo '
All mandatory tags available and with values !'; + + +///// Check #4 +echo '

4: Inventory_number unique ?'; +if (in_array('inventory_number',$erstezeile)) +{ + $doppelte_inv=get_duplicates($inv_array); + $doppelte_inv = array_values($doppelte_inv); + if (count($doppelte_inv)>0) + { + for ($i=0;$iMultiple use of inventory_number '.$doppelte_inv[$i].''; + $error=$error+1; + } + } + else echo '
All inventory_numbers are unique !'; +} +else +{ + echo '
Aborted, column inventory_number is missing'; + $error=$error+1; +} + +///// Check #5 +echo '

5: Dependent colums observed ?
'; +if (array_search('object_other_title',$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'; + } +} +if (array_search('object_other_title_kind_of',$erstezeile)!==false) +{ + if (array_search('object_other_title',$erstezeile)===false) + { + $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_in',$erstezeile)===false) + { + $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',$erstezeile)===false) + { + $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_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'; + } +} +if (array_search('detailed_description_md',$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'; + } +} +if (array_search('detailed_description_extern',$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'; + } +} +// 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_md',$erstezeile)===false or array_search('inscription_extern',$erstezeile)===false) + { + $depencymessage[]='One column of inscription, inscription_md, inscription_extern is missing'; + } +} +if (array_search('inscription_md',$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'; + } +} +if (array_search('inscription_extern',$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'; + } +} + +// 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++) +{ + 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) + { + $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_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'; + } + } + 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) + { + $depencymessage[]='One column of object_group_name'.$og.', object_group_description'.$og.', object_group_show'.$og.' is missing'; + } + } +} + +// 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++) +{ + 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) + { + $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_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'; + } + } +} + +// 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_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'; + } +} +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) + { + $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',$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'; + } +} + +if (array_search('dimensions_separate_length_value',$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'; + } +} +if (array_search('dimensions_separate_length_unit',$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'; + } +} +if (array_search('dimensions_separate_width_value',$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'; + } +} +if (array_search('dimensions_separate_width_unit',$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'; + } +} +if (array_search('dimensions_separate_height_value',$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'; + } +} +if (array_search('dimensions_separate_height_unit',$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'; + } +} +if (array_search('dimensions_separate_diameter_value',$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'; + } +} +if (array_search('dimensions_separate_diameter_unit',$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'; + } +} +if (array_search('dimensions_separate_wall_thickness_value',$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'; + } +} +if (array_search('dimensions_separate_wall_thickness_unit',$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'; + } +} +if (array_search('dimensions_separate_weight_value',$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'; + } +} +if (array_search('dimensions_separate_weight_unit',$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'; + } +} +if (array_search('closer_location',$erstezeile)!==false) +{ + if (array_search('closer_location_as',$erstezeile)===false) + { + $depencymessage[]='One column of closer_location, closer_location_as is missing'; + } +} +if (array_search('closer_location_as',$erstezeile)!==false) +{ + if (array_search('closer_location',$erstezeile)===false) + { + $depencymessage[]='One column of closer_location, closer_location_as is missing'; + } +} +if (array_search('bought_for',$erstezeile)!==false) +{ + if (array_search('bought_for_currency',$erstezeile)===false) + { + $depencymessage[]='One column of bought_for, bought_for_currency is missing'; + } +} +if (array_search('bought_for_currency',$erstezeile)!==false) +{ + if (array_search('bought_for',$erstezeile)===false) + { + $depencymessage[]='One column of bought_for, bought_for_currency is missing'; + } +} +if (array_search('worth_value',$erstezeile)!==false) +{ + if (array_search('worth_unit',$erstezeile)===false) + { + $depencymessage[]='One column of worth_value, worth_unit is missing'; + } +} +if (array_search('worth_unit',$erstezeile)!==false) +{ + if (array_search('worth_value',$erstezeile)===false) + { + $depencymessage[]='One column of worth_value, worth_unit is missing'; + } +} +if (array_search('worth_insurance_value',$erstezeile)!==false) +{ + if (array_search('worth_insurance_unit',$erstezeile)===false) + { + $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_value',$erstezeile)===false) + { + $depencymessage[]='One column of worth_insurance_value, worth_insurance_unit is missing'; + } +} +if (array_search('link_url1',$erstezeile)!==false) +{ + if (array_search('link_show1',$erstezeile)===false) + { + $depencymessage[]='One column of link_url1, link_show1 is missing'; + } +} +if (array_search('link_show1',$erstezeile)!==false) +{ + if (array_search('link_url1',$erstezeile)===false) + { + $depencymessage[]='One column of link_url1, link_show1 is missing'; + } +} +if (array_search('link_url2',$erstezeile)!==false) +{ + if (array_search('link_show2',$erstezeile)===false) + { + $depencymessage[]='One column of link_url2, link_show2 is missing'; + } +} +if (array_search('link_show2',$erstezeile)!==false) +{ + if (array_search('link_url2',$erstezeile)===false) + { + $depencymessage[]='One column of link_url2, link_show2 is missing'; + } +} + +for ($i=0;$iDependent columns were not observed !'; + for ($i=0;$i'.$depencymessage[$i]; + $error=$error+1; + } +} +else +{ + echo 'Dependent columns were observed !'; +} + +///// Check #6 +echo '

6: Dependency of content observed?'; +$depcon_error=0; +for ($l=0;$lTag '.$crosscheck2[$l].' given but no entry for '.$crosscheck1[$l].' (row '.$j.')'; + $depcon_error=$depcon_error+1; + } + } + } +} +for ($l=0;$lTag '.$eventpartsure[$l].' given but no entry for '.$eventpart[$l].' (row '.$j.')'; + $depcon_error=$depcon_error+1; + } + } + } +} +if (in_array('dimensions_separate_show_md',$erstezeile)) +{ + 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)]=='') + { + echo '
Tag dimensions_separate_show_md given but no separate values available (row '.$j.')'; + $depcon_error=$depcon_error+1; + } + } +} +if (in_array('dimensions_separate_show_extern',$erstezeile)) +{ + 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)]=='') + { + echo '
Tag dimensions_separate_show_extern given but no separate values available (row '.$j.')'; + $depcon_error=$depcon_error+1; + } + } +} +/* +for ($im=1;$im<11;$im++) +{ + if (in_array('image_name'.$im,$erstezeile)) + { + for ($j=1;$j<($y+1);$j++) + { + if ($inhalt[$j][array_search('image_rights'.$im,$erstezeile)]!=='') + { + echo '
TAG image_name'.$im.' given but no value available for image_rights'.$im.' (row '.$j.')'; + $depcon_error=$depcon_error+1; + } + if ($inhalt[$j][array_search('image_visible'.$im,$erstezeile)]!=='') + { + echo '
TAG image_name'.$im.' given but no value available for image_visible'.$im.' (row '.$j.')'; + $depcon_error=$depcon_error+1; + } + } + } +} +*/ +if ($depcon_error==0) echo '
Dependency of content was observed !'; + +///// Check #7 +echo '

7: Not allowed values in controlled lists?
'; +for ($i=1;$i<=$y;$i++) +{ + for ($j=0;$j'; else $showvalue='[empty]'; + if (!in_array($inhalt[$i][$j],$allowed_object_other_title_kind_of)) $errormessage[]='Not allowed value in column object_other_title_kind_of: '.$showvalue.' (row '.$i.')'; + } + if ($inhalt[1][$j]=='other_object_title_in' and !$inhalt[$i][array_search('other_object_title',$erstezeile)]=='') + { + if ($inhalt[$i][$j]!='') $showvalue=''.$inhalt[$i][$j].''; else $showvalue='[empty]'; + if (!in_array($inhalt[$i][$j],$allowed_other_object_title_in)) $errormessage[]='Not allowed value in column other_object_title_in: '.$showvalue.' (row '.$i.')'; + } + if ($inhalt[1][$j]=='closer_location_as' and !$inhalt[$i][array_search('closer_location',$erstezeile)]=='') + { + if ($inhalt[$i][$j]!='') $showvalue=''.$inhalt[$i][$j].''; else $showvalue='[empty]'; + if (!in_array($inhalt[$i][$j],$allowed_closer_location_as)) $errormessage[]='Not allowed value in column closer_location_as: '.$showvalue.' (row '.$i.')'; + } + if ($inhalt[1][$j]=='inclusion_kind_of') + { + if ($inhalt[$i][$j]!='') $showvalue=''.$inhalt[$i][$j].''; else $showvalue='[empty]'; + if (!in_array($inhalt[$i][$j],$allowed_inclusion_kind_of)) $errormessage[]='Not allowed value in column inclusion_kind_of: '.$showvalue.' (row '.$i.')'; + } + if ($inhalt[1][$j]=='bought_for_currency' and !$inhalt[$i][array_search('bought_for',$erstezeile)]=='') + { + if ($inhalt[$i][$j]!='') $showvalue=''.$inhalt[$i][$j].''; else $showvalue='[empty]'; + if (!in_array($inhalt[$i][$j],$allowed_currency)) $errormessage[]='Not allowed value in column bought_for_currency: '.$showvalue.' (row '.$i.')'; + } + if ($inhalt[1][$j]=='worth_unit' and !$inhalt[$i][array_search('worth_value',$erstezeile)]=='') + { + if ($inhalt[$i][$j]!='') $showvalue=''.$inhalt[$i][$j].''; else $showvalue='[empty]'; + if (!in_array($inhalt[$i][$j],$allowed_currency)) $errormessage[]='Not allowed value in column worth_unit: '.$showvalue.' (row '.$i.')'; + } + if ($inhalt[1][$j]=='worth_insurance_unit' and !$inhalt[$i][array_search('worth_insurance_value',$erstezeile)]=='') + { + if ($inhalt[$i][$j]!='') $showvalue=''.$inhalt[$i][$j].''; else $showvalue='[empty]'; + if (!in_array($inhalt[$i][$j],$allowed_currency)) $errormessage[]='Not allowed value in column worth_insurance_unit: '.$showvalue.' (row '.$i.')'; + } + if ($inhalt[1][$j]=='detailed_description_md' and !$inhalt[$i][array_search('detailed_description',$erstezeile)]=='') + { + if ($inhalt[$i][$j]!='') $showvalue=''.$inhalt[$i][$j].''; else $showvalue='[empty]'; + if (!in_array($inhalt[$i][$j],$allowed_yesno)) $errormessage[]='Not allowed value in column detailed_description_md: '.$showvalue.' (row '.$i.')'; + } + if ($inhalt[1][$j]=='detailed_description_extern' and !$inhalt[$i][array_search('detailed_description',$erstezeile)]=='') + { + if ($inhalt[$i][$j]!='') $showvalue=''.$inhalt[$i][$j].''; else $showvalue='[empty]'; + if (!in_array($inhalt[$i][$j],$allowed_yesno)) $errormessage[]='Not allowed value in column detailed_description_extern: '.$showvalue.' (row '.$i.')'; + } + if ($inhalt[1][$j]=='inscription_md' and !$inhalt[$i][array_search('inscription',$erstezeile)]=='') + { + if ($inhalt[$i][$j]!='') $showvalue=''.$inhalt[$i][$j].''; else $showvalue='[empty]'; + if (!in_array($inhalt[$i][$j],$allowed_yesno)) $errormessage[]='Not allowed value in column inscription_md: '.$showvalue.' (row '.$i.')'; + } + if ($inhalt[1][$j]=='inscription_extern' and !$inhalt[$i][array_search('inscription',$erstezeile)]=='') + { + if ($inhalt[$i][$j]!='') $showvalue=''.$inhalt[$i][$j].''; else $showvalue='[empty]'; + if (!in_array($inhalt[$i][$j],$allowed_yesno)) $errormessage[]='Not allowed value in column inscription_extern: '.$showvalue.' (row '.$i.')'; + } + if ($inhalt[1][$j]=='dimensions_separate_length_unit' and !$inhalt[$i][array_search('dimensions_separate_length_value',$erstezeile)]=='') + { + if ($inhalt[$i][$j]!='') $showvalue=''.$inhalt[$i][$j].''; else $showvalue='[empty]'; + if (!in_array($inhalt[$i][$j],$allowed_measurements)) $errormessage[]='Not allowed value in column dimensions_separate_length_unit: '.$showvalue.' (row '.$i.')'; + } + if ($inhalt[1][$j]=='dimensions_separate_width_unit' and !$inhalt[$i][array_search('dimensions_separate_width_value',$erstezeile)]=='') + { + if ($inhalt[$i][$j]!='') $showvalue=''.$inhalt[$i][$j].''; else $showvalue='[empty]'; + if (!in_array($inhalt[$i][$j],$allowed_measurements)) $errormessage[]='Not allowed value in column dimensions_separate_width_unit: '.$showvalue.' (row '.$i.')'; + } + if ($inhalt[1][$j]=='dimensions_separate_height_unit' and !$inhalt[$i][array_search('dimensions_separate_height_value',$erstezeile)]=='') + { + if ($inhalt[$i][$j]!='') $showvalue=''.$inhalt[$i][$j].''; else $showvalue='[empty]'; + if (!in_array($inhalt[$i][$j],$allowed_measurements)) $errormessage[]='Not allowed value in column dimensions_separate_height_unit: '.$showvalue.' (row '.$i.')'; + } + if ($inhalt[1][$j]=='dimensions_separate_diameter_unit' and !$inhalt[$i][array_search('dimensions_separate_diameter_value',$erstezeile)]=='') + { + if ($inhalt[$i][$j]!='') $showvalue=''.$inhalt[$i][$j].''; else $showvalue='[empty]'; + if (!in_array($inhalt[$i][$j],$allowed_measurements)) $errormessage[]='Not allowed value in column dimensions_separate_diameter_unit: '.$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[$i][$j]!='') $showvalue=''.$inhalt[$i][$j].''; else $showvalue='[empty]'; + if (!in_array($inhalt[$i][$j],$allowed_measurements)) $errormessage[]='Not allowed value in column dimensions_separate_wall_thickness_unit: '.$showvalue.' (row '.$i.')'; + } + if ($inhalt[1][$j]=='dimensions_separate_weight_unit' and !$inhalt[$i][array_search('dimensions_separate_weight_value',$erstezeile)]=='') + { + if ($inhalt[$i][$j]!='') $showvalue=''.$inhalt[$i][$j].''; else $showvalue='[empty]'; + if (!in_array($inhalt[$i][$j],$allowed_weight)) $errormessage[]='Not allowed value in column dimensions_separate_weight_unit: '.$showvalue.' (row '.$i.')'; + } + if ($inhalt[1][$j]=='dimensions_separate_show_md') + { + if ($inhalt[$i][$j]!='') $showvalue=''.$inhalt[$i][$j].''; else $showvalue='[empty]'; + if (!in_array($inhalt[$i][$j],$allowed_yesno)) $errormessage[]='Not allowed value in column dimensions_separate_show_md: '.$showvalue.' (row '.$i.')'; + } + if ($inhalt[1][$j]=='dimensions_separate_show_extern') + { + if ($inhalt[$i][$j]!='') $showvalue=''.$inhalt[$i][$j].''; else $showvalue='[empty]'; + if (!in_array($inhalt[$i][$j],$allowed_yesno)) $errormessage[]='Not allowed value in column dimensions_separate_show_extern: '.$showvalue.' (row '.$i.')'; + } + 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[$i][$j]!='') $showvalue=''.$inhalt[$i][$j].''; else $showvalue='[empty]'; + if ($i>1 and !in_array($inhalt[$i][$j],$allowed_yesno)) $errormessage[]='Not allowed value in column object_group_show'.$og.': '.$showvalue.' (row '.$i.')'; + } + } + for ($im=1;$im<29;$im++) + { + if ($inhalt[1][$j]=='image_visible'.$im and !$inhalt[$i][array_search('image_name'.$im,$erstezeile)]=='') + { + if ($inhalt[$i][$j]!='') $showvalue=''.$inhalt[$i][$j].''; else $showvalue='[empty]'; + if ($i>1 and !in_array($inhalt[$i][$j],$allowed_yesno)) $errormessage[]='Not allowed value in column image_visible'.$im.': '.$showvalue.' (row '.$i.')'; + } + if ($inhalt[1][$j]=='image_main'.$im and !$inhalt[$i][array_search('image_name'.$im,$erstezeile)]=='') + { + if ($inhalt[$i][$j]!='') $showvalue=''.$inhalt[$i][$j].''; else $showvalue='[empty]'; + if ($i>1 and !in_array($inhalt[$i][$j],$allowed_yesno)) $errormessage[]='Not allowed value in column image_main'.$im.': '.$showvalue.' (row '.$i.')'; + } + if ($inhalt[1][$j]=='image_rights'.$im and !$inhalt[$i][array_search('image_name'.$im,$erstezeile)]=='') + { + if ($inhalt[$i][$j]!='') $showvalue=''.$inhalt[$i][$j].''; else $showvalue='[empty]'; + if ($i>1 and !in_array($inhalt[$i][$j],$allowed_image_rights)) $errormessage[]='Not allowed value in column image_rights'.$im.': '.$showvalue.' (row '.$i.')'; + } + } + for ($k=0;$k'; else $showvalue='[empty]'; + if ($i>1 and !in_array($inhalt[$i][$j],$allowed_yesno)) $errormessage[]='Not allowed value in column '.$eventpartsure[$k].': '.$showvalue.' (row '.$i.')'; + } + } + } +} + +if (isset($errormessage) and $errormessage!='') +{ + echo 'Columns with controlled values contain invalid values !'; + for ($i=0;$i'.$errormessage[$i]; + $error=$error+1; + } +} +else +{ + echo 'Values in controlled fields are all valid !'; +} + +///// Check #8 +unset($errormessage); +echo '

8: Main image or main resource given?
'; +$hasanyimage=0; +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_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 ($hasanyimage > 0) +{ + $imagemain=array_values($imagemain); + for ($i=1;$i<=$y;$i++) + { + if ($i>1) + { + $maimg[$i]=0; + //check if in a row any image_name is given + $hatimg[$i]=0; + for ($im=0;$im0) + { + // first check: how many main-images? + for ($im=0;$im'; + } + } + } + } + if ($i>1 and $maimg[$i]==0 and $hatimg[$i]>0) $errormessage[]='There is no visible main image given in row '.$i.''; + if ($i>1 and $maimg[$i]>1 and $hatimg[$i]>0) $errormessage[]='There are '.$maimg[$i].' main images given in row '.$i.''; + } + + if (isset($errormessage) and $errormessage!='') + { + echo 'There is not one main image for each object !'; + for ($i=0;$i'.$errormessage[$i]; + $error=$error+1; + } + } + else + { + echo 'For each object that has images attached exactly one main image is given !'; + } +} +else +{ + echo 'No images to be imported !'; +} + +echo '
'; +if ($error+$depcon_error>0) +{ + echo 'Error(s) found: '.($error+$depcon_error); +} +else +{ + echo ' Create XML for md:import (iso 8859-1)
'; + echo ' Create XML for md:import (utf8)
'; +} +?> \ No newline at end of file diff --git a/csv_laden.php b/csv_laden.php new file mode 100644 index 0000000..38585ee --- /dev/null +++ b/csv_laden.php @@ -0,0 +1,46 @@ +Zeile='.$y.' Anzahl in Zeile: '.count ( $zeile ).'
'; + $zieldatei = 'xml/'.$y.'.xml'; + if (!$handle = fopen($zieldatei, 'w')) + { + echo "Cannot open file ($zieldatei)";exit; + } + $somecontent=''."\n"; // normal + $somecontent=$somecontent.''."\n"; + + for ( $x = 0; $x < count ( $zeile ); $x++ ) + { + $inhalt[$y][$x]=$zeile[$x]; + //echo ''.$inhalt[1][$x].' --> '.$zeile[$x].'
'; + if ($inhalt[$y][$x]=='') $inhalt[$y][$x]='ERSATZ'; + //$somecontent=$somecontent.'<'.tagify(transform($inhalt[1][$x])).'>'.utf8_decode(transform($inhalt[$y][$x])).''."\n"; // für utf8 + //$somecontent=$somecontent.'<'.tagify(transform($inhalt[1][$x])).'>'.(($inhalt[$y][$x])).''."\n"; //für ungarn sonst weg ////////////////////////////////////////////////////////////// + + $somecontent=$somecontent.'<'.tagify(transform($inhalt[1][$x])).'>'.transform($inhalt[$y][$x]).''."\n"; //normaleinstellung + } + $somecontent=$somecontent.'
'; +//if ($y>1) +//{ + if (fwrite($handle, $somecontent) === FALSE) + { + echo "Cannot write to file ($filename)";exit; + } +// echo "Success, wrote to file ($filename)

"; +//} + fclose($handle); +} +fclose($fp); +echo ($y-1).' files created'; +echo '
Download as zip'; +?> diff --git a/csv_laden_hu.php b/csv_laden_hu.php new file mode 100644 index 0000000..856fa6f --- /dev/null +++ b/csv_laden_hu.php @@ -0,0 +1,54 @@ +'; // für ungarn sonst weg ////////////////////// +include ('inc/zeichen.php'); +$filename=$_GET['fnam']; +$csv_datei = 'csv/'.$filename; + +if (!file_exists("xml")) { + mkdir("xml", 0700); +} + +$fp = fopen ( $csv_datei, 'r' ); +$y = 0; +while ( $zeile = fgetcsv ( $fp, 100000, ';' ) ) +{ + $y++; + //echo 'Zeile='.$y.' Anzahl in Zeile: '.count ( $zeile ).'
'; + $zieldatei = 'xml/'.$y.'.xml'; + if (!$handle = fopen($zieldatei, 'w')) + { + echo "Cannot open file ($zieldatei)";exit; + } + $somecontent=''."\n"; // für Ungarn /////////////////////////////////// + /*$somecontent=''."\n"; // normal */ + $somecontent=$somecontent.''."\n"; + + for ( $x = 0; $x < count ( $zeile ); $x++ ) + { + $inhalt[$y][$x]=$zeile[$x]; + //echo ''.$inhalt[1][$x].' --> '.$zeile[$x].'
'; + if ($inhalt[$y][$x]=='') $inhalt[$y][$x]='ERSATZ'; + //$somecontent=$somecontent.'<'.tagify(transform($inhalt[1][$x])).'>'.utf8_decode(transform($inhalt[$y][$x])).''."\n"; // für utf8 + $somecontent=$somecontent.'<'.tagify(transform($inhalt[1][$x])).'>'.(($inhalt[$y][$x])).''."\n"; //für ungarn sonst weg ////////////////////////////////////////////////////////////// + + //$somecontent=$somecontent.'<'.tagify(transform($inhalt[1][$x])).'>'.transform($inhalt[$y][$x]).''."\n"; //normaleinstellung + } + $somecontent=$somecontent.'
'; +//if ($y>1) +//{ + if (fwrite($handle, $somecontent) === FALSE) + { + echo "Cannot write to file ($filename)";exit; + } +// echo "Success, wrote to file ($filename)

"; +//} + fclose($handle); +} +fclose($fp); +echo ($y-1).' files created'; +echo '
Download as zip'; +?> diff --git a/csv_laden_hu_alt.php b/csv_laden_hu_alt.php new file mode 100644 index 0000000..6875d56 --- /dev/null +++ b/csv_laden_hu_alt.php @@ -0,0 +1,49 @@ +'; // für ungarn sonst weg ////////////////////// +include ('inc/zeichen.php'); +$filename=$_GET['fnam']; +$csv_datei = 'csv/'.$filename; + +mkdir("xml",0777); +$fp = fopen ( $csv_datei, 'r' ); +$y = 0; +while ( $zeile = fgetcsv ( $fp, 100000, ';' ) ) +//while ( $zeile = fgetcsv ( $fp, 100000, ',' ) ) +{ + $y++; + //echo 'Zeile='.$y.' Anzahl in Zeile: '.count ( $zeile ).'
'; + $zieldatei = 'xml/'.$y.'.xml'; + if (!$handle = fopen($zieldatei, 'w')) + { + echo "Cannot open file ($zieldatei)";exit; + } + $somecontent=''."\n"; // für Ungarn /////////////////////////////////// + /*$somecontent=''."\n"; // normal */ + $somecontent=$somecontent.''."\n"; + + for ( $x = 0; $x < count ( $zeile ); $x++ ) + { + $inhalt[$y][$x]=$zeile[$x]; + //echo ''.$inhalt[1][$x].' --> '.$zeile[$x].'
'; + if ($inhalt[$y][$x]=='') $inhalt[$y][$x]='ERSATZ'; + //$somecontent=$somecontent.'<'.tagify(transform($inhalt[1][$x])).'>'.utf8_decode(transform($inhalt[$y][$x])).''."\n"; // für utf8 + $somecontent=$somecontent.'<'.tagify(transform($inhalt[1][$x])).'>'.(($inhalt[$y][$x])).''."\n"; //für ungarn sonst weg ////////////////////////////////////////////////////////////// + + //$somecontent=$somecontent.'<'.tagify(transform($inhalt[1][$x])).'>'.transform($inhalt[$y][$x]).''."\n"; //normaleinstellung + } + echo $y.'
'; + $somecontent=$somecontent.'
'; +//if ($y>1) +//{ + if (fwrite($handle, $somecontent) === FALSE) + { + echo "Cannot write to file ($filename)";exit; + } +// echo "Success, wrote to file ($filename)

"; +//} + fclose($handle); +} +fclose($fp); +echo 'download as zip'; +?> diff --git a/csv_laden_iso.php b/csv_laden_iso.php new file mode 100644 index 0000000..48520b5 --- /dev/null +++ b/csv_laden_iso.php @@ -0,0 +1,37 @@ +'."\n"; // normal + $somecontent=$somecontent.''."\n"; + + for ( $x = 0; $x < count ( $zeile ); $x++ ) + { + $inhalt[$y][$x]=$zeile[$x]; + //if ($inhalt[$y][$x]=='') $inhalt[$y][$x]='ERSATZ'; + $somecontent=$somecontent.'<'.tagify(transform($inhalt[1][$x])).'>'.transform($inhalt[$y][$x]).''."\n"; //normaleinstellung + } + $somecontent=$somecontent.''; + if (fwrite($handle, $somecontent) === FALSE) + { + echo "Cannot write to file ($filename)";exit; + } + fclose($handle); +} +fclose($fp); +echo ($y-1).' files created'; +echo '
Download as zip'; +?> diff --git a/csv_laden_utf.php b/csv_laden_utf.php new file mode 100644 index 0000000..9048b46 --- /dev/null +++ b/csv_laden_utf.php @@ -0,0 +1,42 @@ +'; // für ungarn sonst weg ////////////////////// +include ('inc/zeichen.php'); +$filename=$_GET['fnam']; +$csv_datei = 'csv/'.$filename; + +mkdir("xml",0777); +$fp = fopen ( $csv_datei, 'r' ); +$y = 0; +while ( $zeile = fgetcsv ( $fp, 100000, ';' ) ) +{ + $y++; + $zieldatei = 'xml/'.$y.'.xml'; + if (!$handle = fopen($zieldatei, 'w')) + { + echo "Cannot open file ($zieldatei)";exit; + } + $somecontent=''."\n"; // für Ungarn /////////////////////////////////// + $somecontent=$somecontent.''."\n"; + + for ( $x = 0; $x < count ( $zeile ); $x++ ) + { + $inhalt[$y][$x]=$zeile[$x]; + $inhalt[$y][$x] = preg_replace('/[\x00-\x1F\x7F]/u', '', $inhalt[$y][$x]); + $inhalt[$y][$x] = str_replace('>',']',str_replace('<','[',$inhalt[$y][$x])); + //if ($y!=1) $inhalt[$y][$x] = ''; + $somecontent=$somecontent.'<'.tagify(transform($inhalt[1][$x])).'>'.(($inhalt[$y][$x])).''."\n"; //für ungarn sonst weg } + } + $somecontent=$somecontent.''; + if (fwrite($handle, $somecontent) === FALSE) + { + echo "Cannot write to file ($filename)";exit; + } + fclose($handle); +} +fclose($fp); +echo ($y-1).' files created'; +echo '
Download as zip'; +?> diff --git a/img/go.gif b/img/go.gif new file mode 100644 index 0000000..4843356 Binary files /dev/null and b/img/go.gif differ diff --git a/inc/zeichen.php b/inc/zeichen.php new file mode 100644 index 0000000..4418f0e --- /dev/null +++ b/inc/zeichen.php @@ -0,0 +1,41 @@ +',' ',$transform); + $transform=str_replace('
',' ',$transform); + $transform=str_replace('’','\'',$transform); + $transform=str_replace(chr(11),' ',$transform); + + $transform=str_replace('<','<',$transform); + $transform=str_replace('>','>',$transform); + $transform=str_replace('´',''',$transform); + $transform=str_replace('&sbquo','\'',$transform); + $transform=str_replace('&lsquo','\'',$transform); + $transform=str_replace(chr(96),'\'',$transform); + $transform=str_replace(chr(130),'\'',$transform); + $transform=str_replace(chr(145),'\'',$transform); + $transform=str_replace(chr(146),'\'',$transform); + return $transform; +} + +function tagify($tagify) +{ + $tagify=str_replace(' ','_',$tagify); + $tagify=str_replace('/','_',$tagify); + $tagify=str_replace(',','_',$tagify); + $tagify=str_replace('__','_',$tagify); + $tagify=str_replace('Ä','ae',$tagify); + $tagify=str_replace('ä','ae',$tagify); + $tagify=str_replace('Ö','oe',$tagify); + $tagify=str_replace('ö','oe',$tagify); + $tagify=str_replace('Ãœ','ue',$tagify); + $tagify=str_replace('ü','ue',$tagify); + $tagify=str_replace('ß','ss',$tagify); + $tagify=str_replace(chr(41),'',$tagify); + $tagify=str_replace(chr(40),'',$tagify); + return $tagify; +} diff --git a/inc/zip.php b/inc/zip.php new file mode 100644 index 0000000..fe2d500 --- /dev/null +++ b/inc/zip.php @@ -0,0 +1,441 @@ +zipFile = tmpfile(); + } else { + $this->zipData = ""; + } + } + + function __destruct() { + if (!is_null($this->zipFile)) { + fclose($this->zipFile); + } + $this->zipData= null; + } + + /** + * Set Zip archive comment. + * + * @param string $newComment New comment. null to clear. + */ + public function setComment($newComment = null) { + $this->zipComment = $newComment; + } + + /** + * Set zip file to write zip data to. + * This will cause all present and future data written to this class to be written to this file. + * This can be used at any time, even after the Zip Archive have been finalized. Any previous file will be closed. + * Warning: If the given file already exists, it will be overwritten. + * + * @param string $fileName + */ + public function setZipFile($fileName) { + if (file_exists($fileName)) { + unlink ($fileName); + } + $fd=fopen($fileName, "x+b"); + if (!is_null($this->zipFile)) { + rewind($this->zipFile); + while(!feof($this->zipFile)) { + fwrite($fd, fread($this->zipFile, $this->streamChunkSize)); + } + + fclose($this->zipFile); + } else { + fwrite($fd, $this->zipData); + $this->zipData = null; + } + $this->zipFile = $fd; + } + + /** + * Add an empty directory entry to the zip archive. + * Basically this is only used if an empty directory is added. + * + * @param string $directoryPath Directory Path and name to be added to the archive. + * @param int $timestamp (Optional) Timestamp for the added directory, if omitted or set to 0, the current time will be used. + * @param string $fileComment (Optional) Comment to be added to the archive for this directory. To use fileComment, timestamp must be given. + */ + public function addDirectory($directoryPath, $timestamp = 0, $fileComment = null) { + if ($this->isFinalized) { + return; + } + $this->buildZipEntry($directoryPath, $fileComment, "\x00\x00", "\x00\x00", $timestamp, "\x00\x00\x00\x00", 0, 0, 16); + } + + /** + * Add a file to the archive at the specified location and file name. + * + * @param string $data File data. + * @param string $filePath Filepath and name to be used in the archive. + * @param int $timestamp (Optional) Timestamp for the added file, if omitted or set to 0, the current time will be used. + * @param string $fileComment (Optional) Comment to be added to the archive for this file. To use fileComment, timestamp must be given. + */ + public function addFile($data, $filePath, $timestamp = 0, $fileComment = null) { + if ($this->isFinalized) { + return; + } + + $gzType = "\x08\x00"; // Compression type 8 = deflate + $gpFlags = "\x02\x00"; // General Purpose bit flags for compression type 8 it is: 0=Normal, 1=Maximum, 2=Fast, 3=super fast compression. + $dataLength = strlen($data); + $fileCRC32 = pack("V", crc32($data)); + + $gzData = gzcompress($data); + $gzData = substr( substr($gzData, 0, strlen($gzData) - 4), 2); // gzcompress adds a 2 byte header and 4 byte CRC we can't use. + // The 2 byte header does contain useful data, though in this case the 2 parameters we'd be interrested in will always be 8 for compression type, and 2 for General purpose flag. + $gzLength = strlen($gzData); + + if ($gzLength >= $dataLength) { + $gzLength = $dataLength; + $gzData = $data; + $gzType = "\x00\x00"; // Compression type 0 = stored + $gpFlags = "\x00\x00"; // Compression type 0 = stored + } + + if (is_null($this->zipFile) && ($this->offset + $gzLength) > $this->zipMemoryThreshold) { + $this->zipFile = tmpfile(); + fwrite($this->zipFile, $this->zipData); + $this->zipData = null; + } + + $this->buildZipEntry($filePath, $fileComment, $gpFlags, $gzType, $timestamp, $fileCRC32, $gzLength, $dataLength, 32); + if (is_null($this->zipFile)) { + $this->zipData .= $gzData; + } else { + fwrite($this->zipFile, $gzData); + } + } + + /** + * Add a file to the archive at the specified location and file name. + * + * @param string $dataFile File name/path. + * @param string $filePath Filepath and name to be used in the archive. + * @param int $timestamp (Optional) Timestamp for the added file, if omitted or set to 0, the current time will be used. + * @param string $fileComment (Optional) Comment to be added to the archive for this file. To use fileComment, timestamp must be given. + */ + public function addLargeFile($dataFile, $filePath, $timestamp = 0, $fileComment = null) { + if ($this->isFinalized) { + return; + } + + $this->openStream($filePath, $timestamp, $fileComment); + + $fh = fopen($dataFile, "rb"); + while(!feof($fh)) { + $this->addStreamData(fread($fh, $this->streamChunkSize)); + } + fclose($fh); + + $this->closeStream(); + } + + /** + * Create a stream to be used for large entries. + * + * @param string $filePath Filepath and name to be used in the archive. + * @param int $timestamp (Optional) Timestamp for the added file, if omitted or set to 0, the current time will be used. + * @param string $fileComment (Optional) Comment to be added to the archive for this file. To use fileComment, timestamp must be given. + */ + public function openStream($filePath, $timestamp = 0, $fileComment = null) { + if ($this->isFinalized) { + return; + } + + if (is_null($this->zipFile)) { + $this->zipFile = tmpfile(); + fwrite($this->zipFile, $this->zipData); + $this->zipData = null; + } + + if (strlen($this->streamFilePath) > 0) { + closeStream(); + } + $this->streamFile = tempnam(sys_get_temp_dir(), 'Zip'); + $this->streamData = gzopen($this->streamFile, "w9"); + $this->streamFilePath = $filePath; + $this->streamTimestamp = $timestamp; + $this->streamFileComment = $fileComment; + $this->streamFileLength = 0; + } + + public function addStreamData($data) { + $length = gzwrite($this->streamData, $data, strlen($data)); + if ($length != strlen($data)) { + print "

Length mismatch

\n"; + } + $this->streamFileLength += $length; + return $length; + } + + /** + * Close the current stream. + */ + public function closeStream() { + if ($this->isFinalized || strlen($this->streamFilePath) == 0) { + return; + } + + fflush($this->streamData); + gzclose($this->streamData); + + $gzType = "\x08\x00"; // Compression type 8 = deflate + $gpFlags = "\x02\x00"; // General Purpose bit flags for compression type 8 it is: 0=Normal, 1=Maximum, 2=Fast, 3=super fast compression. + + $file_handle = fopen($this->streamFile, "rb"); + $stats = fstat($file_handle); + $eof = $stats['size']; + + fseek($file_handle, $eof-8); + $fileCRC32 = fread($file_handle, 4); + $dataLength = $this->streamFileLength;//$gzl[1]; + + $gzLength = $eof-10; + $eof -= 9; + + fseek($file_handle, 10); + + $this->buildZipEntry($this->streamFilePath, $this->streamFileComment, $gpFlags, $gzType, $this->streamTimestamp, $fileCRC32, $gzLength, $dataLength, 32); + while(!feof($file_handle)) { + fwrite($this->zipFile, fread($file_handle, $this->streamChunkSize)); + } + + unlink($this->streamFile); + $this->streamFile = null; + $this->streamData = null; + $this->streamFilePath = null; + $this->streamTimestamp = null; + $this->streamFileComment = null; + $this->streamFileLength = 0; + } + + /** + * Close the archive. + * A closed archive can no longer have new files added to it. + */ + public function finalize() { + if(!$this->isFinalized) { + if (strlen($this->streamFilePath) > 0) { + $this->closeStream(); + } + $cd = implode("", $this->cdRec); + + $cdRec = $cd . $this->endOfCentralDirectory + . pack("v", sizeof($this->cdRec)) + . pack("v", sizeof($this->cdRec)) + . pack("V", strlen($cd)) + . pack("V", $this->offset); + if (!is_null($this->zipComment)) { + $cdRec .= pack("v", strlen($this->zipComment)) . $this->zipComment; + } else { + $cdRec .= "\x00\x00"; + } + + if (is_null($this->zipFile)) { + $this->zipData .= $cdRec; + } else { + fwrite($this->zipFile, $cdRec); + fflush($this->zipFile); + } + $this->isFinalized = true; + $cd = null; + $this->cdRec = null; + } + } + + /** + * Get the handle ressource for the archive zip file. + * If the zip haven't been finalized yet, this will cause it to become finalized + * + * @return zip file handle + */ + public function getZipFile() { + if(!$this->isFinalized) { + $this->finalize(); + } + if (is_null($this->zipFile)) { + $this->zipFile = tmpfile(); + fwrite($this->zipFile, $this->zipData); + $this->zipData = null; + } + rewind($this->zipFile); + return $this->zipFile; + } + + /** + * Get the zip file contents + * If the zip haven't been finalized yet, this will cause it to become finalized + * + * @return zip data + */ + public function getZipData() { + if(!$this->isFinalized) { + $this->finalize(); + } + if (is_null($this->zipFile)) { + return $this->zipData; + } else { + rewind($this->zipFile); + $filestat = fstat($this->zipFile); + return fread($this->zipFile, $filestat['size']); + } + } + + /** + * Send the archive as a zip download + * + * @param String $fileName The name of the Zip archive, ie. "archive.zip". + * @return void + */ + function sendZip($fileName) { + if(!$this->isFinalized) { + $this->finalize(); + } + + if (!headers_sent($headerFile, $headerLine) or die("

Error: Unable to send file $fileName. HTML Headers have already been sent from $headerFile in line $headerLine

")) { + if (ob_get_contents() === false or die("\n

Error: Unable to send file $fileName.epub. Output buffer contains the following text (typically warnings or errors):
" . ob_get_contents() . "

")) { + if (ini_get('zlib.output_compression')) { + ini_set('zlib.output_compression', 'Off'); + } + + header('Pragma: public'); + header("Last-Modified: " . gmdate("D, d M Y H:i:s T")); + header("Expires: 0"); + header("Accept-Ranges: bytes"); + header("Connection: close"); + header("Content-Type: application/zip"); + header('Content-Disposition: attachment; filename="' . $fileName . '";' ); + header("Content-Transfer-Encoding: binary"); + header("Content-Length: ". $this->getArchiveSize()); + + if (is_null($this->zipFile)) { + echo $this->zipData; + } else { + rewind($this->zipFile); + + while(!feof($this->zipFile)) { + echo fread($this->zipFile, $this->streamChunkSize); + } + } + } + } + } + + public function getArchiveSize() { + if (is_null($this->zipFile)) { + return strlen($this->zipData); + } + $filestat = fstat($this->zipFile); + return $filestat['size']; + } + + /** + * Calculate the 2 byte dostime used in the zip entries. + * + * @param int $timestamp + * @return 2-byte encoded DOS Date + */ + private function getDosTime($timestamp = 0) { + $timestamp = (int)$timestamp; + $date = ($timestamp == 0 ? getdate() : getDate($timestamp)); + if ($date["year"] >= 1980) { + return pack("V", (($date["mday"] + ($date["mon"] << 5) + (($date["year"]-1980) << 9)) << 16) | + (($date["seconds"] >> 1) + ($date["minutes"] << 5) + ($date["hours"] << 11))); + } + return "\x00\x00\x00\x00"; + } + + /** + * Build the Zip file structures + * + * @param unknown_type $filePath + * @param unknown_type $fileComment + * @param unknown_type $gpFlags + * @param unknown_type $gzType + * @param unknown_type $timestamp + * @param unknown_type $fileCRC32 + * @param unknown_type $gzLength + * @param unknown_type $dataLength + * @param integer $extFileAttr 16 for directories, 32 for files. + */ + private function buildZipEntry($filePath, $fileComment, $gpFlags, $gzType, $timestamp, $fileCRC32, $gzLength, $dataLength, $extFileAttr) { + $filePath = str_replace("\\", "/", $filePath); + $fileCommentLength = (is_null($fileComment) ? 0 : strlen($fileComment)); + $dosTime = $this->getDosTime($timestamp); + + $zipEntry = $this->localFileHeader; + $zipEntry .= "\x14\x00"; // Version needed to extract + $zipEntry .= $gpFlags . $gzType . $dosTime. $fileCRC32; + $zipEntry .= pack("VV", $gzLength, $dataLength); + $zipEntry .= pack("v", strlen($filePath) ); // File name length + $zipEntry .= "\x00\x00"; // Extra field length + $zipEntry .= $filePath; // FileName . Extra field + + if (is_null($this->zipFile)) { + $this->zipData .= $zipEntry; + } else { + fwrite($this->zipFile, $zipEntry); + } + + $cdEntry = $this->centralFileHeader; + $cdEntry .= "\x00\x00"; // Made By Version + $cdEntry .= "\x14\x00"; // Version Needed to extract + $cdEntry .= $gpFlags . $gzType . $dosTime. $fileCRC32; + $cdEntry .= pack("VV", $gzLength, $dataLength); + $cdEntry .= pack("v", strlen($filePath)); // Filename length + $cdEntry .= "\x00\x00"; // Extra field length + $cdEntry .= pack("v", $fileCommentLength); // File comment length + $cdEntry .= "\x00\x00"; // Disk number start + $cdEntry .= "\x00\x00"; // internal file attributes + $cdEntry .= pack("V", $extFileAttr ); // External file attributes + $cdEntry .= pack("V", $this->offset ); // Relative offset of local header + $cdEntry .= $filePath; // FileName . Extra field + if (!is_null($fileComment)) { + $cdEntry .= $fileComment; // Comment + } + + $this->cdRec[] = $cdEntry; + $this->offset += strlen($zipEntry) + $gzLength; + } +} +?> \ No newline at end of file diff --git a/index.php b/index.php new file mode 100644 index 0000000..f8ab7d4 --- /dev/null +++ b/index.php @@ -0,0 +1,133 @@ + + + + +'; +echo ''; +echo '
'; +echo 'museum-digital CSV to XML converter'; +echo '
'; +echo '
'; +echo '
'; +echo '
'; +echo 'Please choose a csv-file to create xml-files: '; +echo ''; +echo '
'; +echo '
'; +echo '
'; +include('values/all_fields.php'); +echo '

Currently approved tags (column names) for md:import:

'; +//echo ''; +//echo ''; +$categories=array('basic','other object title','detailed description','inscription','material_technique separate','separate dimensions','comparable objects','closer location','categorisation', 'object administration', 'object history', 'worth', 'state', 'location', 'rights (object)', 'remarks', 'links', 'literature', 'object_group', 'tags', 'events: related place', 'events: related actor', 'events: related time', 'images', 'resources', 'events: production', 'events: finding', 'events: publication', 'events: template creation', 'events: depiction_who', 'events: depiction_place', 'events: use', 'events: writing', 'events: colleting', 'events: painting', 'events: taking', 'events: receiving', 'events: printing plate production', 'events: sending', 'events: issuing', 'events: signing', 'events: type description', 'events:drawing', 'events: copying', 'events: has lived', 'events: commissioned', 'events: printed', 'events: spoken', 'events: sung', 'events: decor designed', 'events: form designed', 'events: modelled', 'events: signed', 'events: mentioning', 'events: burying', 'events: intellectual creation', 'events: painting on', 'events: illustrated' ); +$cat_counter=0; +for ($i=0;$i'; + if ($i==0) {echo '
'.$categories[$cat_counter].'
';$cat_counter++;} + if ($i==10) {echo '

'.$categories[$cat_counter].'
';$cat_counter++;} + if ($i==12) {echo '

'.$categories[$cat_counter].'
';$cat_counter++;} + if ($i==15) {echo '

'.$categories[$cat_counter].'
';$cat_counter++;} + if ($i==18) {echo '

'.$categories[$cat_counter].'
';$cat_counter++;} + if ($i==20) {echo '

'.$categories[$cat_counter].'
';$cat_counter++;} + if ($i==36) {echo '

'.$categories[$cat_counter].'
';$cat_counter++;} + if ($i==39) {echo '

'.$categories[$cat_counter].'
';$cat_counter++;} + if ($i==41) {echo '

'.$categories[$cat_counter].'
';$cat_counter++;} + if ($i==47) {echo '

'.$categories[$cat_counter].'
';$cat_counter++;} + if ($i==53) {echo '

'.$categories[$cat_counter].'
';$cat_counter++;} + if ($i==57) {echo '

'.$categories[$cat_counter].'
';$cat_counter++;} + if ($i==65) {echo '

'.$categories[$cat_counter].'
';$cat_counter++;} + if ($i==67) {echo '

'.$categories[$cat_counter].'
';$cat_counter++;} + if ($i==75) {echo '

'.$categories[$cat_counter].'
';$cat_counter++;} + if ($i==78) {echo '

'.$categories[$cat_counter].'
';$cat_counter++;} + if ($i==82) {echo '

'.$categories[$cat_counter].'
';$cat_counter++;} + if ($i==86) {echo '

'.$categories[$cat_counter].'
';$cat_counter++;} + if ($i==108) {echo '

'.$categories[$cat_counter].'
';$cat_counter++;} + if ($i==123) {echo '

'.$categories[$cat_counter].'
';$cat_counter++;} + if ($i==133) {echo '

'.$categories[$cat_counter].'
';$cat_counter++;} + if ($i==137) {echo '

'.$categories[$cat_counter].'
';$cat_counter++;} + if ($i==141) {echo '

'.$categories[$cat_counter].'
';$cat_counter++;} + if ($i==145) {echo '

'.$categories[$cat_counter].'
';$cat_counter++;} + if ($i==215) {echo '

'.$categories[$cat_counter].'
';$cat_counter++;} + if ($i==233) {echo '

'.$categories[$cat_counter].'
';$cat_counter++;} + if ($i==247) {echo '

'.$categories[$cat_counter].'
';$cat_counter++;} + if ($i==261) {echo '

'.$categories[$cat_counter].'
';$cat_counter++;} + if ($i==275) {echo '

'.$categories[$cat_counter].'
';$cat_counter++;} + if ($i==289) {echo '

'.$categories[$cat_counter].'
';$cat_counter++;} + if ($i==293) {echo '

'.$categories[$cat_counter].'
';$cat_counter++;} /**/ + if ($i==297) {echo '

'.$categories[$cat_counter].'
';$cat_counter++;} + if ($i==311) {echo '

'.$categories[$cat_counter].'
';$cat_counter++;} + if ($i==325) {echo '

'.$categories[$cat_counter].'
';$cat_counter++;} + if ($i==339) {echo '

'.$categories[$cat_counter].'
';$cat_counter++;} + if ($i==353) {echo '

'.$categories[$cat_counter].'
';$cat_counter++;} + if ($i==367) {echo '

'.$categories[$cat_counter].'
';$cat_counter++;} + if ($i==381) {echo '

'.$categories[$cat_counter].'
';$cat_counter++;} + if ($i==395) {echo '

'.$categories[$cat_counter].'
';$cat_counter++;} + if ($i==409) {echo '

'.$categories[$cat_counter].'
';$cat_counter++;} + if ($i==423) {echo '

'.$categories[$cat_counter].'
';$cat_counter++;} + if ($i==437) {echo '

'.$categories[$cat_counter].'
';$cat_counter++;} + if ($i==451) {echo '

'.$categories[$cat_counter].'
';$cat_counter++;} + if ($i==465) {echo '

'.$categories[$cat_counter].'
';$cat_counter++;} + if ($i==479) {echo '

'.$categories[$cat_counter].'
';$cat_counter++;} + if ($i==489) {echo '

'.$categories[$cat_counter].'
';$cat_counter++;} + if ($i==503) {echo '

'.$categories[$cat_counter].'
';$cat_counter++;} + if ($i==517) {echo '

'.$categories[$cat_counter].'
';$cat_counter++;} + if ($i==531) {echo '

'.$categories[$cat_counter].'
';$cat_counter++;} + if ($i==545) {echo '

'.$categories[$cat_counter].'
';$cat_counter++;} + if ($i==559) {echo '

'.$categories[$cat_counter].'
';$cat_counter++;} + if ($i==573) {echo '

'.$categories[$cat_counter].'
';$cat_counter++;} + if ($i==587) {echo '

'.$categories[$cat_counter].'
';$cat_counter++;} + if ($i==601) {echo '

'.$categories[$cat_counter].'
';$cat_counter++;} + if ($i==615) {echo '

'.$categories[$cat_counter].'
';$cat_counter++;} + if ($i==629) {echo '

'.$categories[$cat_counter].'
';$cat_counter++;} + if ($i==643) {echo '

'.$categories[$cat_counter].'
';$cat_counter++;} + if ($i==657) {echo '

'.$categories[$cat_counter].'
';$cat_counter++;} +/* + */ + echo ''; + echo ''; + echo '

'.$allowed[$i][0].'


'; + if (isset($allowed[$i][1])) echo '

Mandatory: '.$allowed[$i][1]."

"; + if (isset($allowed[$i][5])) echo '

'.$allowed[$i][5].'

'; + if (isset($allowed[$i][2])) echo '

Format: '.$allowed[$i][2]."

"; + if (isset($allowed[$i][3])) echo '

Allowed values: '.$allowed[$i][3]."

"; + if (isset($allowed[$i][4])) echo '

Dependencies: '.$allowed[$i][4]."

"; + echo '
'; + echo ''.$allowed[$i][0].''; + echo '
'; +// echo '
'; +// echo ''; +// echo ''; +// echo ''; + //echo ''; +} +//echo '
NameMandatoryAllowedRemarksDependencies'.$allowed[$i][1].''.$allowed[$i][2].''.$allowed[$i][3].''.$allowed[$i][4].'
'; +//print_r($allowed); +echo '
'; +echo '
'; +?> diff --git a/index2.php b/index2.php new file mode 100644 index 0000000..5cdc1b0 --- /dev/null +++ b/index2.php @@ -0,0 +1,17 @@ +'; +echo '
'; +echo 'museum-digital CSV to XML converter'; +echo '
'; +echo '
'; +echo ''; +echo ''; + echo ''; +echo ''; +echo '
'; + echo 'Please wait ... (transforming)
'; + include('csv_laden_iso.php'); + echo '
'; +echo '
'; +?> diff --git a/index3.php b/index3.php new file mode 100644 index 0000000..94ca361 --- /dev/null +++ b/index3.php @@ -0,0 +1,22 @@ +'; +echo '
'; +echo 'museum-digital CSV to XML converter'; +echo '
'; +echo '
'; +$semikoma=$_GET['semikoma']; +echo ''; +echo ''; + echo ''; + echo ''; +echo ''; +echo '
'; + echo 'Please wait ... (checking validity)'; + echo ''; + echo '
'; + echo ''; +echo '
'; +echo '
'; + include('csv_check.php'); +echo '
'; +?> diff --git a/index4.php b/index4.php new file mode 100644 index 0000000..af78ab8 --- /dev/null +++ b/index4.php @@ -0,0 +1,19 @@ +'; +echo '
'; +echo 'museum-digital CSV to XML converter'; +echo '
'; +echo '
'; +echo ''; +echo ''; + echo ''; +echo ''; +echo '
'; + echo 'Please wait ... (transforming)
'; + include('csv_laden_utf.php'); + echo '
'; +echo '
'; +?> diff --git a/index5.php b/index5.php new file mode 100644 index 0000000..a862626 --- /dev/null +++ b/index5.php @@ -0,0 +1,17 @@ +'; +echo '
'; +echo 'museum-digital CSV to XML converter'; +echo '
'; +echo '
'; +$semikoma=$_GET['semikoma']; +echo ''; +echo ''; + echo ''; +echo ''; +echo '
'; + echo 'Please wait ... (transforming)
'; + include('csv_laden.php'); + echo '
'; +echo '
'; +?> diff --git a/index6.php b/index6.php new file mode 100644 index 0000000..823b933 --- /dev/null +++ b/index6.php @@ -0,0 +1,16 @@ +'; +echo '
'; +echo 'museum-digital CSV to XML converter'; +echo '
'; +echo '
'; +$semikoma=$_GET['semikoma']; +echo ''; +echo ''; +echo ''; +echo ''; +echo '
'; +echo 'Please wait ... (transforming)
'; +include('csv_laden_hu.php'); +echo '
'; +echo '
'; \ No newline at end of file diff --git a/upload.php b/upload.php new file mode 100644 index 0000000..e6411c8 --- /dev/null +++ b/upload.php @@ -0,0 +1,40 @@ +'; +echo '
'; +echo 'museum-digital CSV to XML converter'; +echo '
'; +echo '
'; +$target = "csv/"; +$target = $target . basename( $_FILES['uploaded']['name']) ; +$targetpart = basename( $_FILES['uploaded']['name']); +$ok=1; +$semikoma=$_POST['deli']; +//This is our size condition +if ($uploaded_size > 40000000) +{ + echo "Your file is too large.
"; + $ok=0; +} + +//Here we check that $ok was not set to 0 by an error +if ($ok==0) +{ + echo "Sorry your file was not uploaded"; +} +else +{ + //If everything is ok we try to upload it + if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target)) + { + echo "The file ". basename( $_FILES['uploaded']['name']). " has been uploaded
"; + echo ' Create XML (iso8859)
'; + echo ' Create XML (utf-8)
'; + echo ' Check validity for museum-digital import'; + } + else + { + echo "Sorry, there was a problem uploading your file."; + } +} +echo '
'; +?> \ No newline at end of file diff --git a/values/_siko.php b/values/_siko.php new file mode 100644 index 0000000..c28d2e3 --- /dev/null +++ b/values/_siko.php @@ -0,0 +1 @@ +$expected_format=array('inventory_number', 'institution_name', 'collection_name1', 'collection_name2', 'object_type', 'object_title', 'object_description', 'object_material_technique', 'object_dimensions', 'object_publication', 'object_other_title', 'object_other_title_kind_of', 'detailed_description', 'detailed_description_md', 'detailed_description_extern', 'inscription', 'inscription_md', 'inscription_extern', 'dimensions_separate_length_value', 'dimensions_separate_length_unit', 'dimensions_separate_width_value', 'dimensions_separate_width_unit', 'dimensions_separate_height_value', 'dimensions_separate_height_unit', 'dimensions_separate_weight_value', 'dimensions_separate_weight_unit', 'dimensions_separate_diameter_value', 'dimensions_separate_diameter_unit', 'dimensions_separate_wall_thickness_value', 'dimensions_separate_wall_thickness_unit', 'dimensions_separate_show_md', 'dimensions_separate_show_extern', 'number_of_pieces', 'number_of_pages', 'comparable_objects_other_museums', 'comparable_objects_other_museums_show_md', 'comparable_objects_other_museums_show_md', 'other_object_title', 'other_object_title_in', 'closer_location', 'closer_location_as', 'entry_number', 'other_inventory_number', 'subject_group', 'systematic', 'bundle', 'part_of', 'inclusion_when', 'inclusion_kind_of', 'bought_for', 'bought_for_currency', 'inclusion_who', 'inclusion_where', 'registration_first_who', 'registration_first_when', 'owner_previous', 'object_history', 'worth_determiner', 'worth_when', 'worth_value', 'worth_unit', 'worth_incurance_determiner', 'worth_incurance_when', 'worth_insurance_value', 'worth_insurance_unit', 'state', 'restauration', 'abode_actual', 'abode_regular', 'exhibition', 'on_loan_to', 'on_loan_contact', 'on_loan_when', 'on_loan_insurance_value', 'on_loan_annotation', 'copyright', 'rights_of_use', 'rights_annotation', 'remarks_short', 'remarks_long', 'images_in_museum', 'documents_in_museum', 'link_url1', 'link_show1', 'link_url2', 'link_show2', 'literature_author1', 'literature_year1', 'literature_title1', 'literature_place1', 'literature_abbreviation1', 'literature_gnd1', 'literature_isbn1', 'literature_signature1', 'literature_online1', 'literature_annotation1', 'literature_author2', 'literature_year2', 'literature_title2', 'literature_place2', 'literature_abbreviation2', 'literature_gnd2', 'literature_isbn2', 'literature_signature2', 'literature_online2', 'literature_annotation2', 'object_group_name1', 'object_group_description1', 'object_group_show1', 'object_group_name2', 'object_group_description2', 'object_group_show2', 'object_group_name3', 'object_group_description3', 'object_group_show3', 'object_group_name4', 'object_group_description4', 'object_group_show4', 'object_group_name5', 'object_group_description5', 'object_group_show5', 'tag1', 'tag2', 'tag3', 'tag4', 'tag5', 'tag6', 'tag7', 'tag8', 'tag9', 'tag10', 'image_name1', 'image_description1', 'image_owner1', 'image_creator1', 'image_rights1', 'image_visible1', 'image_name2', 'image_description2', 'image_owner2', 'image_creator2', 'image_rights2', 'image_visible2', 'resource_media_type1', 'resource_fileformat1', 'resource_location1', 'resource_name1', 'resource_description1', 'resource_owner1', 'resource_creator1', 'resource_rights1', 'resource_visible1', 'resource_media_type2', 'resource_fileformat2', 'resource_location2', 'resource_name2', 'resource_description2', 'resource_owner2', 'resource_creator2', 'resource_rights2', 'resource_visible2', 'production_when1', 'production_when_sure1', 'production_who1', 'production_who_sure1', 'production_where1', 'production_where_sure1', 'production_annotation1', 'production_when2', 'production_when_sure2', 'production_who2', 'production_who_sure2', 'production_where2', 'production_where_sure2', 'production_annotation2', 'finding_when1', 'finding_when_sure1', 'finding_who1', 'finding_who_sure1', 'finding_where1', 'finding_where_sure1', 'finding_annotation1', 'finding_when2', 'finding_when_sure2', 'finding_who2', 'finding_who_sure2', 'finding_where2', 'finding_where_sure2', 'finding_annotation2', 'publication_when1', 'publication_when_sure1', 'publication_who1', 'publication_who_sure1', 'publication_where1', 'publication_where_sure1', 'publication_annotation1', 'publication_when2', 'publication_when_sure2', 'publication_who2', 'publication_who_sure2', 'publication_where2', 'publication_where_sure2', 'publication_annotation2', 'template_creation_when1', 'template_creation_when_sure1', 'template_creation_who1', 'template_creation_who_sure1', 'template_creation_where1', 'template_creation_where_sure1', 'template_creation_annotation1', 'template_creation_when2', 'template_creation_when_sure2', 'template_creation_who2', 'template_creation_who_sure2', 'template_creation_where2', 'template_creation_where_sure2', 'template_creation_annotation2', 'was_depicted_who1', 'was_depicted_who_sure2', 'was_depicted_who2', 'was_depicted_who_sure2', 'was_used_when1', 'was_used_when_sure1', 'was_used_who1', 'was_used_who_sure1', 'was_used_where1', 'was_used_where_sure1', 'was_used_annotation1', 'was_used_when2', 'was_used_when_sure2', 'was_used_who2', 'was_used_who_sure2', 'was_used_where2', 'was_used_where_sure2', 'was_used_annotation2', 'written_when1', 'written_when_sure1', 'written_who1', 'written_who_sure1', 'written_where1', 'written_where_sure1', 'written_annotation1', 'written_when2', 'written_when_sure2', 'written_who2', 'written_who_sure2', 'written_where2', 'written_where_sure2', 'written_annotation2', 'collected_when1', 'collected_when_sure1', 'collected_who1', 'collected_who_sure1', 'collected_where1', 'collected_where_sure1', 'collected_annotation1', 'collected_when2', 'collected_when_sure2', 'collected_who2', 'collected_who_sure2', 'collected_where2', 'collected_where_sure2', 'collected_annotation2', 'painted_when1', 'painted_when_sure1', 'painted_who1', 'painted_who_sure1', 'painted_where1', 'painted_where_sure1', 'painted_annotation1', 'painted_when2', 'painted_when_sure2', 'painted_who2', 'painted_who_sure2', 'painted_where2', 'painted_where_sure2', 'painted_annotation2', 'taken_when1', 'taken_when_sure1', 'taken_who1', 'taken_who_sure1', 'taken_where1', 'taken_where_sure1', 'taken_annotation1', 'taken_when2', 'taken_when_sure2', 'taken_who2', 'taken_who_sure2', 'taken_where2', 'taken_where_sure2', 'taken_annotation2', 'received_when1', 'received_when_sure1', 'received_who1', 'received_who_sure1', 'received_where1', 'received_where_sure1', 'received_annotation1', 'received_when2', 'received_when_sure2', 'received_who2', 'received_who_sure2', 'received_where2', 'received_where_sure2', 'received_annotation2', 'printing_plate_produced_when1', 'printing_plate_produced_when_sure1', 'printing_plate_produced_who1', 'printing_plate_produced_who_sure1', 'printing_plate_produced_where1', 'printing_plate_produced_where_sure1', 'printing_plate_produced_annotation1', 'printing_plate_produced_when2', 'printing_plate_produced_when_sure2', 'printing_plate_produced_who2', 'printing_plate_produced_who_sure2', 'printing_plate_produced_where2', 'printing_plate_produced_where_sure2', 'printing_plate_produced_annotation2', 'sent_when1', 'sent_when_sure1', 'sent_who1', 'sent_who_sure1', 'sent_where1', 'sent_where_sure1', 'sent_annotation1', 'sent_when2', 'sent_when_sure2', 'sent_who2', 'sent_who_sure2', 'sent_where2', 'sent_where_sure2', 'sent_annotation2', 'issued_when1', 'issued_when_sure1', 'issued_who1', 'issued_who_sure1', 'issued_where1', 'issued_where_sure1', 'issued_annotation1', 'issued_when2', 'issued_when_sure2', 'issued_who2', 'issued_who_sure2', 'issued_where2', 'issued_where_sure2', 'issued_annotation2', 'signed_when1', 'signed_when_sure1', 'signed_who1', 'signed_who_sure1', 'signed_where1', 'signed_where_sure1', 'signed_annotation1', 'signed_when2', 'signed_when_sure2', 'signed_who2', 'signed_who_sure2', 'signed_where2', 'signed_where_sure2', 'signed_annotation2', 'type_described_when1', 'type_described_when_sure1', 'type_described_who1', 'type_described_who_sure1', 'type_described_where1', 'type_described_where_sure1', 'type_described_annotation1', 'type_described_when2', 'type_described_when_sure2', 'type_described_who2', 'type_described_who_sure2', 'type_described_where2', 'type_described_where_sure2', 'type_described_annotation2', 'drawn_when1', 'drawn_when_sure1', 'drawn_who1', 'drawn_who_sure1', 'drawn_where1', 'drawn_where_sure1', 'drawn_annotation1', 'drawn_when2', 'drawn_when_sure2', 'drawn_who2', 'drawn_who_sure2', 'drawn_where2', 'drawn_where_sure2', 'drawn_annotation2', 'copied_when1', 'copied_when_sure1', 'copied_who1', 'copied_who_sure1', 'copied_where1', 'copied_where_sure1', 'copied_annotation1', 'copied_when2', 'copied_when_sure2', 'copied_who2', 'copied_who_sure2', 'copied_where2', 'copied_where_sure2', 'copied_annotation2', 'has_lived_when1', 'has_lived_when_sure1', 'has_lived_where1', 'has_lived_where_sure1', 'has_lived_annotation1', 'has_lived_when2', 'has_lived_when_sure2', 'has_lived_where2', 'has_lived_where_sure2', 'has_lived_annotation2', 'related_place1', 'related_place_sure1', 'related_place2', 'related_place_sure2', 'related_actor1', 'related_actor_sure1', 'related_actor2', 'related_actor_sure2', 'related_time1', 'related_time_sure1', 'related_time2', 'related_time_sure2', 'commissioned_when1', 'commissioned_when_sure1', 'commissioned_who1', 'commissioned_who_sure1', 'commissioned_where1', 'commissioned_where_sure1', 'commissioned_annotation1', 'commissioned_when2', 'commissioned_when_sure2', 'commissioned_who2', 'commissioned_who_sure2', 'commissioned_where2', 'commissioned_where_sure2', 'commissioned_annotation2', 'printed_when1', 'printed_when_sure1', 'printed_who1', 'printed_who_sure1', 'printed_where1', 'printed_where_sure1', 'printed_annotation1', 'printed_when2', 'printed_when_sure2', 'printed_who2', 'printed_who_sure2', 'printed_where2', 'printed_where_sure2', 'printed_annotation2', 'spoken_when1', 'spoken_when_sure1', 'spoken_who1', 'spoken_who_sure1', 'spoken_where1', 'spoken_where_sure1', 'spoken_annotation1', 'spoken_when2', 'spoken_when_sure2', 'spoken_who2', 'spoken_who_sure2', 'spoken_where2', 'spoken_where_sure2', 'spoken_annotation2', 'sung_when1', 'sung_when_sure1', 'sung_who1', 'sung_who_sure1', 'sung_where1', 'sung_where_sure1', 'sung_annotation1', 'sung_when2', 'sung_when_sure2', 'sung_who2', 'sung_who_sure2', 'sung_where2', 'sung_where_sure2', 'sung_annotation2', 'decor_designed_when1', 'decor_designed_when_sure1', 'decor_designed_who1', 'decor_designed_who_sure1', 'decor_designed_where1', 'decor_designed_where_sure1', 'decor_designed_annotation1', 'decor_designed_when2', 'decor_designed_when_sure2', 'decor_designed_who2', 'decor_designed_who_sure2', 'decor_designed_where2', 'decor_designed_where_sure2', 'decor_designed_annotation2', 'form_designed_when1', 'form_designed_when_sure1', 'form_designed_who1', 'form_designed_who_sure1', 'form_designed_where1', 'form_designed_where_sure1', 'form_designed_annotation1', 'form_designed_when2', 'form_designed_when_sure2', 'form_designed_who2', 'form_designed_who_sure2', 'form_designed_where2', 'form_designed_where_sure2', 'form_designed_annotation2', 'modelled_when1', 'modelled_when_sure1', 'modelled_who1', 'modelled_who_sure1', 'modelled_where1', 'modelled_where_sure1', 'modelled_annotation1', 'modelled_when2', 'modelled_when_sure2', 'modelled_who2', 'modelled_who_sure2', 'modelled_where2', 'modelled_where_sure2', 'modelled_annotation2', 'signed_when1', 'signed_when_sure1', 'signed_who1', 'signed_who_sure1', 'signed_where1', 'signed_where_sure1', 'signed_annotation1', 'signed_when2', 'signed_when_sure2', 'signed_who2', 'signed_who_sure2', 'signed_where2', 'signed_where_sure2', 'signed_annotation2', 'was_mentioned_when1', 'was_mentioned_when_sure1', 'was_mentioned_who1', 'was_mentioned_who_sure1', 'was_mentioned_where1', 'was_mentioned_where_sure1', 'was_mentioned_annotation1', 'was_mentioned_when2', 'was_mentioned_when_sure2', 'was_mentioned_who2', 'was_mentioned_who_sure2', 'was_mentioned_where2', 'was_mentioned_where_sure2', 'was_mentioned_annotation2', 'buried_when1', 'buried_when_sure1', 'buried_who1', 'buried_who_sure1', 'buried_where1', 'buried_where_sure1', 'buried_annotation1', 'buried_when2', 'buried_when_sure2', 'buried_who2', 'buried_who_sure2', 'buried_where2', 'buried_where_sure2', 'buried_annotation2', 'intellectual_creation_when1', 'intellectual_creation_when_sure1', 'intellectual_creation_who1', 'intellectual_creation_who_sure1', 'intellectual_creation_where1', 'intellectual_creation_where_sure1', 'intellectual_creation_annotation1', 'intellectual_creation_when2', 'intellectual_creation_when_sure2', 'intellectual_creation_who2', 'intellectual_creation_who_sure2', 'intellectual_creation_where2', 'intellectual_creation_where_sure2', 'intellectual_creation_annotation2'); \ No newline at end of file diff --git a/values/all_fields.php b/values/all_fields.php new file mode 100644 index 0000000..19346c7 --- /dev/null +++ b/values/all_fields.php @@ -0,0 +1,695 @@ +material_separate and technique_separate'), +array ('object_dimensions','n','text/utf8','freetext','none','This is a cummulative field for dimensions (values and units). It is also possible to additionally save the information separate. See the block: separate dimensions'), +array ('object_publication','n','One letter only','"y","n"','none','Shall the object be visible directly after import?'), +array ('object_other_title','n','text/utf8','freetext','object_other_title_kind_of','If the field object_other_title is used. It has to be specified where this alternative title is used. Specification should be done within the field: object_other_title_kind_of'), +array ('object_other_title_kind_of','n','text/utf8','de: "Wissenschaft", "Alltagssprache", "Umgangssprache", "Dialekt"
hu: "Tudományos", "Köznyelvi", "Nyelvjárás"', 'object_other_title', 'This field has to be used togehter with object_other_title'), +array ('detailed_description','n','text/utf8','freetext','detailed_description_md and detailed_description_extern','If detailed_desription is made available for an object, detailed_description_md and detailed_description_extern have to have values too'), +array ('detailed_description_md','n','One letter only','"y","n"','detailed_description and detailed_description_extern','Shall detailed description be visible at museum-digital? If detailed_desription is available for an object, detailed_description_md and detailed_description_extern have to have values too'), +array ('detailed_description_extern','n','One letter only','"y","n"','detailed_description_md and detailed_description','Shall later exports from museum-digital include the detailed_description?
If detailed_desription is available for an object, detailed_description_md and detailed_description_extern have to have values too'), +array ('inscription','n','text/utf8','freetext','inscription_md and inscription_extern','If inscription is made available for an object, inscription_md> and inscription_extern have to have values too'), +array ('inscription_md','n','One letter only','"y","n"','inscription_md and inscription_extern','Shall a given inscription be displayed at museum-digital? If inscription is available for an object, inscription_md> and inscription_extern have to have values too'), +array ('inscription_extern','n','One letter only','"y","n"','inscription_md and inscription_extern','Shall later exports from museum-digital inlude inscription? If inscription is available for an object, inscription_md> and inscription_extern have to have values too'), +array ('material_separate','n','text/utf8','freetext','none','Additional to collecting material and technique in a combined field (see above), the material(s) can be given here separately'), +array ('technique_separate','n','text/utf8','freetext','none', 'Additional to collecting material and technique in a combined field (see above), the technique(s) can be given here separately'), +array ('dimensions_separate_length_value','n','text/utf8','number','dimensions_separate_length_unit, dimensions_separate_show_md, dimensions_separate_show_extern','If a separated value is given an entry for the respective unit is necessary. If a separated dimension entry is given, dimensions_separate_show_md and dimensions_separate_show_extern need to be filled in, too.'), +array ('dimensions_separate_length_unit','n','text/utf8','"m","dm","cm","mm"','dimensions_separate_length_value, dimensions_separate_show_md, dimensions_separate_show_extern','If a separated value is given an entry for the respective unit is necessary. If a separated dimension entry is given, dimensions_separate_show_md and dimensions_separate_show_extern need to be filled in, too.'), +array ('dimensions_separate_width_value', 'n', 'text/utf8', 'number','dimensions_separate_width_unit, dimensions_separate_show_md, dimensions_separate_show_extern','If a separated value is given an entry for the respective unit is necessary. If a separated dimension entry is given, dimensions_separate_show_md and dimensions_separate_show_extern need to be filled in, too.'), +array ('dimensions_separate_width_unit', 'n', 'text/utf8', '"m","dm","cm","mm"','dimensions_separate_width_value, dimensions_separate_show_md, dimensions_separate_show_extern','If a separated value is given an entry for the respective unit is necessary. If a separated dimension entry is given, dimensions_separate_show_md and dimensions_separate_show_extern need to be filled in, too.'), +array ('dimensions_separate_height_value', 'n', 'text/utf8', 'number','dimensions_separate_height_unit, dimensions_separate_show_md, dimensions_separate_show_extern','If a separated value is given an entry for the respective unit is necessary. If a separated dimension entry is given, dimensions_separate_show_md and dimensions_separate_show_extern need to be filled in, too.'), +array ('dimensions_separate_height_unit', 'n', 'text/utf8', '"m","dm","cm","mm"','dimensions_separate_height_value, dimensions_separate_show_md, dimensions_separate_show_extern','If a separated value is given an entry for the respective unit is necessary. If a separated dimension entry is given, dimensions_separate_show_md and dimensions_separate_show_extern need to be filled in, too.'), +array ('dimensions_separate_weight_value', 'n', 'text/utf8','number','dimensions_separate_weight_unit, dimensions_separate_show_md, dimensions_separate_show_extern','If a separated value is given an entry for the respective unit is necessary. If a separated dimension entry is given, dimensions_separate_show_md and dimensions_separate_show_extern need to be filled in, too.'), +array ('dimensions_separate_weight_unit', 'n', 'text/utf8', '"m","dm","cm","mm"','dimensions_separate_width_value, dimensions_separate_show_md, dimensions_separate_show_extern','If a separated value is given an entry for the respective unit is necessary. If a separated dimension entry is given, dimensions_separate_show_md and dimensions_separate_show_extern need to be filled in, too.'), +array ('dimensions_separate_diameter_value', 'n', 'text/utf8', 'number','dimensions_separate_diameter_unit, dimensions_separate_show_md, dimensions_separate_show_extern','If a separated value is given an entry for the respective unit is necessary. If a separated dimension entry is given, dimensions_separate_show_md and dimensions_separate_show_extern need to be filled in, too.'), +array ('dimensions_separate_diameter_unit', 'n', 'text/utf8', '"m","dm","cm","mm"','dimensions_separate_diameter_value, dimensions_separate_show_md, dimensions_separate_show_extern','If a separated value is given an entry for the respective unit is necessary. If a separated dimension entry is given, dimensions_separate_show_md and dimensions_separate_show_extern need to be filled in, too.'), +array ('dimensions_separate_wall_thickness_value', 'n', 'text/utf8', 'number','dimensions_separate_thickness_unit, dimensions_separate_show_md, dimensions_separate_show_extern','If a separated value is given an entry for the respective unit is necessary. If a separated dimension entry is given, dimensions_separate_show_md and dimensions_separate_show_extern need to be filled in, too.'), +array ('dimensions_separate_wall_thickness_unit', 'n', 'text/utf8', '"m","dm","cm","mm"','dimensions_separate_thickness_value, dimensions_separate_show_md, dimensions_separate_show_extern','If a separated value is given an entry for the respective unit is necessary. If a separated dimension entry is given, dimensions_separate_show_md and dimensions_separate_show_extern need to be filled in, too.'), +array ('dimensions_separate_show_md', 'n', 'One letter only', '"y","n"','Any field named dimensions_separate ...','If one or more separate dimension-value (and -unit) is given it has to be specified if the separated entries should be made visible at museum-digital'), +array ('dimensions_separate_show_extern', 'n', 'One letter only', '"y","n"','Any field named dimensions_separate ...','If one or more separate dimension-value (and -unit) is given it has to be specified if the separated entries should be included in a later export from museum-digital'), +array ('number_of_pieces', 'n', 'text/utf8','number','none','Only to be given if more than one copies of an object are available and catalogued with the same inventory number'), +array ('number_of_pages', 'n', 'text/utf8', 'number', 'none','Only to be given for books (etc.)'), +array ('comparable_objects_other_museums', 'n', 'text/utf8', 'freetext', 'comparable_objects_other_museums_show_md, comparable_objects_other_museums_show_extern', 'Name of other museum and if available the inventory number of the respective object. If comparable_objects_other_museums is given comparable_objects_other_museums_show_md and comparable_objects_other_museums_show_extern have to be given too'), +array ('comparable_objects_other_museums_show_md', 'n', 'One letter only', '"y","n"', 'comparable_objects_other_museums','Necessary if comparable_objects_other_museums is given. Should the information about comparable objects be displayed at museum-digital?'), +array ('comparable_objects_other_museums_show_extern', 'n', 'One letter only', '"y","n"', 'comparable_objects_other_museums','Necessary if comparable_objects_other_museums is given. Should the information about comparable objects be part of later exports from museum-digital?'), +//array ('other_object_title', 'n', ''), +//array ('other_object_title_in', 'n', ''), +array ('closer_location', 'n', 'text/utf8', 'freetext', 'closer_location_as', 'A place in a special relation to the object. The kind of relation has to specified in closer_location_as'), +array ('closer_location_as', 'n', 'text/utf8', 'de: "Aufnahmeort", "Fundort", "Früherer Ort" hu: "Felvétel késztésének helye","Lelőhely","Történelmi elnevezés"', 'closer_location', 'A place in a special relation to the object can be given in closer_location. Here the kind of relation between object and place has to specified'), +/* Structure of array: +0: name of element +1: mandatory? (y or n) +2: format (eg. text/utf8 +3: allowed values (eg. "m", "cm", ...) +4: dependent fields +5: remarks +*/ +array ('entry_number', 'n', 'text/utf8','freetext','none','The entry number of the object if available'), +array ('other_inventory_number', 'n', 'text/utf8','freetext','none','All other inventory numbers (older ones presumably) in one field'), +array ('subject_group', 'n', 'text/utf8','freetext','none','If the object is part of an subject group this information should be given here'), +array ('systematic', 'n', 'text/utf8','freetext','none','If the object is put into a museum-systematic the place it has there'), +array ('bundle', 'n', 'text/utf8','freetext','none','The bundle the object belongs to'), +array ('part_of', 'n', 'text/utf8','freetext','none','If the object is part of something it can be given here'), +array ('inclusion_when', 'n', ''), +array ('inclusion_kind_of', 'n', ''), +array ('inclusion_who', 'n', ''), +array ('inclusion_where', 'n', ''), +array ('registration_first_who', 'n', ''), +array ('registration_first_when', 'n', ''), +array ('owner_previous', 'n', ''), +array ('object_history', 'n', ''), +array ('bought_for', 'n', ''), +array ('bought_for_currency', 'n', ''), +array ('worth_determiner', 'n', ''), +array ('worth_when', 'n', ''), +array ('worth_value', 'n', ''), +array ('worth_unit', 'n', ''), +array ('worth_incurance_determiner', 'n', ''), +array ('worth_incurance_when', 'n', ''), +array ('worth_insurance_value', 'n', ''), +array ('worth_insurance_unit', 'n', ''), +array ('state', 'n', ''), +array ('restauration', 'n', ''), +array ('abode_actual', 'n', ''), +array ('abode_regular', 'n', ''), +array ('exhibition', 'n', ''), +array ('on_loan_to', 'n', ''), +array ('on_loan_contact', 'n', ''), +array ('on_loan_when', 'n', ''), +array ('on_loan_insurance_value', 'n', ''), +array ('on_loan_annotation', 'n', ''), +array ('copyright', 'n', ''), +array ('rights_of_use', 'n', ''), +array ('rights_annotation', 'n', ''), +array ('remarks_short', 'n', ''), +array ('remarks_long', 'n', ''), +array ('images_in_museum', 'n', ''), +array ('documents_in_museum', 'n', ''), +array ('link_url1', 'n', ''), +array ('link_show1', 'n', ''), +array ('link_url2', 'n', ''), +array ('link_show2', 'n', ''), +array ('literature_author1', 'n', ''), +array ('literature_year1', 'n', ''), +array ('literature_title1', 'n', ''), +array ('literature_place1', 'n', ''), +array ('literature_abbreviation1', 'n', ''), +array ('literature_gnd1', 'n', ''), +array ('literature_isbn1', 'n', ''), +array ('literature_signature1', 'n', ''), +array ('literature_online1', 'n', ''), +array ('literature_annotation1', 'n', ''), +array ('literature_inlit1', 'n', ''), +array ('literature_author2', 'n', ''), +array ('literature_year2', 'n', ''), +array ('literature_title2', 'n', ''), +array ('literature_place2', 'n', ''), +array ('literature_abbreviation2', 'n', ''), +array ('literature_gnd2', 'n', ''), +array ('literature_isbn2', 'n', ''), +array ('literature_signature2', 'n', ''), +array ('literature_online2', 'n', ''), +array ('literature_annotation2', 'n', ''), +array ('literature_inlit2', 'n', ''), +array ('object_group_name1', 'n', ''), +array ('object_group_description1', 'n', ''), +array ('object_group_show1', 'n', ''), +array ('object_group_name2', 'n', ''), +array ('object_group_description2', 'n', ''), +array ('object_group_show2', 'n', ''), +array ('object_group_name3', 'n', ''), +array ('object_group_description3', 'n', ''), +array ('object_group_show3', 'n', ''), +array ('object_group_name4', 'n', ''), +array ('object_group_description4', 'n', ''), +array ('object_group_show4', 'n', ''), +array ('object_group_name5', 'n', ''), +array ('object_group_description5', 'n', ''), +array ('object_group_show5', 'n', ''), +array ('tag1', 'n', ''), +array ('tag2', 'n', ''), +array ('tag3', 'n', ''), +array ('tag4', 'n', ''), +array ('tag5', 'n', ''), +array ('tag6', 'n', ''), +array ('tag7', 'n', ''), +array ('tag8', 'n', ''), +array ('tag9', 'n', ''), +array ('tag10', 'n', ''), +array ('related_place1', 'n', ''), +array ('related_place_sure1', 'n', ''), +array ('related_place2', 'n', ''), +array ('related_place_sure2', 'n', ''), +array ('related_actor1', 'n', ''), +array ('related_actor_sure1', 'n', ''), +array ('related_actor2', 'n', ''), +array ('related_actor_sure2', 'n', ''), +array ('related_time1', 'n', ''), +array ('related_time_sure1', 'n', ''), +array ('related_time2', 'n', ''), +array ('related_time_sure2', 'n', ''), +array ('image_name1', 'n', ''), +array ('image_description1', 'n', ''), +array ('image_owner1', 'n', ''), +array ('image_creator1', 'n', ''), +array ('image_rights1', 'n', ''), +array ('image_visible1', 'n', ''), +array ('image_main1', 'n', ''), +array ('image_name2', 'n', ''), +array ('image_description2', 'n', ''), +array ('image_owner2', 'n', ''), +array ('image_creator2', 'n', ''), +array ('image_rights2', 'n', ''), +array ('image_visible2', 'n', ''), +array ('image_main2', 'n', ''), +array ('image_name3', 'n', ''), +array ('image_description3', 'n', ''), +array ('image_owner3', 'n', ''), +array ('image_creator3', 'n', ''), +array ('image_rights3', 'n', ''), +array ('image_visible3', 'n', ''), +array ('image_main3', 'n', ''), +array ('image_name4', 'n', ''), +array ('image_description4', 'n', ''), +array ('image_owner4', 'n', ''), +array ('image_creator4', 'n', ''), +array ('image_rights4', 'n', ''), +array ('image_visible4', 'n', ''), +array ('image_main4', 'n', ''), +array ('image_name5', 'n', ''), +array ('image_description5', 'n', ''), +array ('image_owner5', 'n', ''), +array ('image_creator5', 'n', ''), +array ('image_rights5', 'n', ''), +array ('image_visible5', 'n', ''), +array ('image_main5', 'n', ''), +array ('image_name6', 'n', ''), +array ('image_description6', 'n', ''), +array ('image_owner6', 'n', ''), +array ('image_creator6', 'n', ''), +array ('image_rights6', 'n', ''), +array ('image_visible6', 'n', ''), +array ('image_main6', 'n', ''), +array ('image_name7', 'n', ''), +array ('image_description7', 'n', ''), +array ('image_owner7', 'n', ''), +array ('image_creator7', 'n', ''), +array ('image_rights7', 'n', ''), +array ('image_visible7', 'n', ''), +array ('image_main7', 'n', ''), +array ('image_name8', 'n', ''), +array ('image_description8', 'n', ''), +array ('image_owner8', 'n', ''), +array ('image_creator8', 'n', ''), +array ('image_rights8', 'n', ''), +array ('image_visible8', 'n', ''), +array ('image_main8', 'n', ''), +array ('image_name9', 'n', ''), +array ('image_description9', 'n', ''), +array ('image_owner9', 'n', ''), +array ('image_creator9', 'n', ''), +array ('image_rights9', 'n', ''), +array ('image_visible9', 'n', ''), +array ('image_main9', 'n', ''), +array ('image_name10', 'n', ''), +array ('image_description10', 'n', ''), +array ('image_owner10', 'n', ''), +array ('image_creator10', 'n', ''), +array ('image_rights10', 'n', ''), +array ('image_visible10', 'n', ''), +array ('image_main10', 'n', ''), +array ('resource_media_type1', 'n', ''), +array ('resource_fileformat1', 'n', ''), +array ('resource_location1', 'n', ''), +array ('resource_name1', 'n', ''), +array ('resource_description1', 'n', ''), +array ('resource_owner1', 'n', ''), +array ('resource_creator1', 'n', ''), +array ('resource_rights1', 'n', ''), +array ('resource_visible1', 'n', ''), +array ('resource_media_type2', 'n', ''), +array ('resource_fileformat2', 'n', ''), +array ('resource_location2', 'n', ''), +array ('resource_name2', 'n', ''), +array ('resource_description2', 'n', ''), +array ('resource_owner2', 'n', ''), +array ('resource_creator2', 'n', ''), +array ('resource_rights2', 'n', ''), +array ('resource_visible2', 'n', ''), +array ('production_when1', 'n', ''), +array ('production_when_sure1', 'n', ''), +array ('production_who1', 'n', ''), +array ('production_who_sure1', 'n', ''), +array ('production_where1', 'n', ''), +array ('production_where_sure1', 'n', ''), +array ('production_annotation1', 'n', ''), +array ('production_when2', 'n', ''), +array ('production_when_sure2', 'n', ''), +array ('production_who2', 'n', ''), +array ('production_who_sure2', 'n', ''), +array ('production_where2', 'n', ''), +array ('production_where_sure2', 'n', ''), +array ('production_annotation2', 'n', ''), +array ('finding_when1', 'n', ''), +array ('finding_when_sure1', 'n', ''), +array ('finding_who1', 'n', ''), +array ('finding_who_sure1', 'n', ''), +array ('finding_where1', 'n', ''), +array ('finding_where_sure1', 'n', ''), +array ('finding_annotation1', 'n', ''), +array ('finding_when2', 'n', ''), +array ('finding_when_sure2', 'n', ''), +array ('finding_who2', 'n', ''), +array ('finding_who_sure2', 'n', ''), +array ('finding_where2', 'n', ''), +array ('finding_where_sure2', 'n', ''), +array ('finding_annotation2', 'n', ''), +array ('publication_when1', 'n', ''), +array ('publication_when_sure1', 'n', ''), +array ('publication_who1', 'n', ''), +array ('publication_who_sure1', 'n', ''), +array ('publication_where1', 'n', ''), +array ('publication_where_sure1', 'n', ''), +array ('publication_annotation1', 'n', ''), +array ('publication_when2', 'n', ''), +array ('publication_when_sure2', 'n', ''), +array ('publication_who2', 'n', ''), +array ('publication_who_sure2', 'n', ''), +array ('publication_where2', 'n', ''), +array ('publication_where_sure2', 'n', ''), +array ('publication_annotation2', 'n', ''), +array ('template_creation_when1', 'n', ''), +array ('template_creation_when_sure1', 'n', ''), +array ('template_creation_who1', 'n', ''), +array ('template_creation_who_sure1', 'n', ''), +array ('template_creation_where1', 'n', ''), +array ('template_creation_where_sure1', 'n', ''), +array ('template_creation_annotation1', 'n', ''), +array ('template_creation_when2', 'n', ''), +array ('template_creation_when_sure2', 'n', ''), +array ('template_creation_who2', 'n', ''), +array ('template_creation_who_sure2', 'n', ''), +array ('template_creation_where2', 'n', ''), +array ('template_creation_where_sure2', 'n', ''), +array ('template_creation_annotation2', 'n', ''), +array ('was_depicted_who1', 'n', ''), +array ('was_depicted_who_sure1', 'n', ''), +array ('was_depicted_who2', 'n', ''), +array ('was_depicted_who_sure2', 'n', ''), +array ('was_depicted_place1', 'n', ''), +array ('was_depicted_place_sure1', 'n', ''), +array ('was_depicted_place2', 'n', ''), +array ('was_depicted_place_sure2', 'n', ''), +array ('was_used_when1', 'n', ''), +array ('was_used_when_sure1', 'n', ''), +array ('was_used_who1', 'n', ''), +array ('was_used_who_sure1', 'n', ''), +array ('was_used_where1', 'n', ''), +array ('was_used_where_sure1', 'n', ''), +array ('was_used_annotation1', 'n', ''), +array ('was_used_when2', 'n', ''), +array ('was_used_when_sure2', 'n', ''), +array ('was_used_who2', 'n', ''), +array ('was_used_who_sure2', 'n', ''), +array ('was_used_where2', 'n', ''), +array ('was_used_where_sure2', 'n', ''), +array ('was_used_annotation2', 'n', ''), +array ('written_when1', 'n', ''), +array ('written_when_sure1', 'n', ''), +array ('written_who1', 'n', ''), +array ('written_who_sure1', 'n', ''), +array ('written_where1', 'n', ''), +array ('written_where_sure1', 'n', ''), +array ('written_annotation1', 'n', ''), +array ('written_when2', 'n', ''), +array ('written_when_sure2', 'n', ''), +array ('written_who2', 'n', ''), +array ('written_who_sure2', 'n', ''), +array ('written_where2', 'n', ''), +array ('written_where_sure2', 'n', ''), +array ('written_annotation2', 'n', ''), +array ('collected_when1', 'n', ''), +array ('collected_when_sure1', 'n', ''), +array ('collected_who1', 'n', ''), +array ('collected_who_sure1', 'n', ''), +array ('collected_where1', 'n', ''), +array ('collected_where_sure1', 'n', ''), +array ('collected_annotation1', 'n', ''), +array ('collected_when2', 'n', ''), +array ('collected_when_sure2', 'n', ''), +array ('collected_who2', 'n', ''), +array ('collected_who_sure2', 'n', ''), +array ('collected_where2', 'n', ''), +array ('collected_where_sure2', 'n', ''), +array ('collected_annotation2', 'n', ''), +array ('painted_when1', 'n', ''), +array ('painted_when_sure1', 'n', ''), +array ('painted_who1', 'n', ''), +array ('painted_who_sure1', 'n', ''), +array ('painted_where1', 'n', ''), +array ('painted_where_sure1', 'n', ''), +array ('painted_annotation1', 'n', ''), +array ('painted_when2', 'n', ''), +array ('painted_when_sure2', 'n', ''), +array ('painted_who2', 'n', ''), +array ('painted_who_sure2', 'n', ''), +array ('painted_where2', 'n', ''), +array ('painted_where_sure2', 'n', ''), +array ('painted_annotation2', 'n', ''), +array ('taken_when1', 'n', ''), +array ('taken_when_sure1', 'n', ''), +array ('taken_who1', 'n', ''), +array ('taken_who_sure1', 'n', ''), +array ('taken_where1', 'n', ''), +array ('taken_where_sure1', 'n', ''), +array ('taken_annotation1', 'n', ''), +array ('taken_when2', 'n', ''), +array ('taken_when_sure2', 'n', ''), +array ('taken_who2', 'n', ''), +array ('taken_who_sure2', 'n', ''), +array ('taken_where2', 'n', ''), +array ('taken_where_sure2', 'n', ''), +array ('taken_annotation2', 'n', ''), +array ('received_when1', 'n', ''), +array ('received_when_sure1', 'n', ''), +array ('received_who1', 'n', ''), +array ('received_who_sure1', 'n', ''), +array ('received_where1', 'n', ''), +array ('received_where_sure1', 'n', ''), +array ('received_annotation1', 'n', ''), +array ('received_when2', 'n', ''), +array ('received_when_sure2', 'n', ''), +array ('received_who2', 'n', ''), +array ('received_who_sure2', 'n', ''), +array ('received_where2', 'n', ''), +array ('received_where_sure2', 'n', ''), +array ('received_annotation2', 'n', ''), +array ('printing_plate_produced_when1', 'n', ''), +array ('printing_plate_produced_when_sure1', 'n', ''), +array ('printing_plate_produced_who1', 'n', ''), +array ('printing_plate_produced_who_sure1', 'n', ''), +array ('printing_plate_produced_where1', 'n', ''), +array ('printing_plate_produced_where_sure1', 'n', ''), +array ('printing_plate_produced_annotation1', 'n', ''), +array ('printing_plate_produced_when2', 'n', ''), +array ('printing_plate_produced_when_sure2', 'n', ''), +array ('printing_plate_produced_who2', 'n', ''), +array ('printing_plate_produced_who_sure2', 'n', ''), +array ('printing_plate_produced_where2', 'n', ''), +array ('printing_plate_produced_where_sure2', 'n', ''), +array ('printing_plate_produced_annotation2', 'n', ''), +array ('sent_when1', 'n', ''), +array ('sent_when_sure1', 'n', ''), +array ('sent_who1', 'n', ''), +array ('sent_who_sure1', 'n', ''), +array ('sent_where1', 'n', ''), +array ('sent_where_sure1', 'n', ''), +array ('sent_annotation1', 'n', ''), +array ('sent_when2', 'n', ''), +array ('sent_when_sure2', 'n', ''), +array ('sent_who2', 'n', ''), +array ('sent_who_sure2', 'n', ''), +array ('sent_where2', 'n', ''), +array ('sent_where_sure2', 'n', ''), +array ('sent_annotation2', 'n', ''), +array ('issued_when1', 'n', ''), +array ('issued_when_sure1', 'n', ''), +array ('issued_who1', 'n', ''), +array ('issued_who_sure1', 'n', ''), +array ('issued_where1', 'n', ''), +array ('issued_where_sure1', 'n', ''), +array ('issued_annotation1', 'n', ''), +array ('issued_when2', 'n', ''), +array ('issued_when_sure2', 'n', ''), +array ('issued_who2', 'n', ''), +array ('issued_who_sure2', 'n', ''), +array ('issued_where2', 'n', ''), +array ('issued_where_sure2', 'n', ''), +array ('issued_annotation2', 'n', ''), +array ('signed_when1', 'n', ''), +array ('signed_when_sure1', 'n', ''), +array ('signed_who1', 'n', ''), +array ('signed_who_sure1', 'n', ''), +array ('signed_where1', 'n', ''), +array ('signed_where_sure1', 'n', ''), +array ('signed_annotation1', 'n', ''), +array ('signed_when2', 'n', ''), +array ('signed_when_sure2', 'n', ''), +array ('signed_who2', 'n', ''), +array ('signed_who_sure2', 'n', ''), +array ('signed_where2', 'n', ''), +array ('signed_where_sure2', 'n', ''), +array ('signed_annotation2', 'n', ''), +array ('type_described_when1', 'n', ''), +array ('type_described_when_sure1', 'n', ''), +array ('type_described_who1', 'n', ''), +array ('type_described_who_sure1', 'n', ''), +array ('type_described_where1', 'n', ''), +array ('type_described_where_sure1', 'n', ''), +array ('type_described_annotation1', 'n', ''), +array ('type_described_when2', 'n', ''), +array ('type_described_when_sure2', 'n', ''), +array ('type_described_who2', 'n', ''), +array ('type_described_who_sure2', 'n', ''), +array ('type_described_where2', 'n', ''), +array ('type_described_where_sure2', 'n', ''), +array ('type_described_annotation2', 'n', ''), +array ('drawn_when1', 'n', ''), +array ('drawn_when_sure1', 'n', ''), +array ('drawn_who1', 'n', ''), +array ('drawn_who_sure1', 'n', ''), +array ('drawn_where1', 'n', ''), +array ('drawn_where_sure1', 'n', ''), +array ('drawn_annotation1', 'n', ''), +array ('drawn_when2', 'n', ''), +array ('drawn_when_sure2', 'n', ''), +array ('drawn_who2', 'n', ''), +array ('drawn_who_sure2', 'n', ''), +array ('drawn_where2', 'n', ''), +array ('drawn_where_sure2', 'n', ''), +array ('drawn_annotation2', 'n', ''), +array ('copied_when1', 'n', ''), +array ('copied_when_sure1', 'n', ''), +array ('copied_who1', 'n', ''), +array ('copied_who_sure1', 'n', ''), +array ('copied_where1', 'n', ''), +array ('copied_where_sure1', 'n', ''), +array ('copied_annotation1', 'n', ''), +array ('copied_when2', 'n', ''), +array ('copied_when_sure2', 'n', ''), +array ('copied_who2', 'n', ''), +array ('copied_who_sure2', 'n', ''), +array ('copied_where2', 'n', ''), +array ('copied_where_sure2', 'n', ''), +array ('copied_annotation2', 'n', ''), +array ('has_lived_when1', 'n', ''), +array ('has_lived_when_sure1', 'n', ''), +array ('has_lived_where1', 'n', ''), +array ('has_lived_where_sure1', 'n', ''), +array ('has_lived_annotation1', 'n', ''), +array ('has_lived_when2', 'n', ''), +array ('has_lived_when_sure2', 'n', ''), +array ('has_lived_where2', 'n', ''), +array ('has_lived_where_sure2', 'n', ''), +array ('has_lived_annotation2', 'n', ''), +array ('commissioned_when1', 'n', ''), +array ('commissioned_when_sure1', 'n', ''), +array ('commissioned_who1', 'n', ''), +array ('commissioned_who_sure1', 'n', ''), +array ('commissioned_where1', 'n', ''), +array ('commissioned_where_sure1', 'n', ''), +array ('commissioned_annotation1', 'n', ''), +array ('commissioned_when2', 'n', ''), +array ('commissioned_when_sure2', 'n', ''), +array ('commissioned_who2', 'n', ''), +array ('commissioned_who_sure2', 'n', ''), +array ('commissioned_where2', 'n', ''), +array ('commissioned_where_sure2', 'n', ''), +array ('commissioned_annotation2', 'n', ''), +array ('printed_when1', 'n', ''), +array ('printed_when_sure1', 'n', ''), +array ('printed_who1', 'n', ''), +array ('printed_who_sure1', 'n', ''), +array ('printed_where1', 'n', ''), +array ('printed_where_sure1', 'n', ''), +array ('printed_annotation1', 'n', ''), +array ('printed_when2', 'n', ''), +array ('printed_when_sure2', 'n', ''), +array ('printed_who2', 'n', ''), +array ('printed_who_sure2', 'n', ''), +array ('printed_where2', 'n', ''), +array ('printed_where_sure2', 'n', ''), +array ('printed_annotation2', 'n', ''), +array ('spoken_when1', 'n', ''), +array ('spoken_when_sure1', 'n', ''), +array ('spoken_who1', 'n', ''), +array ('spoken_who_sure1', 'n', ''), +array ('spoken_where1', 'n', ''), +array ('spoken_where_sure1', 'n', ''), +array ('spoken_annotation1', 'n', ''), +array ('spoken_when2', 'n', ''), +array ('spoken_when_sure2', 'n', ''), +array ('spoken_who2', 'n', ''), +array ('spoken_who_sure2', 'n', ''), +array ('spoken_where2', 'n', ''), +array ('spoken_where_sure2', 'n', ''), +array ('spoken_annotation2', 'n', ''), +array ('sung_when1', 'n', ''), +array ('sung_when_sure1', 'n', ''), +array ('sung_who1', 'n', ''), +array ('sung_who_sure1', 'n', ''), +array ('sung_where1', 'n', ''), +array ('sung_where_sure1', 'n', ''), +array ('sung_annotation1', 'n', ''), +array ('sung_when2', 'n', ''), +array ('sung_when_sure2', 'n', ''), +array ('sung_who2', 'n', ''), +array ('sung_who_sure2', 'n', ''), +array ('sung_where2', 'n', ''), +array ('sung_where_sure2', 'n', ''), +array ('sung_annotation2', 'n', ''), +array ('decor_designed_when1', 'n', ''), +array ('decor_designed_when_sure1', 'n', ''), +array ('decor_designed_who1', 'n', ''), +array ('decor_designed_who_sure1', 'n', ''), +array ('decor_designed_where1', 'n', ''), +array ('decor_designed_where_sure1', 'n', ''), +array ('decor_designed_annotation1', 'n', ''), +array ('decor_designed_when2', 'n', ''), +array ('decor_designed_when_sure2', 'n', ''), +array ('decor_designed_who2', 'n', ''), +array ('decor_designed_who_sure2', 'n', ''), +array ('decor_designed_where2', 'n', ''), +array ('decor_designed_where_sure2', 'n', ''), +array ('decor_designed_annotation2', 'n', ''), +array ('form_designed_when1', 'n', ''), +array ('form_designed_when_sure1', 'n', ''), +array ('form_designed_who1', 'n', ''), +array ('form_designed_who_sure1', 'n', ''), +array ('form_designed_where1', 'n', ''), +array ('form_designed_where_sure1', 'n', ''), +array ('form_designed_annotation1', 'n', ''), +array ('form_designed_when2', 'n', ''), +array ('form_designed_when_sure2', 'n', ''), +array ('form_designed_who2', 'n', ''), +array ('form_designed_who_sure2', 'n', ''), +array ('form_designed_where2', 'n', ''), +array ('form_designed_where_sure2', 'n', ''), +array ('form_designed_annotation2', 'n', ''), +array ('modelled_when1', 'n', ''), +array ('modelled_when_sure1', 'n', ''), +array ('modelled_who1', 'n', ''), +array ('modelled_who_sure1', 'n', ''), +array ('modelled_where1', 'n', ''), +array ('modelled_where_sure1', 'n', ''), +array ('modelled_annotation1', 'n', ''), +array ('modelled_when2', 'n', ''), +array ('modelled_when_sure2', 'n', ''), +array ('modelled_who2', 'n', ''), +array ('modelled_who_sure2', 'n', ''), +array ('modelled_where2', 'n', ''), +array ('modelled_where_sure2', 'n', ''), +array ('modelled_annotation2', 'n', ''), +array ('signed_when1', 'n', ''), +array ('signed_when_sure1', 'n', ''), +array ('signed_who1', 'n', ''), +array ('signed_who_sure1', 'n', ''), +array ('signed_where1', 'n', ''), +array ('signed_where_sure1', 'n', ''), +array ('signed_annotation1', 'n', ''), +array ('signed_when2', 'n', ''), +array ('signed_when_sure2', 'n', ''), +array ('signed_who2', 'n', ''), +array ('signed_who_sure2', 'n', ''), +array ('signed_where2', 'n', ''), +array ('signed_where_sure2', 'n', ''), +array ('signed_annotation2', 'n', ''), +array ('was_mentioned_when1', 'n', ''), +array ('was_mentioned_when_sure1', 'n', ''), +array ('was_mentioned_who1', 'n', ''), +array ('was_mentioned_who_sure1', 'n', ''), +array ('was_mentioned_where1', 'n', ''), +array ('was_mentioned_where_sure1', 'n', ''), +array ('was_mentioned_annotation1', 'n', ''), +array ('was_mentioned_when2', 'n', ''), +array ('was_mentioned_when_sure2', 'n', ''), +array ('was_mentioned_who2', 'n', ''), +array ('was_mentioned_who_sure2', 'n', ''), +array ('was_mentioned_where2', 'n', ''), +array ('was_mentioned_where_sure2', 'n', ''), +array ('was_mentioned_annotation2', 'n', ''), +array ('buried_when1', 'n', ''), +array ('buried_when_sure1', 'n', ''), +array ('buried_who1', 'n', ''), +array ('buried_who_sure1', 'n', ''), +array ('buried_where1', 'n', ''), +array ('buried_where_sure1', 'n', ''), +array ('buried_annotation1', 'n', ''), +array ('buried_when2', 'n', ''), +array ('buried_when_sure2', 'n', ''), +array ('buried_who2', 'n', ''), +array ('buried_who_sure2', 'n', ''), +array ('buried_where2', 'n', ''), +array ('buried_where_sure2', 'n', ''), +array ('buried_annotation2', 'n', ''), +array ('intellectual_creation_when1', 'n', ''), +array ('intellectual_creation_when_sure1', 'n', ''), +array ('intellectual_creation_who1', 'n', ''), +array ('intellectual_creation_who_sure1', 'n', ''), +array ('intellectual_creation_where1', 'n', ''), +array ('intellectual_creation_where_sure1', 'n', ''), +array ('intellectual_creation_annotation1', 'n', ''), +array ('intellectual_creation_when2', 'n', ''), +array ('intellectual_creation_when_sure2', 'n', ''), +array ('intellectual_creation_who2', 'n', ''), +array ('intellectual_creation_who_sure2', 'n', ''), +array ('intellectual_creation_where2', 'n', ''), +array ('intellectual_creation_where_sure2', 'n', ''), +array ('intellectual_creation_annotation2', 'n', ''), +array ('painted_on_when1', 'n', ''), +array ('painted_on_when_sure1', 'n', ''), +array ('painted_on_who1', 'n', ''), +array ('painted_on_who_sure1', 'n', ''), +array ('painted_on_where1', 'n', ''), +array ('painted_on_where_sure1', 'n', ''), +array ('painted_on_annotation1', 'n', ''), +array ('painted_on_when2', 'n', ''), +array ('painted_on_when_sure2', 'n', ''), +array ('painted_on_who2', 'n', ''), +array ('painted_on_who_sure2', 'n', ''), +array ('painted_on_where2', 'n', ''), +array ('painted_on_where_sure2', 'n', ''), +array ('painted_on_annotation2', 'n', ''), +array ('illustrated_when1', 'n', ''), +array ('illustrated_when_sure1', 'n', ''), +array ('illustrated_who1', 'n', ''), +array ('illustrated_who_sure1', 'n', ''), +array ('illustrated_where1', 'n', ''), +array ('illustrated_where_sure1', 'n', ''), +array ('illustrated_annotation1', 'n', ''), +array ('illustrated_when2', 'n', ''), +array ('illustrated_when_sure2', 'n', ''), +array ('illustrated_who2', 'n', ''), +array ('illustrated_who_sure2', 'n', ''), +array ('illustrated_where2', 'n', ''), +array ('illustrated_where_sure2', 'n', ''), +array ('illustrated_annotation2', 'n', ''), +); + + +?> diff --git a/zipit.php b/zipit.php new file mode 100644 index 0000000..4db3d98 --- /dev/null +++ b/zipit.php @@ -0,0 +1,57 @@ +setComment("Example Zip file.\nCreated on " . date('l jS \of F Y h:i:s A')); +//$zip->addFile("Hello World!", "hello.txt"); + +if ($handle = opendir($fileDir)) { + /* This is the correct way to loop over the directory. */ + while (false !== ($file = readdir($handle))) { + if (strpos($file, ".xml") !== false) { + $pathData = pathinfo($fileDir . $file); + $fileName = $pathData['filename']; + if ($file!='1.xml') + $zip->addFile(file_get_contents($fileDir . $file), $file, filectime($fileDir . $file)); + } + } +} + +if (ini_get('zlib.output_compression')) { + ini_set('zlib.output_compression', 'Off'); +} + +$zip->finalize(); // Not scrictly necessary, the next line will call it anyway. +$zipData = $zip->getZipData(); +$length = strlen($zipData); + +header('Pragma: public'); +header("Last-Modified: " . $fileTime); +header("Expires: 0"); +header("Accept-Ranges: bytes"); +header("Connection: close"); +header("Content-Type: application/zip"); +header('Content-Disposition: attachment; filename="csv_xml.zip";' ); +header("Content-Transfer-Encoding: binary"); +header("Content-Length: ". $length); +echo $zipData; + +function rrmdir($dir) { + if (is_dir($dir)) { + $objects = scandir($dir); + foreach ($objects as $object) { + if ($object != "." && $object != "..") { + if (filetype($dir."/".$object) == "dir") rrmdir($dir."/".$object); else unlink($dir."/".$object); + } + } + reset($objects); + rmdir($dir); + } + } + +$dir_name='xml'; +rrmdir($dir_name); + +?>