Changeset 340 for trunk/finance/finance.php
- Timestamp:
- Jan 16, 2012, 9:59:18 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/finance/finance.php
r327 r340 1 1 <?php 2 2 3 class Finance extends Module3 class Finance extends OldModule 4 4 { 5 5 var $kWh; … … 108 108 $this->BaseTariffPrice = $Row['BaseTariffPrice']; 109 109 110 $DbResult = $this->Database->query('SELECT COUNT(*) FROM Member');110 $DbResult = $this->Database->query('SELECT COUNT(*) FROM `Member`'); 111 111 $Row = $DbResult->fetch_row(); 112 112 $this->InternetUsers = $Row[0]; 113 113 114 114 $this->SpravaUsers = $this->InternetUsers; 115 $DbResult = $this->Database->query('SELECT SUM( consumption) FROM network_segments');115 $DbResult = $this->Database->query('SELECT SUM(`consumption`) FROM `network_segments`'); 116 116 $TotalConsumption = $DbResult->fetch_array(); 117 117 $this->TotalConsumption = $TotalConsumption[0]; … … 135 135 { 136 136 // Get latest year 137 $DbResult = $this->Database->select('FinanceYear', '*', '1 ORDER BY YearDESC LIMIT 1');137 $DbResult = $this->Database->select('FinanceYear', '*', '1 ORDER BY `Year` DESC LIMIT 1'); 138 138 } else $DbResult = $this->Database->select('FinanceYear', '*', 'Id='.$FinanceYear); 139 139 $FinanceYear = $DbResult->fetch_assoc(); 140 140 141 $DbResult = $this->Database->query('SELECT Shortcut, Id FROM DocumentLine WHERE Id='.$Id);141 $DbResult = $this->Database->query('SELECT `Shortcut`, `Id` FROM `DocumentLine` WHERE `Id`='.$Id); 142 142 $DocumentLine = $DbResult->fetch_assoc(); 143 143 144 $DbResult = $this->Database->query('SELECT * FROM DocumentLineSequence WHERE DocumentLine='.$Id.' AND FinanceYear='.$FinanceYear['Id']);144 $DbResult = $this->Database->query('SELECT * FROM `DocumentLineSequence` WHERE (`DocumentLine`='.$Id.') AND (`FinanceYear`='.$FinanceYear['Id'].')'); 145 145 $Sequence = $DbResult->fetch_assoc(); 146 146 … … 150 150 } else $Result = $DocumentLine['Shortcut'].$Sequence['NextNumber']; 151 151 152 $this->Database->query('UPDATE DocumentLineSequence SET NextNumber = NextNumber + 1 WHERE DocumentLine='.$Id.' AND FinanceYear='.$FinanceYear['Id']);152 $this->Database->query('UPDATE `DocumentLineSequence` SET `NextNumber` = `NextNumber` + 1 WHERE (`DocumentLine`='.$Id.') AND (`FinanceYear`='.$FinanceYear['Id'].')'); 153 153 return($Result); 154 154 } … … 157 157 { 158 158 $Output = 'Aktualizuji finance členů...<br />'; 159 $this->Database->query('TRUNCATE TABLE MemberPayment');160 $DbResult = $this->Database->query('SELECT * FROM Member');159 $this->Database->query('TRUNCATE TABLE `MemberPayment`'); 160 $DbResult = $this->Database->query('SELECT * FROM `Member`'); 161 161 while($Member = $DbResult->fetch_assoc()) 162 162 {
Note:
See TracChangeset
for help on using the changeset viewer.