<?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.
*/
  echo '<p class="Headline">'.$L_Headline26.'</p>';
  if ( !IsUserAdmin() ) { echo $L_015; }
  else
  {
    $exportDirectory = 'export/'.date('Y-m-d_H-i-s');
    if (!is_dir($exportDirectory))
      mkdir($exportDirectory, 0755);
    include ('functions/export.php');
    include ('functions/export/gigs.php');
    include ('functions/export/guestbook.php');
    include ('functions/export/news.php');
    include ('functions/export/setup.php');
    include ('functions/export/user.php');

    $handle = opendir($exportDirectory);
    while ($file = readdir ($handle))
      if ($file != "." && $file != "..") { $files[] = $file; }
    sort($files);
    //Dateien zählen
      $NumberOfFiles = count($files);
      if ($NumberOfFiles == 0) { echo $L_034; }
    else
    {
      echo '<table summary="Export">
              <tr>
                <th>'.$NumberOfFiles.' '.$L_034.'</th>
                <th>'.$L_035.'</th>
              </tr>';
      $handle = opendir($exportDirectory);
      while ($file = readdir($handle))
      {
    	  if ($file != "." && $file != "..")
        {
          $filePath = $exportDirectory.'/'.$file;
		      $filesize = filesize($filePath);
          $filesize = formatFileSize($filesize, 2);
		      echo '<tr>
                  <td>
        	          <a href="'.$filePath.'">'.$filePath.'</a>
                  </td>
                  <td class="TabellenSpalte_Rechts" style="text-align:right">'.$filesize.'</td>
                </tr>';
    	  }
	    }
      echo '</table>';
    }
    closedir($handle);
  }
?>