Changeset 163 for www/finance/finance.php
- Timestamp:
- Feb 20, 2009, 9:53:27 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
www/finance/finance.php
r157 r163 34 34 } 35 35 36 if($Period == 0) $Column = ' now'; else $Column = 'next';36 if($Period == 0) $Column = 'Current'; else $Column = 'Next'; 37 37 $TotalUserCount = 0; 38 38 $TotalUnits = 0; … … 41 41 foreach($Tarify as $Index => $Tarif) 42 42 { 43 $DbResult = $this->Database->select(' users', 'COUNT(*)', 'inet_tarif_'.$Column.'='.$Index.' AND inet=1 AND role=2');44 $Row = $DbResult->fetch_ array();43 $DbResult = $this->Database->select('Member', 'COUNT(*)', 'InternetTariff'.$Column.'Month='.$Index); 44 $Row = $DbResult->fetch_row(); 45 45 $Tarify[$Index]['user_count'] = $Row[0]; 46 46 switch($Tarif['group_id']) … … 108 108 $this->BaseTariffPrice = $Row['BaseTariffPrice']; 109 109 110 $DbResult = $this->Database->query( "SELECT COUNT(*) FROM users WHERE inet=1 AND role=2");111 $Row = $DbResult->fetch_ array();110 $DbResult = $this->Database->query('SELECT COUNT(*) FROM Member'); 111 $Row = $DbResult->fetch_row(); 112 112 $this->InternetUsers = $Row[0]; 113 114 $DbResult = $this->Database->query("SELECT COUNT(*) FROM users WHERE overheads=1 AND role=2"); 115 $SpravaUsers = $DbResult->fetch_array(); 116 $this->SpravaUsers = $SpravaUsers[0]; 113 114 $this->SpravaUsers = $this->InternetUsers; 117 115 $DbResult = $this->Database->query("SELECT SUM(consumption) FROM network_segments"); 118 116 $TotalConsumption = $DbResult->fetch_array(); 119 117 $this->TotalConsumption = $TotalConsumption[0]; 120 118 121 $DbResult = $this->Database->query( "SELECT SUM(`monthly`) as `internet`, SUM(`monthly` - `plus`) as `real` FROM users WHERE role=2");122 $Row = $DbResult->fetch_a rray();123 $this->TotalInternetPaid = $Row[' internet'];124 $this->TotalPaid = $Row[' real'];119 $DbResult = $this->Database->query('SELECT SUM(`MonthlyInternet`) AS `MonthlyInternet`, SUM(`MonthlyTotal`) AS `MonthlyTotal` FROM MemberPayment'); 120 $Row = $DbResult->fetch_assoc(); 121 $this->TotalInternetPaid = $Row['MonthlyInternet']; 122 $this->TotalPaid = $Row['MonthlyTotal']; 125 123 126 124 $this->RecalculateTariffs($Period);
Note:
See TracChangeset
for help on using the changeset viewer.