Changeset 410
- Timestamp:
- Oct 4, 2012, 10:12:08 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 1 deleted
- 3 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); -
trunk/finance/user_state.php
r409 r410 22 22 if(!$this->System->Modules['User']->CheckPermission('Finance', 'DisplaySubjectState')) return('Nemáte oprávnění'); 23 23 $UserId = $this->System->Modules['User']->User['Id']; 24 $DbResult = $this->Database->query('SELECT * FROM Subject WHERE Id=(SELECT Subject FROM Member WHERE Id=(SELECT Member FROM User WHERE Id='.$UserId.'))');24 $DbResult = $this->Database->query('SELECT * FROM Subject WHERE Id=(SELECT Subject FROM Member WHERE Id=(SELECT Customer FROM UserCustomerRel WHERE User='.$UserId.'))'); 25 25 $Subject = $DbResult->fetch_assoc(); 26 26 } -
trunk/user.php
r406 r410 52 52 if($Row['User'] != $this->AnonymousUserId) 53 53 { 54 $Query = $this->Database-> select('User', '*', 'Id='.$Row['User']);54 $Query = $this->Database->query('SELECT *, UserCustomerRel.Customer AS Member FROM User JOIN UserCustomerRel ON UserCustomerRel.User=User.Id WHERE User.Id='.$Row['User']); 55 55 $this->User = $Query->fetch_assoc(); 56 56 $Result = USER_LOGGED;
Note:
See TracChangeset
for help on using the changeset viewer.