Changeset 409


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

Legend:

Unmodified
Added
Removed
  • trunk/finance/finance.php

    r408 r409  
    165165      $Cash = $Cash[0];
    166166   
    167       $DbResult2 = $this->Database->query('SELECT SUM(consumption) FROM network_devices WHERE (user='.$Member['Id'].') AND (used = 1)');
     167      $DbResult2 = $this->Database->query('SELECT SUM(Consumption) FROM Product WHERE (User='.$Member['Id'].') AND (used = 1)');
    168168      $ConsumptionPlus = $DbResult2->fetch_row();
    169169      $ConsumptionPlus = $ConsumptionPlus[0];
  • trunk/finance/index.php

    r407 r409  
    3535    $Output .= 'Počet platících klientů: <strong>'.$Row2[0].'</strong><br />';
    3636
    37     //$DbResult = $this->Database->query('SELECT SUM(price) FROM network_devices WHERE used=1');
     37    //$DbResult = $this->Database->query('SELECT SUM(Price) FROM Product WHERE Used=1');
    3838    //$Row4 = $DbResult->fetch_array();
    3939    //$Output .= 'Celková cena zařízení sítě: <strong>'.$Row4[0].' Kč</strong><br />';
     
    6060    $TotalGain = 0;
    6161    $TotalExpense = 0;
    62     $DbResult = $this->Database->query('SELECT SUM(consumption) FROM network_devices WHERE used=1');
     62    $DbResult = $this->Database->query('SELECT SUM(Consumption) FROM Product WHERE Used=1');
    6363    $Row = $DbResult->fetch_array();
    6464    $TotalConsumption = $this->System->Modules['Finance']->W2Kc($Row[0]);
  • trunk/finance/inventory.php

    r157 r409  
    1212    $Output = 'Výpis skladových zásob:<br><table class="WideTable">';
    1313    $Output .= '<tr><th>Název</th><th>Datum<br />zakoupení</th><th>Cena [Kč]</th><th>Počet</th><th>Cena<br /> dohromady [Kč]</th></tr>';
    14     $DbResult = $this->Database->query("SELECT * FROM network_devices WHERE used=2");
     14    $DbResult = $this->Database->query("SELECT * FROM Product WHERE Used=2");
    1515    while($Row = $DbResult->fetch_array())
    1616    {
    17       $Output .= '<tr><td>'.$Row['name'].'</td><td align="right">'.HumanDate($Row['date']).'</td><td align="right">'.$Row['price'].'</td><td align="right">'.$Row['count'].'</td><td align="right">'.$Row['count'] * $Row['price'].'</td></tr>';
    18       $TotalPrice = $TotalPrice + $Row['count'] * $Row['price'];
     17      $Output .= '<tr><td>'.$Row['Name'].'</td><td align="right">'.HumanDate($Row['Date']).'</td><td align="right">'.$Row['Price'].'</td><td align="right">'.$Row['Count'].'</td><td align="right">'.$Row['Count'] * $Row['Price'].'</td></tr>';
     18      $TotalPrice = $TotalPrice + $Row['Count'] * $Row['Price'];
    1919    }
    2020
  • trunk/finance/manage.php

    r408 r409  
    6969        $Output .= '<a href="clenove.php">Seznam členů</a><br />';
    7070        $Output .= '<a href="zivnost.php">Živnost</a><br />';
     71        $Output .= '<a href="inventory.php">Stav skladu</a><br />';
    7172        $Output .= '<a href="?Operation=GenerateBills">Generovat chybějící doklady</a><br />';
    7273        $Output .= '<a href="import.php">Import plateb</a><br />';
     
    294295
    295296    // Celkovy prehled
    296     $DbResult = $this->Database->query('SELECT SUM(price) FROM network_devices WHERE used = 1');
     297    $DbResult = $this->Database->query('SELECT SUM(Price) FROM Product WHERE Used = 1');
    297298    $Row = $DbResult->fetch_row();
    298299    $TotalDeviceCost = $Row[0];
     
    314315    $Output .= 'Stav pokladny: Členové('.$TotalMemberCash.')';   
    315316
    316     $DbResult = $this->Database->query('SELECT SUM(consumption) FROM network_devices WHERE used=1');
     317    $DbResult = $this->Database->query('SELECT SUM(Consumption) FROM Product WHERE Used=1');
    317318    $Row = $DbResult->fetch_row();
    318319    $TotalConsumption = $Row[0];
  • trunk/finance/spotreba.php

    r408 r409  
    1515    $CelkovaSpotreba = 0;
    1616    $DbResult = $this->Database->query("SELECT * FROM NetworkSegment");
    17     while($Row = $DbResult->fetch_array())
     17    while($Segment = $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 Product WHERE Segment=".$Segment['Id']." AND Used=1");
    2020      $Row2 = $DbResult2->fetch_array();
    2121      $CelkovaSpotreba = $CelkovaSpotreba + $Row2[0];
  • trunk/finance/user_state.php

    r294 r409  
    115115      $Output .= 'Měsíční příjem za spotřebu zařízení umístěných u uživatele:<br>';
    116116      $Output .= '<table class="WideTable"><tr><th>Název zařízení</th><th>Spotřeba [W]</th><th>Příjem [Kč]</th></tr>';
    117       $DbResult = $this->Database->query('SELECT * FROM network_devices WHERE user='.$Member['Subject'].' AND used=1');
     117      $DbResult = $this->Database->query('SELECT * FROM Product WHERE User='.$Member['Subject'].' AND Used=1');
    118118      $TotalW = 0;
    119119      $TotalPrice = 0;
    120120      while($Row = $DbResult->fetch_assoc())
    121121      {
    122         $Output .= '<tr><td>'.$Row['name'].'</td><td>'.$Row['consumption'].'</td><td>'.$this->System->Modules['Finance']->W2Kc($Row['consumption']).'</td></tr>';
    123         $TotalW += $Row['consumption'];
    124         $TotalPrice += $this->System->Modules['Finance']->W2Kc($Row['consumption']);
     122        $Output .= '<tr><td>'.$Row['Name'].'</td><td>'.$Row['Consumption'].'</td><td>'.$this->System->Modules['Finance']->W2Kc($Row['Consumption']).'</td></tr>';
     123        $TotalW += $Row['Consumption'];
     124        $TotalPrice += $this->System->Modules['Finance']->W2Kc($Row['Consumption']);
    125125      }
    126126      $Output .= '<tr><td><strong>Celkem</strong></td><td><strong>'.$TotalW.'</strong></td><td><strong>'.$TotalPrice.'</strong></td></tr>';
  • 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>';
  • trunk/finance/zivnost.php

    r397 r409  
    6464
    6565    // SmallAssets
    66     $DbResult = $this->Database->query('SELECT SUM(price) FROM network_devices WHERE (TimeEnlistment < "'.TimeToMysqlDateTime($StartTime).'") AND (TimeEnlistment != 0) AND ((TimeElimination > "'.TimeToMysqlDateTime($StartTime).'") OR (TimeElimination = 0))');
     66    $DbResult = $this->Database->query('SELECT SUM(Price) FROM Product WHERE (TimeEnlistment < "'.TimeToMysqlDateTime($StartTime).'") AND (TimeEnlistment != 0) AND ((TimeElimination > "'.TimeToMysqlDateTime($StartTime).'") OR (TimeElimination = 0))');
    6767    //$Output .= $Database->error;
    6868    $Row = $DbResult->fetch_array();
    6969    $Balance['SmallAssets']['Start'] = $Row[0] + 0;
    70     $DbResult = $this->Database->query('SELECT SUM(price) FROM network_devices WHERE (TimeEnlistment < "'.TimeToMysqlDateTime($EndTime).'") AND (TimeEnlistment != 0) AND ((TimeElimination > "'.TimeToMysqlDateTime($EndTime).'") OR (TimeElimination = 0))');
     70    $DbResult = $this->Database->query('SELECT SUM(Price) FROM Product WHERE (TimeEnlistment < "'.TimeToMysqlDateTime($EndTime).'") AND (TimeEnlistment != 0) AND ((TimeElimination > "'.TimeToMysqlDateTime($EndTime).'") OR (TimeElimination = 0))');
    7171    $Row = $DbResult->fetch_array();
    7272    $Balance['SmallAssets']['End'] = $Row[0] + 0;
     
    248248        $Output .= '<table style="font-size: smaller;" border="1" cellspacing="0" cellpadding="3">';
    249249        $Output .= '<tr><th>Název</th><th>Hodnota [Kč]</th><th>Datum zakoupení</th><th>Datum vyřezení</th></tr>';
    250         $DbResult = $this->Database->query('SELECT * FROM network_devices WHERE used != 0');
    251         while($Row = $DbResult->fetch_array())
    252         {
    253           $Output .= '<tr><td>'.$Row['name'].'</td><td>'.$Row['price'].'</td><td>'.$Row['TimeEnlistment'].'</td><td>'.$Row['TimeElimination'].'</td></tr>';
     250        $DbResult = $this->Database->query('SELECT * FROM Product WHERE Used != 0');
     251        while($Row = $DbResult->fetch_array())
     252        {
     253          $Output .= '<tr><td>'.$Row['Name'].'</td><td>'.$Row['Price'].'</td><td>'.$Row['TimeEnlistment'].'</td><td>'.$Row['TimeElimination'].'</td></tr>';
    254254        }
    255255        $Output .= '</table>';
  • trunk/form_classes.php

    r408 r409  
    114114  'NewNetworkDevice' => array(
    115115    'Title' => 'Vložit nové zařízení',
    116     'Table' => 'network_devices',
     116    'Table' => 'Product',
    117117    'Items' => array(
    118118      'name' => array('Type' => 'String', 'Caption' => 'Název', 'Default' => ''),
     
    198198  'TNetworkDevice' => array(
    199199    'Type' => 'Reference',
    200     'Table' => 'network_devices',
     200    'Table' => 'Product',
    201201    'Id' => 'id',
    202202    'Name' => 'name',
  • trunk/is/topologie-img2.php

    r224 r409  
    99
    1010// === Vytvoř stromy a ulož výsledek do databáze ===============================
    11 $DbResult = $Database->query("SELECT MAX(pos), MAX(depth) FROM hosts_topology");
     11$DbResult = $Database->query("SELECT MAX(Pos), MAX(Depth) FROM NetworkTopology");
    1212$item = $DbResult->fetch_array();
    1313$width = $item[0];
     
    3737
    3838//$DbResult = $Database->query("SELECT * FROM hosts, hosts_topology WHERE host = id AND used=1");
    39 $DbResult = $Database->query("SELECT tpl.*, tpl.host AS id, dev.name AS name, dev.online AS online, dtp.iconname AS iconname, 1 AS showonline
    40   FROM hosts_topology tpl LEFT JOIN NetworkDevice dev ON dev.id = tpl.host LEFT JOIN NetworkDeviceType dtp ON dev.type = dtp.id");
     39$DbResult = $Database->query("SELECT tpl.*, tpl.Host AS id, dev.Name AS name, dev.Online AS online, dtp.IconName AS iconname, 1 AS showonline
     40  FROM NetworkTopology tpl LEFT JOIN NetworkDevice dev ON dev.id = tpl.host LEFT JOIN NetworkDeviceType dtp ON dev.type = dtp.id");
    4141while($item = $DbResult->fetch_array())
    4242{
    4343  $id = $item['id'];
    44   $vleft = $item['pos'];
    45   $vtop = $item['depth'];
    46   $vfirst = $item['first'];
    47   $vlast = $item['last'];
     44  $vleft = $item['Pos'];
     45  $vtop = $item['Depth'];
     46  $vfirst = $item['First'];
     47  $vlast = $item['Last'];
    4848  if(($vtop > 0) || ($item['name'] == $TopHostName))
    4949  {
Note: See TracChangeset for help on using the changeset viewer.