Changeset 419 for trunk/finance/finance.php
- Timestamp:
- Oct 8, 2012, 11:17:43 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/finance/finance.php
r410 r419 48 48 foreach($this->Tariffs as $Index => $Tariff) 49 49 { 50 $DbResult = $this->Database->select('Member', 'COUNT(*)', ' InternetTariffCurrentMonth='.$Index.' AND (BillingPeriod > 1)');50 $DbResult = $this->Database->select('Member', 'COUNT(*)', '(InternetTariffCurrentMonth='.$Index.') AND (BillingPeriod > 1) AND (Blocked=0)'); 51 51 $Row = $DbResult->fetch_row(); 52 52 $this->Tariffs[$Index]['MemberCount'] = $Row[0]; … … 111 111 $Row = $DbResult->fetch_row(); 112 112 $this->InternetUsers = $Row[0]; 113 114 $this->SpravaUsers = $this->InternetUsers; 113 $DbResult = $this->Database->query('SELECT COUNT(*) FROM Member WHERE (Blocked=0) AND (BillingPeriod > 1)'); 114 $Row = $DbResult->fetch_row(); 115 $this->PayingUsers = $Row[0]; 116 117 $this->SpravaUsers = $this->PayingUsers; 118 115 119 $DbResult = $this->Database->query('SELECT SUM(Consumption) FROM NetworkSegment'); 116 120 $TotalConsumption = $DbResult->fetch_array(); 117 121 $this->TotalConsumption = $TotalConsumption[0]; 118 122 119 $DbResult = $this->Database->query('SELECT SUM(`MonthlyInternet`) AS `MonthlyInternet`, SUM(`MonthlyTotal`) AS `MonthlyTotal` FROM MemberPayment'); 123 $DbResult = $this->Database->query('SELECT SUM(`MemberPayment`.`MonthlyInternet`) AS `MonthlyInternet`, SUM(`MemberPayment`.`MonthlyTotal`) AS `MonthlyTotal` '. 124 'FROM MemberPayment JOIN Member ON Member.Id=MemberPayment.Member WHERE Member.Blocked=0'); 120 125 $Row = $DbResult->fetch_assoc(); 121 126 $this->TotalInternetPaid = $Row['MonthlyInternet'];
Note:
See TracChangeset
for help on using the changeset viewer.