Ignore:
Timestamp:
Jan 16, 2012, 9:59:18 PM (13 years ago)
Author:
chronos
Message:
  • Přidáno: Moduk pro správu projektů.
  • Některé staré moduly přesunuty do podsložky Modules.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/finance/finance.php

    r327 r340  
    11<?php
    22
    3 class Finance extends Module
     3class Finance extends OldModule
    44{
    55  var $kWh;
     
    108108    $this->BaseTariffPrice = $Row['BaseTariffPrice'];
    109109
    110     $DbResult = $this->Database->query('SELECT COUNT(*) FROM Member');
     110    $DbResult = $this->Database->query('SELECT COUNT(*) FROM `Member`');
    111111    $Row = $DbResult->fetch_row();
    112112    $this->InternetUsers = $Row[0];
    113113   
    114114    $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`');
    116116    $TotalConsumption = $DbResult->fetch_array();
    117117    $this->TotalConsumption = $TotalConsumption[0];
     
    135135    {
    136136      // Get latest year
    137       $DbResult = $this->Database->select('FinanceYear', '*', '1 ORDER BY Year DESC LIMIT 1');
     137      $DbResult = $this->Database->select('FinanceYear', '*', '1 ORDER BY `Year` DESC LIMIT 1');
    138138    } else $DbResult = $this->Database->select('FinanceYear', '*', 'Id='.$FinanceYear);
    139139    $FinanceYear = $DbResult->fetch_assoc();
    140140   
    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);
    142142    $DocumentLine = $DbResult->fetch_assoc();
    143143   
    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'].')');
    145145    $Sequence = $DbResult->fetch_assoc();
    146146   
     
    150150    } else $Result = $DocumentLine['Shortcut'].$Sequence['NextNumber'];
    151151       
    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'].')');
    153153    return($Result);
    154154  }
     
    157157  {
    158158    $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`');
    161161    while($Member = $DbResult->fetch_assoc())
    162162    {
Note: See TracChangeset for help on using the changeset viewer.