Changeset 410 for trunk/finance/finance.php
- Timestamp:
- Oct 4, 2012, 10:12:08 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/finance/finance.php
r409 r410 172 172 $Consumption = 0; 173 173 $ID = $Member['NetworkSegment']; 174 while($ID != ' NULL')174 while($ID != '') 175 175 { 176 176 $DbResult2 = $this->Database->query('SELECT * FROM `NetworkSegment` WHERE `Id`='.$ID); … … 213 213 $Output = 'Aktualizuji parametry segmentů...<br />'; 214 214 $this->Database->query('UPDATE `NetworkSegment` SET `Users` = 0, `UsersOverheads` = 0'); // Vynulovat počty uživatelů 215 $DbResult = $this->Database->query('SELECT * FROM `NetworkSegment s`');215 $DbResult = $this->Database->query('SELECT * FROM `NetworkSegment`'); 216 216 while($NetworkSegment = $DbResult->fetch_array()) 217 217 { … … 222 222 $RowP2 = $DbResult2->fetch_array(); 223 223 224 $DbResult2 = $this->Database->query('SELECT SUM(Price) AS Price, SUM(Consumption) AS Consumption FROM NetworkDeviceWHERE Segment='.$NetworkSegment['Id'].' AND Used=1');224 $DbResult2 = $this->Database->query('SELECT SUM(Price) AS Price, SUM(Consumption) AS Consumption FROM Product WHERE Segment='.$NetworkSegment['Id'].' AND Used=1'); 225 225 $Row2 = $DbResult2->fetch_array(); 226 $DbResult2 = $this->Database->query('SELECT COUNT(*) FROM Member WHERE NetworkSegment='.$NetworkSegment[' id']);226 $DbResult2 = $this->Database->query('SELECT COUNT(*) FROM Member WHERE NetworkSegment='.$NetworkSegment['Id']); 227 227 $Row3 = $DbResult2->fetch_array(); 228 $ID = $NetworkSegment[' parent'];228 $ID = $NetworkSegment['Parent']; 229 229 while($ID != 0) 230 230 { … … 241 241 $DbResult = $this->Database->select('Member', 'COUNT(*)'); 242 242 $Row = $DbResult->fetch_array(); 243 $DbResult = $this->Database->update('NetworkSegment s', 'Id='.$this->InternetSegmentId, array('Users' => $Row[0], 'UsersOverheads' => $Row[0]));243 $DbResult = $this->Database->update('NetworkSegment', 'Id='.$this->InternetSegmentId, array('Users' => $Row[0], 'UsersOverheads' => $Row[0])); 244 244 $this->System->Modules['Log']->NewRecord('Finance', 'RecalculateSegmentParameters'); 245 245 return($Output);
Note:
See TracChangeset
for help on using the changeset viewer.