Ignore:
Timestamp:
Feb 16, 2009, 2:09:57 PM (15 years ago)
Author:
george
Message:
  • Upraveno: Další soubory přepracované do nového systému zobrazování.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • www/finance/zarizeni.php

    r4 r152  
    11<?php
    22include_once('../global.php');
    3 include('../style.php');
    4 ShowHeader('Zařízení sítě','Zařízení');
     3include_once('include.php');
    54
    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())
     5class FinanceDeviceListPage extends Page
    106{
    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()
    1411  {
    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);
    1629  }
    1730}
    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>');
    2231
    23 ShowFooter();
     32$System->AddModule(new FinanceDeviceListPage());
     33$System->Modules['FinanceDeviceListPage']->GetOutput()
     34
    2435?>
Note: See TracChangeset for help on using the changeset viewer.