<?php
/*
    CREATIVE COMMONS - Attribution-No Derivative Works 3.0 Germany:
    - You may not alter, transform, or build upon this work.
    - Dieses Werk darf nicht bearbeitet oder in anderer Weise verändert werden.
*/
// Variablen definieren
  global $db;
  global $prefix;
  global $Path;
  include('guestbook/functions.php');
  $ImportFehler = '0';
  $FileName = 'guestbook.csv';
// Datei checken
  if (!$datei = fopen($Path."/".$FileName, 'r')) {
    echo 'Error: File not Found! ('.$FileName.')<br /><br />'; }
  else {
    // Alte Datensätze löschen
      if (isset($ImportOverwriteGuestbook)) {
        $SQLQuery = "DELETE FROM ".$prefix."guestbook";
        $Result = mysqli_query($db, $SQLQuery);
        if ($Result) {
          echo $L_Old_guestbook_entries_were_deleted.'<br />'; }
        else {
          echo '<span class="ErrorMessage">'.$_ERROR_Old_guestbook_entries_NOT_deleted.'</span><br />'; }}
    // Neue Datensätze importieren
      include ('functions/import/'.$Version.'/guestbook.php');
      if ($ImportFehler=='0') {
        echo $L_Guestbook_successfully_imported.'<br />'; }
      else {
        echo '<span class="ErrorMessage">'.$L_ERROR_Guestbook_NOT_imported.' ('.$ImportFehler.')</span><br />'; }}
  echo '<br />';
?>
