<?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.
*/
  $SQL = "SELECT * FROM ".DB_PREFIX."gigs WHERE GigID = '".$GigID."' OR GigDate='".$Timestamp."' AND (GigStatus = 'Gig'";
  if ( getSetup('SetupFrontendAllowOptionalGigs') ) $SQL .= " OR GigStatus = 'Option'";
  $SQL .= ")";
  if ( !getSetup('SetupFrontendAllowPrivateGigs') ) $SQL .= " AND GigIsPrivate = 0";
  $SQL .= " AND GigPublish = 1";

  $resultat = mysql_query($SQL);
  echo '<div id="CalendarShowGigDetails">
            <table summary="Table_ShowGigs">';
  $DateWasShown = FALSE;
  while ($row = mysql_fetch_array($resultat))
  {
    extract($row);
    
    // GigDate
      if (!$DateWasShown)
      {
        echo '<tr><th>'.$L_GigDate.': </th><th>';
        include ($Path.'calendar/includes/frontend/GigDate.php');
        echo '</th></tr>';
        echo '<tr><td>&nbsp;</td><td>&nbsp;</td></tr>';
        $DateWasShown = TRUE;
      }
    // Spalten definieren
      $Attributes = getSetup ('SetupFrontendDetailAttributes');
      if ( $Attributes!="" ) $Attributes = explode (', ',$Attributes);
      else $Attributes = array();
      $FrontendType = 'details';
      $amountAttributes = count($Attributes);
      for ($i=0; $i<$amountAttributes; $i++)
      {
        // temporärer Hack
        if ( $Attributes[$i]=='GigLocation' )
        {
          $GigLocation='x';
        }
        // temporärer Hack
        if ( $GigDateOfLastEdit==0 )
        {
          $GigDateOfLastEdit='';
        }
          if ( $SetupFrontendCalendarGigDetailsShowEmptyAttributes OR $$Attributes[$i]!='' )
          {
            echo '<tr><td style="white-space: nowrap;">'.${"L_$Attributes[$i]"}.': </td><td>';
            include ($Path.'calendar/includes/frontend/'.$Attributes[$i].'.php');
            echo '</td></tr>';
          }
      }
  }
  echo '</table><input type="button" value="'.$L_Button04.'" onclick="history.go(-1)" class="button submitButton" />
  </div>';
?>