<div class="module">Teilnehmer-Upload</div><br>
<?
  if (!isset($state)) {
    $state = '';
  }
  if ($state == 'sent')
  {
      if ($_FILES['excelfile']['name'])
      {
          $excelimport = new excelimport();
          $file =$_FILES['excelfile']['tmp_name'];
          if (stat($file) != false) {
              $messages = $excelimport->importfile($file);
              unlink($file);
          } else {
            $message = "Dateiupload fehlgeschlagen";
            $state = '';
          }
      } else {
          $state = '';
      }
  }


  if (! $state) {
?>

  <form name="upload" action="<?=$REQUEST_URI?>" method="POST" enctype="multipart/form-data">
      <input type="hidden" name="state" value="sent" />
      <fieldset class="fieldset"><legend>Dateiauswahl</legend>
      <table border="0">
        <tr>
          <td>Datei:</td>
          <td><input name="excelfile" type="file" /></td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td><input type="submit" value="Senden"></td>
      </table>
      </fieldset>
    </form>
<?
  }
?>

