Changeset 4 for www/finance/include.php


Ignore:
Timestamp:
Jan 14, 2008, 9:48:39 PM (17 years ago)
Author:
george
Message:

Upraveno: Změna přístupu k databázi na třídu rozšířenou mysqli.
Upraveno: Sjednocení
Upraveno: Změna kódování všech stránek na UTF-8.
Odstraňeno: Staré nepotřebné soubory.

Location:
www
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • www

    • Property svn:ignore set to
      config.php
      php_script_error.log
  • www/finance/include.php

    r1 r4  
    1 <?
     1<?php
    22NactiMesicniParametry();
    33
    44function RecalculateTariffs($Period = 1)
    55{
    6   global $Tarify, $MaxSpeed, $Internet, $SpeedElement;
     6  global $Tarify, $MaxSpeed, $Internet, $SpeedElement, $Database;
    77   
    88  $Tarify = array();
    9   DB_Select('finance_tariffs', '*', 'period='.$Period.' ORDER BY speed_factor');
    10   while($Tariff = DB_Row())
     9  $DbResult = $Database->select('finance_tariffs', '*', 'period='.$Period.' ORDER BY speed_factor');
     10  while($Tariff = $DbResult->fetch_array())
    1111  {
    1212    $Tarify[$Tariff['id']] = $Tariff;
     
    2020  foreach($Tarify as $Index => $Tarif)
    2121  {
    22     DB_Select('users', 'COUNT(*)', 'inet_tarif_'.$Column.'='.$Index.' AND inet=1 AND role=0');
    23     $Row = DB_Row();
     22    $DbResult = $Database->select('users', 'COUNT(*)', 'inet_tarif_'.$Column.'='.$Index.' AND inet=1 AND role=0');
     23    $Row = $DbResult->fetch_array();
    2424    $Tarify[$Index]['user_count'] = $Row[0];   
    2525    $TotalUserCount = $TotalUserCount + $Tarify[$Index]['user_count'];
     
    4949{
    5050  global $kWh, $Internet, $Sprava, $DatumOdecteni, $InternetUsers, $SpravaUsers, $InternetSegmentId,
    51     $MaxSpeed, $RealMaxSpeed, $SpeedReserve;
     51    $MaxSpeed, $RealMaxSpeed, $SpeedReserve, $Database;
    5252   
    53   DB_Query("SELECT * FROM finance_charge WHERE period=".$Period);
    54   $Row = DB_Row();
     53  $DbResult = $Database->query("SELECT * FROM finance_charge WHERE period=".$Period);
     54  $Row = $DbResult->fetch_array();
    5555  $kWh = $Row['kWh'];
    5656  $Internet = $Row['internet'];
     
    6060  $MaxSpeed = $RealMaxSpeed - $SpeedReserve;
    6161
    62   DB_Query("SELECT COUNT(*) FROM users WHERE inet=1 AND role=0");
    63   $Row = DB_Row();
     62  $DbResult = $Database->query("SELECT COUNT(*) FROM users WHERE inet=1 AND role=0");
     63  $Row = $DbResult->fetch_array();
    6464  $InternetUsers = $Row[0];
    6565
    66   DB_Query("SELECT COUNT(*) FROM users WHERE overheads=1 AND role=0");
    67   $SpravaUsers = DB_Row();
     66  $DbResult = $Database->query("SELECT COUNT(*) FROM users WHERE overheads=1 AND role=0");
     67  $SpravaUsers = $DbResult->fetch_array();
    6868  $SpravaUsers = $SpravaUsers[0];
    6969  $InternetSegmentId = 21;
Note: See TracChangeset for help on using the changeset viewer.