Changeset 32 for trunk/index.php


Ignore:
Timestamp:
Apr 7, 2020, 1:06:13 AM (5 years ago)
Author:
chronos
Message:
  • Modified: Improved code formatting.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/index.php

    r31 r32  
    1515  function Link($URL)
    1616  {
    17     return($this->Config['BaseURL'].$URL);
     17    return $this->Config['BaseURL'].$URL;
    1818  }
    1919
     
    8383      '<a href="'.$this->Link('/families/').'">Families</a> '.
    8484      '</div>';
    85     return($Output);
     85    return $Output;
    8686  }
    8787
    8888  function ProcessURL()
    8989  {
    90     if(array_key_exists('REDIRECT_QUERY_STRING', $_SERVER))
     90    if (array_key_exists('REDIRECT_QUERY_STRING', $_SERVER))
    9191      $PathString = $_SERVER['REDIRECT_QUERY_STRING'];
    9292    else $PathString = '';
    93     if(substr($PathString, -1, 1) == '/') $PathString = substr($PathString, 0, -1);
     93    if (substr($PathString, -1, 1) == '/') $PathString = substr($PathString, 0, -1);
    9494    $PathItems = explode('/', $PathString);
    95     if(array_key_exists('REQUEST_URI', $_SERVER) and (strpos($_SERVER['REQUEST_URI'], '?') !== false))
     95    if (array_key_exists('REQUEST_URI', $_SERVER) and (strpos($_SERVER['REQUEST_URI'], '?') !== false))
    9696      $_SERVER['QUERY_STRING'] = substr($_SERVER['REQUEST_URI'], strpos($_SERVER['REQUEST_URI'], '?') + 1);
    9797    else $_SERVER['QUERY_STRING'] = '';
    9898    parse_str($_SERVER['QUERY_STRING'], $_GET);
    99     return($PathItems);
     99    return $PathItems;
    100100  }
    101101
     
    368368      'ROUND((SELECT TeamStat.Money FROM TeamStat WHERE TeamStat.Team=Team.Id ORDER BY Time DESC LIMIT 1) / (SELECT COUNT(*) FROM Runner WHERE Runner.Team=Team.Id)) AS MoneyRunner',
    369369      $Where.$Order['SQL'].$PageList['SQLLimit']);
    370     while($Item = $DbResult->fetch_assoc())
     370    while ($Item = $DbResult->fetch_assoc())
    371371    {
    372372      if ($Item['Name'] == '') $Item['Name'] = $TitleItem.' '.$Item['WebId'];
     
    385385    $Output .= '</div>';
    386386
    387     return($Output);
     387    return $Output;
    388388  }
    389389
     
    453453      ', (SELECT RunnerStat.Rank FROM RunnerStat WHERE RunnerStat.Runner=Runner.Id ORDER BY Time DESC LIMIT 1) AS Rank',
    454454      $Where.$Order['SQL'].$PageList['SQLLimit']);
    455     while($Item = $DbResult->fetch_assoc())
     455    while ($Item = $DbResult->fetch_assoc())
    456456    {
    457457      $Output .= '<tr>'.
     
    471471    $Output .= $this->ShowDaily('Team', $TeamId);
    472472
    473     return($Output);
     473    return $Output;
    474474  }
    475475
     
    504504      ' FROM '.$Table.'Stat'.
    505505      ' WHERE '.$Where.$Order['SQL'].$PageList['SQLLimit']);
    506     while($Item = $DbResult->fetch_assoc())
     506    while ($Item = $DbResult->fetch_assoc())
    507507    {
    508508      $Output .= '<tr>'.
     
    556556      ' FROM ('.$DailyTableMaxId.') AS T4'.
    557557      ' WHERE '.$Where.$Order['SQL'].$PageList['SQLLimit']);
    558     while($Item = $DbResult->fetch_assoc())
     558    while ($Item = $DbResult->fetch_assoc())
    559559    {
    560560      $Output .= '<tr>'.
     
    623623      ', (SELECT RunnerStat.Rank FROM RunnerStat WHERE RunnerStat.Runner=Runner.Id ORDER BY Time DESC LIMIT 1) AS Rank',
    624624      $Where.$Order['SQL'].$PageList['SQLLimit']);
    625     while($Item = $DbResult->fetch_assoc())
     625    while ($Item = $DbResult->fetch_assoc())
    626626    {
    627627      $Output .= '<tr>'.
     
    638638    $Output .= '</div>';
    639639
    640     return($Output);
     640    return $Output;
    641641  }
    642642
     
    660660    $Output .= $this->ShowDetailed('Runner', $RunnerId);
    661661    $Output .= $this->ShowDaily('Runner', $RunnerId);
    662     return($Output);
     662    return $Output;
    663663  }
    664664
     
    733733       '<a href="https://app.zdechov.net/teribear/">Source code</a></div>';
    734734    $Output .= '</body></html>';
    735     return($Output);
     735    return $Output;
    736736  }
    737737
     
    757757      $Item = $this->PathItems[0];
    758758      if ($Item == 'sync') $Output .= $this->ShowSync();
    759       //else if($this->PathItems[0] == 'empty') $Output .= $this->ShowEmpty();
    760       else if($Item == 'runner') $Output .= $this->ShowRunner();
    761       else if($Item == 'runners') $Output .= $this->ShowRunners();
    762       else if($Item == 'team') $Output .= $this->ShowTeam();
    763       else if($Item == 'teams') $Output .= $this->ShowTeams();
    764       else if($Item == 'family') $Output .= $this->ShowFamily();
    765       else if($Item == 'families') $Output .= $this->ShowFamilies();
     759      //else if ($this->PathItems[0] == 'empty') $Output .= $this->ShowEmpty();
     760      else if ($Item == 'runner') $Output .= $this->ShowRunner();
     761      else if ($Item == 'runners') $Output .= $this->ShowRunners();
     762      else if ($Item == 'team') $Output .= $this->ShowTeam();
     763      else if ($Item == 'teams') $Output .= $this->ShowTeams();
     764      else if ($Item == 'family') $Output .= $this->ShowFamily();
     765      else if ($Item == 'families') $Output .= $this->ShowFamilies();
    766766      else $Output .= $this->ShowMain();
    767767    } else $Output .= $this->ShowMain();
Note: See TracChangeset for help on using the changeset viewer.