Ignore:
Timestamp:
May 1, 2009, 12:13:50 PM (15 years ago)
Author:
george
Message:
  • Upraveno: Tabulka finance_tariffs přejmenována na FinanceTariff a přepracována její struktura podle aktuálních potřeb. Do tabulky uloženy průběžné výpočty jako sloupec MemberCount či dynamicky přepočítavaný sloupce SpeedMin. Zrušeno přepočítávání ceny a rychlosti dle cenových jednotek a rychlostních jednotek.
  • Přidáno: Sloupec Hire v tabulce Member sloužící pro záznam placení nájmu členům.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/finance/tarify.php

    r179 r204  
    1818
    1919    $Output .= '<table width="50%" class="WideTable" style="font-size: small;">';
    20     $Output .= '<tr><th>Název tarifu</th><th>Min. rychlost [kbit/s]</th><th>Max. rychlost [kbit/s]</th><th>Agregační poměr</th><th>Cenových jednotek</th><th>Počet podílníků</th><th>Celkem cenových jednotek</th><th>Cena [Kč]</th><th>Vybráno celkem [Kč]</th></tr>';
     20    $Output .= '<tr><th>Název tarifu</th><th>Min. rychlost [kbit/s]</th><th>Max. rychlost [kbit/s]</th><th>Agregační poměr</th><th>Počet podílníků</th><th>Cena [Kč]</th><th>Součet ceny [Kč]</th></tr>';
    2121    $TotalPrice = 0;
    22     $TotalUnits = 0;
    23     foreach($Finance->Tarify as $Index => $Tarif)
     22    foreach($Finance->Tariffs as $Index => $Tariff)
    2423    {
    25       $Output .= '<tr><td style="color: blue;">'.$Tarif['name'].'</td><td align="center">'.round($Tarif['min_speed'] / 1024).'</td><td align="center" style="color: blue;">'.round($Tarif['max_speed'] / 1024).'</td><td align="center">'.$Tarif['aggregation'].'</td><td align="center">'.$Tarif['price_units'].'</td><td align="center">'.$Tarif['user_count'].'</td><td align="center">'.
    26       $Tarif['total_units'].'</td><td align="center" style="color: blue;">'.$Tarif['price'].'</td><td align="center">'.$Tarif['user_count'] * $Tarif['price'].'</td></tr>';
    27       $TotalPrice = $TotalPrice + $Tarif['price'] * $Tarif['user_count'];
    28       $TotalUnits = $TotalUnits + $Tarif['total_units'];
     24      $Tariff['Aggregation'] = '1:'.round($Tariff['SpeedMax'] / $Tariff['SpeedMin']);
     25      $Output .= '<tr><td style="color: blue;">'.$Tariff['Name'].'</td><td align="center">'.round($Tariff['SpeedMin'] / 1024).'</td><td align="center" style="color: blue;">'.round($Tariff['SpeedMax'] / 1024).'</td><td align="center">'.$Tariff['Aggregation'].'</td><td align="center">'.$Tariff['MemberCount'].'</td><td align="center" style="color: blue;">'.$Tariff['Price'].'</td><td align="center">'.$Tariff['MemberCount'] * $Tariff['Price'].'</td></tr>';
     26      $TotalPrice = $TotalPrice + $Tariff['Price'] * $Tariff['MemberCount'];
    2927    }
    30     $Output .= '<tr><td>Součty</td><td colspan="4">&nbsp;</td><td align="center">'.$Finance->InternetUsers.'</td><td align="center">'.$TotalUnits.'</td><td>&nbsp;</td><td align="center">'.$TotalPrice.'</td></tr>';
     28    $Output .= '<tr><td>Součty</td><td colspan="3">&nbsp;</td><td align="center">'.$Finance->InternetUsers.'</td><td>&nbsp;</td><td align="center">'.$TotalPrice.'</td></tr>';
    3129    $Output .= '</table>';
    3230    return($Output);
Note: See TracChangeset for help on using the changeset viewer.