Changeset 30 for trunk


Ignore:
Timestamp:
Sep 21, 2019, 8:37:41 PM (5 years ago)
Author:
chronos
Message:
  • Added: Show previous for families.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/index.php

    r29 r30  
    387387    if (!is_numeric($TeamId)) die('FamilyId needs to be numeric');
    388388
    389     $DbResult = $this->Database->query('SELECT * FROM Team WHERE Id='.$TeamId.' AND IsFamily=1');
     389    $DbResult = $this->Database->query('SELECT Team.*, '.
     390      '(SELECT COUNT(*) FROM Runner WHERE Runner.Team=Team.Id) AS RunnerCount, '.
     391      '(SELECT TeamStat.Distance FROM TeamStat WHERE TeamStat.Team=Team.Id ORDER BY TeamStat.Time DESC LIMIT 1) AS Distance, '.
     392      '(SELECT TeamStat.Money FROM TeamStat WHERE TeamStat.Team=Team.Id ORDER BY Time DESC LIMIT 1) AS Money, '.
     393      '(SELECT TeamStat.Rank FROM TeamStat WHERE TeamStat.Team=Team.Id ORDER BY Time DESC LIMIT 1) AS Rank '.
     394      'FROM Team WHERE Id='.$TeamId.' AND IsFamily=1');
    390395    $DbRow = $DbResult->fetch_assoc();
    391396    $Output .= '<div class="page-title">Family '.$DbRow['Name'].'</div>';
     397    $Output .= '<div class="section-title">'.$this->ItemsYearList('/family/', $RunnerId, 'Team', 'Name="'.$DbRow['Name'].'"').'</div>';
     398    $Output .= '<div class="section-title">Runners: '.$DbRow['RunnerCount'].', Distance: '.$DbRow['Distance'].' km, Money: '.$DbRow['Money'].' Kč, Rank: '.$DbRow['Rank'].'</div>';
    392399
    393400    $Where = 'Team='.$TeamId;
Note: See TracChangeset for help on using the changeset viewer.