Ignore:
Timestamp:
Oct 4, 2012, 9:01:28 AM (12 years ago)
Author:
chronos
Message:
  • Upraveno: Přejmenovaná tabulka network_device a hosts_topology.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/finance/zarizeni.php

    r408 r409  
    1212    $Output = 'Seznam segmentů a zařízení:<br><table style="font-size: smaller;" class="WideTable"><tr><th>Název</th><th>Spotřeba<br>[W]</th><th>Datum<br>zakoupení</th><th>Cena [Kč]</th></tr>';
    1313    $DbResult = $this->Database->query('SELECT * FROM NetworkSegment');   
    14     while($Row = $DbResult->fetch_array())
     14    while($Segment = $DbResult->fetch_array())
    1515    {
    16       $Output .= '<tr><td style="text-align: left" colspan="3"><strong>Segment: '.$Row['Name'].' ('.$Row['Users'].')</strong></td><td style="font-weight: Bold;" align="right">'.$Row['Price'].'</td></tr>';
    17       $DbResult2 = $this->Database->query('SELECT * FROM network_devices WHERE segment='.$Row['Id'].' AND used=1');
     16      $Output .= '<tr><td style="text-align: left" colspan="3"><strong>Segment: '.$Segment['Name'].' ('.$Segment['Users'].')</strong></td><td style="font-weight: Bold;" align="right">'.$Segment['Price'].'</td></tr>';
     17      $DbResult2 = $this->Database->query('SELECT * FROM Product WHERE Segment='.$Segment['Id'].' AND used=1');
    1818      while($Row = $DbResult2->fetch_array())
    1919      {
    20         $Output .= '<tr><td style="text-align: left; padding-left: 20px;">'.$Row['Name'].'</td><td align="right">'.$Row['consumption'].'</td><td align="right">'.HumanDate($Row['Date']).'</td><td align="right">'.$Row['Price'].'</td></tr>';
     20        $Output .= '<tr><td style="text-align: left; padding-left: 20px;">'.$Row['Name'].'</td><td align="right">'.$Row['Consumption'].'</td><td align="right">'.HumanDate($Row['Date']).'</td><td align="right">'.$Row['Price'].'</td></tr>';
    2121      }
    2222    }
    23     $DbResult = $this->Database->query('SELECT SUM(price) FROM network_devices WHERE used=1');
     23    $DbResult = $this->Database->query('SELECT SUM(Price) FROM Product WHERE Used=1');
    2424    $Row = $DbResult->fetch_array();
    2525    $Output .= '<tr><td colspan="3"><strong>Celkem:</strong></td><td align="right"><strong>'.$Row[0].'</strong></td></tr>';
Note: See TracChangeset for help on using the changeset viewer.