Ignore:
Timestamp:
Oct 4, 2012, 8:29:32 AM (12 years ago)
Author:
chronos
Message:
  • Upraveno: Přejmenována sql tabulka network_segments na NetworkSegment.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/finance/spotreba.php

    r167 r408  
    1414    $Output = 'Spotřeba zařízení jednotlivých segmentů:<div align="center"><table class="WideTable"><tr><th>Jméno segmentu</th><th>Spotřeba [W]</th><th>Cena [Kč/měsíc]</th></tr>';
    1515    $CelkovaSpotreba = 0;
    16     $DbResult = $this->Database->query("SELECT * FROM network_segments");
     16    $DbResult = $this->Database->query("SELECT * FROM NetworkSegment");
    1717    while($Row = $DbResult->fetch_array())
    1818    {
    19       $DbResult2 = $this->Database->query("SELECT SUM(consumption) FROM network_devices WHERE segment=".$Row['id']." AND used=1");
     19      $DbResult2 = $this->Database->query("SELECT SUM(consumption) FROM network_devices WHERE Segment=".$Row['Id']." AND Used=1");
    2020      $Row2 = $DbResult2->fetch_array();
    2121      $CelkovaSpotreba = $CelkovaSpotreba + $Row2[0];
    22       $Output .= '<tr><td>'.$Row['name'].'</td><td align="right">'.$Row2[0].'</td><td align="right">'.$this->System->Modules['Finance']->W2Kc($Row2[0]).'</td></tr>';
     22      $Output .= '<tr><td>'.$Row['Name'].'</td><td align="right">'.$Row2[0].'</td><td align="right">'.$this->System->Modules['Finance']->W2Kc($Row2[0]).'</td></tr>';
    2323    }
    2424    $Output .= '<tr style="font-weight: Bold;"><td><strong>Celkem</strong></td><td align="right">'.$CelkovaSpotreba.'</td><td align="right">'.$this->System->Modules['Finance']->W2Kc($CelkovaSpotreba).'</td></tr>';
Note: See TracChangeset for help on using the changeset viewer.