Changeset 152 for www/finance/zarizeni.php
- Timestamp:
- Feb 16, 2009, 2:09:57 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
www/finance/zarizeni.php
r4 r152 1 1 <?php 2 2 include_once('../global.php'); 3 include('../style.php'); 4 ShowHeader('Zařízení sítě','Zařízení'); 3 include_once('include.php'); 5 4 6 // Seznam segmentů a zařízení 7 echo('Seznam segmentů a zařízení:<br><table style="font-size: smaller;" border="1" cellspacing="0" cellpadding="3"><tr><th>Název</th><th>Spotřeba<br>[W]</th><th>Datum<br>zakoupení</th><th>Cena [Kč]</th></tr>'); 8 $DbResult = $Database->query("SELECT * FROM network_segments"); 9 while($Row = $DbResult->fetch_array()) 5 class FinanceDeviceListPage extends Page 10 6 { 11 echo('<tr><td colspan="3"><strong>Segment: '.$Row['name'].' ('.$Row['users'].')</strong></td><td style="font-weight: Bold;" align="right">'.$Row['price'].'</td></tr>'); 12 $DbResult2 = $Database->query("SELECT * FROM network_devices WHERE segment=".$Row['id']." AND used=1"); 13 while($Row = $DbResult2->fetch_array()) 7 var $FullTitle = 'Zařízení sítě'; 8 var $ShortTitle = 'Zařízení'; 9 10 function Show() 14 11 { 15 echo('<tr><td>'.$Row['name'].'</td><td align="right">'.$Row['consumption'].'</td><td align="right">'.HumanDate($Row['date']).'</td><td align="right">'.$Row['price'].'</td></tr>'); 12 // Seznam segmentů a zařízení 13 $Output = 'Seznam segmentů a zařízení:<br><table style="font-size: smaller;" border="1" cellspacing="0" cellpadding="3"><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 network_segments"); 15 while($Row = $DbResult->fetch_array()) 16 { 17 $Output .= '<tr><td colspan="3"><strong>Segment: '.$Row['name'].' ('.$Row['users'].')</strong></td><td style="font-weight: Bold;" align="right">'.$Row['price'].'</td></tr>'; 18 $DbResult2 = $this->Database->query("SELECT * FROM network_devices WHERE segment=".$Row['id']." AND used=1"); 19 while($Row = $DbResult2->fetch_array()) 20 { 21 $Output .= '<tr><td>'.$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 network_devices 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); 16 29 } 17 30 } 18 $DbResult = $Database->query("SELECT SUM(price) FROM network_devices WHERE used=1");19 $Row = $DbResult->fetch_array();20 echo('<tr><td colspan="3"><strong>Celkem:</strong></td><td align="right"><strong>'.$Row[0].'</strong></td></tr>');21 echo('</table>');22 31 23 ShowFooter(); 32 $System->AddModule(new FinanceDeviceListPage()); 33 $System->Modules['FinanceDeviceListPage']->GetOutput() 34 24 35 ?>
Note:
See TracChangeset
for help on using the changeset viewer.