Location: PHPKode > scripts > GigKalender > admin/import.php
<?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.
*/
  $_SESSION['MenuReminderAdmin'] = $page;
  $uid = '';
  $Form = '';
  $ImportGigs = '';
  $ImportGuestbook = '';
  $ImportNews = '';
  $ImportSetup = '';
  $ImportUser = '';
  $ImportOverwriteGigs = '';
  $ImportOverwriteGuestbook = '';
  $ImportOverwriteNews = '';
  $ImportOverwriteSetup = '';
  $ImportOverwriteUser = '';
  
  foreach ($_POST as $key => $value)
  {
    if (get_magic_quotes_gpc()) $$key = stripslashes($value);
    else $$key = $value;
  }
  if ( $uid && loggedIn() ) { $FormularKorrektAusgefuellt = true; }
  if ( !loggedIn() ) { echo $L_003; }
  else
  {
    if ( !IsUserAdmin() ) { echo $L_015; }
    else
    {
      // Inhalt-Anfang
        if ($Form)
        {
          if ($Form==$L_Button23)
        	{
            $_SESSION["ImportGigs"] = $ImportGigs;
            $_SESSION["ImportGuestbook"] = $ImportGuestbook;
            $_SESSION["ImportNews"] = $ImportNews;
            $_SESSION["ImportSetup"] = $ImportSetup;
            $_SESSION["ImportUser"] = $ImportUser;
            $_SESSION["ImportOverwriteGigs"] = $ImportOverwriteGigs;
            $_SESSION["ImportOverwriteGuestbook"] = $ImportOverwriteGuestbook;
            $_SESSION["ImportOverwriteNews"] = $ImportOverwriteNews;
            $_SESSION["ImportOverwriteSetup"] = $ImportOverwriteSetup;
            $_SESSION["ImportOverwriteUser"] = $ImportOverwriteUser;
            $_SESSION["Version"] = $Version;
            include("functions/import.php");
        	}
        	if ($Form==$L_Import) { echo $L_150.'<br />'; }
        }
    	  else
        {
          if (!isset($_SESSION["ImportGigs"]) ) $_SESSION["ImportGigs"]=0;
          if (!isset($_SESSION["ImportGuestbook"]) ) $_SESSION["ImportGuestbook"]=0;
          if (!isset($_SESSION["ImportNews"]) ) $_SESSION["ImportNews"]=0;
          if (!isset($_SESSION["ImportSetup"]) ) $_SESSION["ImportSetup"]=0;
          if (!isset($_SESSION["ImportUser"]) ) $_SESSION["ImportUser"]=0;
          if (!isset($_SESSION["ImportOverwriteGigs"]) ) $_SESSION["ImportOverwriteGigs"]=1;
          if (!isset($_SESSION["ImportOverwriteGuestbook"]) ) $_SESSION["ImportOverwriteGuestbook"]=1;
          if (!isset($_SESSION["ImportOverwriteNews"]) ) $_SESSION["ImportOverwriteNews"]=1;
          if (!isset($_SESSION["ImportOverwriteSetup"]) ) $_SESSION["ImportOverwriteSetup"]=0;
          if (!isset($_SESSION["ImportOverwriteUser"]) ) $_SESSION["ImportOverwriteUser"]=1;
          if (!isset($_SESSION["Version"]) ) $_SESSION["Version"]='12';
          echo $L_205.'<br /><br />';
          $directory = 'import';
          $handle=opendir ($directory);
          $files = array();
          while ($file = readdir ($handle))
          if ($file != "." && $file != "..") { $files[] = $file; }
          sort ( $files );
          $AnzahlDateien = count($files);
          if ($AnzahlDateien == 0)
          {
            echo '<span class="ERROR">'.$L_036.'<br />( '.PATH.'import/ )</span>';
          }
          else
          { 
            echo '<form method="post" action="index.php?submenu=admin&amp;page=import">
                    <table summary="Version">
                      <tr>
                        <td>v1.2</td>
                        <td><input type="radio" class="checkbox" name="Version" value="12" '; if ($_SESSION["Version"]=="12") echo 'checked="checked"'; echo' /></td>
                      </tr>
                      <tr>
                        <td>v1.1</td>
                        <td><input type="radio" class="checkbox" name="Version" value="11" '; if ($_SESSION["Version"]=="11") echo 'checked="checked"'; echo' /></td>
                      </tr>
                      <tr>
                        <td>v08.02.25</td>
                        <td><input type="radio" class="checkbox" name="Version" value="080225" '; if ($_SESSION["Version"]=="080225") echo 'checked="checked"'; echo' /></td>
                      </tr>
                    </table>
                    <br />
                    <table summary="Import">
                      <tr>
                        <th>'.$AnzahlDateien.' '.$L_034.'</th>
                        <th>'.$L_035.'</th>
                        <th>'.$L_Import.'</th>
                        <th class="TabellenSpalte_Rechts">'.$L_Overwrite.'</th>
                      </tr>';
              $handle=opendir ($directory);
              while ($file = readdir ($handle))
              {
                if ($file != "." && $file != "..")
                {
		              $filesize =filesize('import/'.$file);
                  $filesize = ceil($filesize/1024).' KB';
                  if ($filesize >= 1024) {$filesize = round($filesize/1024,3).' MB';}
                  $ElementName = ucfirst(str_replace('.csv', '', $file));
		              echo '<tr>
                          <td><a href="import/'.$file.'">'.$file.'</a></td>
                          <td style="text-align:right;">'.$filesize.'</td>';
                          if ( $ElementName=='Gigs' OR $ElementName=='Guestbook' OR $ElementName=='News'
                            OR $ElementName=='Setup' OR $ElementName=='User')
                          {
                            echo '<td><input class="checkbox" type="checkbox" name="Import'.$ElementName.'" value="1" ';
                            if ($_SESSION["Import".$ElementName]==1) echo 'checked="checked" '; echo '/></td>';
                            echo '<td><input class="checkbox" type="checkbox" name="ImportOverwrite'.$ElementName.'" value="1" ';
                            if ($_SESSION["ImportOverwrite".$ElementName]==1) echo 'checked="checked" ';  if ($ElementName=='Setup') echo 'disabled="disabled"'; echo' /></td>';
                          }
                          else
                          {
                            echo '<td><input class="checkbox" type="checkbox" disabled="disabled" /></td>';
                            echo '<td><input class="checkbox" type="checkbox" disabled="disabled" /></td>';
                          }
                          echo '</tr>';
    	          }
              }
              echo '</table>';
              closedir($handle);
              echo '<br /><br />'.$L_148.'<br /><br />';
              echo '<fieldset><input name="Form" type="submit" value="'.$L_Button23.'" class="button" />
                      <input name="Form" type="submit" value="'.$L_Button24.'" class="button" />
                    </fieldset>
      	         </form>';
          }
        }
      // Inhalt zuende
    }
  }
?>
Return current item: GigKalender