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

  $resultat = mysqli_query($db, $SQL_Befehl);
  echo '<div id="CalendarShowGigDetails">';
  echo '<table summary="Table_ShowGigs">';
  $DateWasShown = FALSE;
  while ($row = mysqli_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>';
        $DateWasShown = TRUE;
      }
    // Spalten definieren
      $Attributes = getSetup ('SetupFrontendDetailAttributes');
      if ( $Attributes!="" ) $Attributes = explode (', ',$Attributes);
        else $Attributes = array();
      $FrontendType = 'details';
      $countAttributes = count($Attributes);
      for ($i=0; $i<$countAttributes; $i++)
      {
        // check on potential empty string for GigLocation
        if ($Attributes[$i]=='GigLocation') {
          if ($GigCountry=="" && $GigDistrict=="" && $GigPostalCode=="" && $GigCity=="")
            $GigLocation='';
          else
            $GigLocation='---'; }
        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>';
        }
        //if ($i==($countAttributes-1)) echo '<tr><td>&nbsp;</td><td>&nbsp;</td></tr>';
      }
  }
  echo '</table><input type="button" value="'.$L_Button04.'" onclick="history.go(-1)" class="button submitButton" />
  </div>';
?>