source: trunk/finance/zarizeni.php@ 438

Last change on this file since 438 was 438, checked in by chronos, 13 years ago
  • Přesunuto: Soubory s třídamy přesunuty do podsložky Common. Aktualizovány odkazy mezi soubory.
  • Property svn:executable set to *
File size: 1.6 KB
Line 
1<?php
2
3include_once('../Common/Global.php');
4
5class FinanceDeviceListPage extends Page
6{
7 var $FullTitle = 'Zařízení sítě';
8 var $ShortTitle = 'Zařízení';
9
10 function Show()
11 {
12 // Seznam segmentů a zařízení
13 $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>';
14 $DbResult = $this->Database->query('SELECT * FROM NetworkSegment');
15 while($Segment = $DbResult->fetch_array())
16 {
17 $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>';
18 $DbResult2 = $this->Database->query('SELECT * FROM Product WHERE Segment='.$Segment['Id'].' AND used=1');
19 while($Row = $DbResult2->fetch_array())
20 {
21 $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>';
22 }
23 }
24 $DbResult = $this->Database->query('SELECT SUM(Price) FROM Product WHERE Used=1');
25 $Row = $DbResult->fetch_array();
26 $Output .= '<tr><td colspan="3"><strong>Celkem:</strong></td><td align="right"><strong>'.$Row[0].'</strong></td></tr>';
27 $Output .= '</table>';
28 return($Output);
29 }
30}
31
32$System->AddModule(new FinanceDeviceListPage());
33$System->Modules['FinanceDeviceListPage']->GetOutput()
34
35?>
Note: See TracBrowser for help on using the repository browser.