<?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['MenuReminderCalendar'] = $page;
  $xUserRightAddOrganizer = 1;
  $xUserRightEditOrganizer = 1;
  $xUserRightDeleteOrganizer = 1;

  if ( AmountOfOrganizersInDatabase()=='0' )
  {
    echo '<div id="PageMenu">';
    include('calendar/includes/buttonAddOrganizer.php');
    echo '</div>';
    echo '<br />'.$L_221.'<br /><br />';
  }
  else
  {
    // Sessioin-Variable 'Anzahl' definieren
      if ( isset($_POST['Anzahl']) ) { $_SESSION["Anzahl"] = $_POST['Anzahl']; $_SESSION['CurrentPageShowAllOrganizers']=1; }
      if ( !isset($_SESSION["Anzahl"]) ) { $_SESSION["Anzahl"] = "25"; }
      $EintraegeProSeite = $_SESSION["Anzahl"];

    $AnzahlEintraege = AmountOfOrganizersInDatabase();
    if ( $EintraegeProSeite!='all' ) { $AnzahlSeiten = ceil($AnzahlEintraege/$EintraegeProSeite); }
      else { $AnzahlSeiten = '0'; }
    if (isset($_REQUEST['page'])) { $_SESSION['CurrentPageShowAllOrganizers'] = $_REQUEST['page']; }
    if ( !isset($_SESSION['CurrentPageShowAllOrganizers']) ) { $_SESSION['CurrentPageShowAllOrganizers'] = "1"; }
    $aktuelleSeite = $_SESSION['CurrentPageShowAllOrganizers'];
    $obersterEintrag  = $EintraegeProSeite*($aktuelleSeite-1);

    // Ansichts-Parameter
      echo '<div id="PageMenu">
              <form method="post" action="index.php?submenu=calendar&amp;page=backend_showAllOrganizers" accept-charset="UTF-8">
                <fieldset>
                  <input type="hidden" name="thread[threadid]" value="$thread[threadid]" />
                  <select name="Anzahl" onchange="this.form.submit()">
                    <option value="all"'; if ($EintraegeProSeite=="all") echo ' selected="selected"'; echo'>'.$L_All.'</option>';
                    for ($i=1; $i<=100; $i++)
                    {
                      echo '<option value="'.$i.'"'; if ($EintraegeProSeite==$i) echo ' selected="selected"'; echo'>'.$i.'</option>';
                    }

                  echo '</select>
                  </fieldset>
                </form>';
        include('calendar/includes/buttonAddOrganizer.php');
        //echo NewsBackendNavigation();
        echo '</div>';

      // Datensatz-Ausgabe festlegen
        $sql = "SELECT * FROM ".DB_PREFIX."organizers order by OrganizerName ASC";
        $sql = $sql." LIMIT ".$obersterEintrag.", ";
        if ( $EintraegeProSeite=='all') { $sql = $sql.$AnzahlEintraege; }
        else { $sql = $sql.$EintraegeProSeite; }
        $resultat = mysql_query($sql);

      echo '<table id="WideTable" summary="Table_ShowAllOrganizers">';
      // Spalten definieren
            echo '<colgroup>';
            if ( $xUserRightDeleteOrganizer ) { echo'<col class="SpalteIcon" />'; }
            if ( $xUserRightEditOrganizer ) { echo'<col class="SpalteIcon" />'; }
            if ( !$xUserRightDeleteOrganizer AND !$xUserRightEditOrganizer )  { echo'<col class="SpalteIcon" />'; }
            echo '<col />';
            echo '<col />';
            echo '<col />';
            echo '<col class="TabellenSpalte_Rechts" />';
            echo '</colgroup>';
      echo '<tr id="TableColumnHead">';
          if ( $xUserRightDeleteOrganizer ) { echo'<th>&nbsp;</th>'; }
          if ( $xUserRightEditOrganizer ) { echo'<th>&nbsp;</th>'; }
          if ( !$xUserRightDeleteOrganizer AND !$xUserRightEditOrganizer )  { echo'<th>&nbsp;</th>'; }
          echo '<th>'.$L_OrganizerName.'</th>
                <th class="TabellenSpalte_Rechts">'.$L_OrganizerURL.'</th>
              </tr>';
          while ($row = mysql_fetch_array($resultat))
          {
            extract($row);
            echo '<tr>';
            if ( $xUserRightDeleteOrganizer )
            {
              echo '<td>
                      <a href="index.php?submenu=calendar&amp;page=backend_delOrganizer&amp;id='.$OrganizerID.'">
                        <img src="images/delete.gif" alt="'.$L_009.'" title="'.$L_009.'" /></a>
                    </td>';
            }
            if ( $xUserRightEditOrganizer )
            {
              echo '<td>
                      <a href="index.php?submenu=calendar&amp;page=backend_addOrganizer&amp;job=edit&amp;id='.$OrganizerID.'">
                        <img src="images/edit.png" alt="'.$L_010.'" title="'.$L_010.'" /></a>
                    </td>';
            }
            if ( !$xUserRightDeleteOrganizer AND !$xUserRightEditOrganizer )
            {
              echo '<td>
                      <a href="index.php?submenu=calendar&amp;page=backend_showOrganizer&amp;id='.$OrganizerID.'">
                        <img src="images/show.png" alt="'.$L_153.'" title="'.$L_153.'" /></a>
                    </td>';
            }
            // Datum
            //echo '<td>'.$DateString.' ('.$AddedFrom.')</td>';
            // OrganizerName
                echo '<td>'.$OrganizerName.'</td>';
            // OrganizerURL
                echo '<td>'.$OrganizerURL.'</td>';
            // Letzte Bearbeitung
              //echo '<td>'.$DateOfLastEditString;
                    //if ($LastEditor) echo ' (';
                    //echo $LastEditor;
                    //if ($LastEditor) echo ')';
                    //echo '</td>';
            echo '</tr>';
          }
          echo '</table>';
    }
?>