Changeset 340


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.
Location:
trunk
Files:
8 added
3 deleted
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/aktuality/news.php

    r312 r340  
    77}
    88
    9 class News extends Module
     9class News extends OldModule
    1010{
    1111  var $Dependencies = array('User', 'Log');
  • trunk/file.php

    r237 r340  
    11<?php
    22
    3 class File extends Module
     3class File extends OldModule
    44{
    55  function __construct($Database)
  • trunk/finance/bills.php

    r297 r340  
    11<?php
    22
    3 class Bill extends Module
     3class Bill extends OldModule
    44{
    55  var $SpecificSymbol = 1; // počítačová sít
  • 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    {
  • trunk/finance/manage.php

    r330 r340  
    104104    if(array_key_exists('generate', $_GET))
    105105    {
    106       $Output .= $this->System->Modules['Bill']->CreateBill(1, array(array('Description' => 'Poplatek za připojení k síti', 'Price' => 1000, 'Quantity' => 1)), time(), time());
     106      $Output .= $this->System->Modules['Bill']->CreateBill(1, array(array('Description' => 'Poplatek za služby', 'Price' => 1000, 'Quantity' => 1)), time(), time());
    107107    } else
    108108    {
     
    352352          $BillCode = $Finance->GetNextDocumentLineNumber(6); // Faktury vydané
    353353          $BillId = $this->System->Modules['Bill']->CreateBill($Member['Subject'], array(array('Description' => 'Připojení k síti', 'Price' => $PayPerPeriod, 'Quantity' => 1)), time(), time() + 3600 * 24 * 15, $BillCode);
    354           $this->Database->insert('FinanceClaimsLiabilities', array('Value' => $PayPerPeriod, 'Subject' => $Member['Subject'], 'TimeCreation' => 'NOW()', 'TimeDue' => 'DATE_ADD(NOW(), INTERVAL 15 DAY)', 'Text' => 'Připojení k síti za období '.$TimePeriodText, 'Bill' => $BillId, 'BillCode' => $BillCode));
     354          $this->Database->insert('FinanceClaimsLiabilities', array('Value' => $PayPerPeriod, 'Subject' => $Member['Subject'], 'TimeCreation' => 'NOW()', 'TimeDue' => 'DATE_ADD(NOW(), INTERVAL 15 DAY)', 'Text' => 'Služby za období '.$TimePeriodText, 'Bill' => $BillId, 'BillCode' => $BillCode));
    355355          $Output .= $this->SendPaymentEmail($Member['Id']);
    356356          $this->Database->update('Member', 'Id='.$Member['Id'], array('BillingPeriodLastDate' => TimeToMysqlDateTime($Period['To'])));
  • trunk/global.php

    r329 r340  
    55if(file_exists($ConfigFileName)) include_once($ConfigFileName);
    66  else die('Nenalezen konfigurační soubor '.$ConfigFileName.'!');
     7 
    78include_once('database.php');
    89//include('error.php');
     
    1011include_once('module.php');
    1112include_once('forms.php');
    12 include_once('page.php');
     13include_once('Modules/page.php');
    1314include_once('file.php');
    14 include_once('log.php');
    15 include_once('user.php');
     15include_once('Modules/log.php');
    1616include_once('aktuality/news.php');
    1717include_once('webcam/webcam.php');
    1818include_once('finance/bills.php');
    1919include_once('finance/finance.php');
     20include_once('Modules/Module.php');
     21include_once('Modules/User/user.php');
     22include_once('Modules/Project/Project.php');
    2023 
    2124$PrefixMultipliers = array
     
    8891);
    8992
    90 class System extends Module
     93class System extends OldModule
    9194{
    9295  var $Modules = array();
  • trunk/module.php

    r157 r340  
    11<?php
    22
    3 class Module
     3class OldModule
    44{
    55  var $Database;
  • trunk/webcam/webcam.php

    r329 r340  
    11<?php
    22
    3 class Webcam extends Module
     3class Webcam extends OldModule
    44{
    55  var $ImageFileName = 'webcam.jpg';
Note: See TracChangeset for help on using the changeset viewer.