Changeset 409
- Timestamp:
- Oct 4, 2012, 9:01:28 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 1 deleted
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/finance/finance.php
r408 r409 165 165 $Cash = $Cash[0]; 166 166 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)'); 168 168 $ConsumptionPlus = $DbResult2->fetch_row(); 169 169 $ConsumptionPlus = $ConsumptionPlus[0]; -
trunk/finance/index.php
r407 r409 35 35 $Output .= 'Počet platících klientů: <strong>'.$Row2[0].'</strong><br />'; 36 36 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'); 38 38 //$Row4 = $DbResult->fetch_array(); 39 39 //$Output .= 'Celková cena zařízení sítě: <strong>'.$Row4[0].' Kč</strong><br />'; … … 60 60 $TotalGain = 0; 61 61 $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'); 63 63 $Row = $DbResult->fetch_array(); 64 64 $TotalConsumption = $this->System->Modules['Finance']->W2Kc($Row[0]); -
trunk/finance/inventory.php
r157 r409 12 12 $Output = 'Výpis skladových zásob:<br><table class="WideTable">'; 13 13 $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"); 15 15 while($Row = $DbResult->fetch_array()) 16 16 { 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']; 19 19 } 20 20 -
trunk/finance/manage.php
r408 r409 69 69 $Output .= '<a href="clenove.php">Seznam členů</a><br />'; 70 70 $Output .= '<a href="zivnost.php">Živnost</a><br />'; 71 $Output .= '<a href="inventory.php">Stav skladu</a><br />'; 71 72 $Output .= '<a href="?Operation=GenerateBills">Generovat chybějící doklady</a><br />'; 72 73 $Output .= '<a href="import.php">Import plateb</a><br />'; … … 294 295 295 296 // 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'); 297 298 $Row = $DbResult->fetch_row(); 298 299 $TotalDeviceCost = $Row[0]; … … 314 315 $Output .= 'Stav pokladny: Členové('.$TotalMemberCash.')'; 315 316 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'); 317 318 $Row = $DbResult->fetch_row(); 318 319 $TotalConsumption = $Row[0]; -
trunk/finance/spotreba.php
r408 r409 15 15 $CelkovaSpotreba = 0; 16 16 $DbResult = $this->Database->query("SELECT * FROM NetworkSegment"); 17 while($ Row= $DbResult->fetch_array())17 while($Segment = $DbResult->fetch_array()) 18 18 { 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"); 20 20 $Row2 = $DbResult2->fetch_array(); 21 21 $CelkovaSpotreba = $CelkovaSpotreba + $Row2[0]; -
trunk/finance/user_state.php
r294 r409 115 115 $Output .= 'Měsíční příjem za spotřebu zařízení umístěných u uživatele:<br>'; 116 116 $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'); 118 118 $TotalW = 0; 119 119 $TotalPrice = 0; 120 120 while($Row = $DbResult->fetch_assoc()) 121 121 { 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']); 125 125 } 126 126 $Output .= '<tr><td><strong>Celkem</strong></td><td><strong>'.$TotalW.'</strong></td><td><strong>'.$TotalPrice.'</strong></td></tr>'; -
trunk/finance/zarizeni.php
r408 r409 12 12 $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>'; 13 13 $DbResult = $this->Database->query('SELECT * FROM NetworkSegment'); 14 while($ Row= $DbResult->fetch_array())14 while($Segment = $DbResult->fetch_array()) 15 15 { 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'); 18 18 while($Row = $DbResult2->fetch_array()) 19 19 { 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>'; 21 21 } 22 22 } 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'); 24 24 $Row = $DbResult->fetch_array(); 25 25 $Output .= '<tr><td colspan="3"><strong>Celkem:</strong></td><td align="right"><strong>'.$Row[0].'</strong></td></tr>'; -
trunk/finance/zivnost.php
r397 r409 64 64 65 65 // SmallAssets 66 $DbResult = $this->Database->query('SELECT SUM( price) FROM network_devicesWHERE (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))'); 67 67 //$Output .= $Database->error; 68 68 $Row = $DbResult->fetch_array(); 69 69 $Balance['SmallAssets']['Start'] = $Row[0] + 0; 70 $DbResult = $this->Database->query('SELECT SUM( price) FROM network_devicesWHERE (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))'); 71 71 $Row = $DbResult->fetch_array(); 72 72 $Balance['SmallAssets']['End'] = $Row[0] + 0; … … 248 248 $Output .= '<table style="font-size: smaller;" border="1" cellspacing="0" cellpadding="3">'; 249 249 $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>'; 254 254 } 255 255 $Output .= '</table>'; -
trunk/form_classes.php
r408 r409 114 114 'NewNetworkDevice' => array( 115 115 'Title' => 'Vložit nové zařízení', 116 'Table' => ' network_devices',116 'Table' => 'Product', 117 117 'Items' => array( 118 118 'name' => array('Type' => 'String', 'Caption' => 'Název', 'Default' => ''), … … 198 198 'TNetworkDevice' => array( 199 199 'Type' => 'Reference', 200 'Table' => ' network_devices',200 'Table' => 'Product', 201 201 'Id' => 'id', 202 202 'Name' => 'name', -
trunk/is/topologie-img2.php
r224 r409 9 9 10 10 // === 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"); 12 12 $item = $DbResult->fetch_array(); 13 13 $width = $item[0]; … … 37 37 38 38 //$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 showonline40 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"); 41 41 while($item = $DbResult->fetch_array()) 42 42 { 43 43 $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']; 48 48 if(($vtop > 0) || ($item['name'] == $TopHostName)) 49 49 {
Note:
See TracChangeset
for help on using the changeset viewer.