Changeset 407


Ignore:
Timestamp:
Oct 4, 2012, 8:12:31 AM (12 years ago)
Author:
chronos
Message:
  • Upraveno: Tabulky finance_monthly_overall a finance_carge přejmenovaný na názvy s velkými prvními písmeny.
Location:
trunk
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/finance/finance.php

    r327 r407  
    9696      $this->BillingPeriods[$BillingPeriod['Id']] = $BillingPeriod;
    9797   
    98     $DbResult = $this->Database->query('SELECT * FROM finance_charge WHERE period='.$Period);
     98    $DbResult = $this->Database->query('SELECT * FROM FinanceCharge WHERE Period='.$Period);
    9999    $Row = $DbResult->fetch_array();
    100100    $this->kWh = $Row['kWh'];
    101     $this->Internet = $Row['internet'];
    102     $this->Sprava = $Row['administration_per_user'];
    103     $this->RealMaxSpeed = $Row['internet_speed'];
    104     $this->SpeedReserve = $Row['internet_speed_reserve'];
    105     $this->BaseSpeedElement = $Row['base_speed_element'];
     101    $this->Internet = $Row['Internet'];
     102    $this->Sprava = $Row['AdministrationPerUser'];
     103    $this->RealMaxSpeed = $Row['InternetSpeed'];
     104    $this->SpeedReserve = $Row['InternetSpeedReserve'];
     105    $this->BaseSpeedElement = $Row['BaseSpeedElement'];
    106106    $this->MaxSpeed = $this->RealMaxSpeed - $this->SpeedReserve;
    107107    $this->TopTariffPrice = $Row['TopTariffPrice'];
  • trunk/finance/index.php

    r294 r407  
    2323    $Output .= '<br /><strong>Souhrn:</strong><br />';
    2424
    25     $DbResult = $this->Database->query('SELECT * FROM finance_monthly_overall ORDER BY date DESC LIMIT 0,1');
     25    $DbResult = $this->Database->query('SELECT * FROM FinanceMonthlyOverall ORDER BY Date DESC LIMIT 0,1');
    2626    $Row = $DbResult->fetch_array();
    2727    $Output .= 'Platba za internetovou linku ('.$Finance->RealMaxSpeed.'/'.$Finance->RealMaxSpeed.' kbit/s): <strong>'.$Finance->Internet.' Kč</strong><br />';
  • trunk/finance/manage.php

    r396 r407  
    280280   
    281281    // Načti poslední měsíční přehled a nastavení
    282     $DbResult = $this->Database->select('finance_monthly_overall', '*', '1 ORDER BY date DESC LIMIT 1');
     282    $DbResult = $this->Database->select('FinanceMonthlyOverall', '*', '1 ORDER BY Date DESC LIMIT 1');
    283283    $Overall = $DbResult->fetch_array();
    284284
    285285    $Output -= 'Datum: '.date('j.n.Y').'<br />';
    286286   
    287     $Datum = explode('-', $Overall['date']);
     287    $Datum = explode('-', $Overall['Date']);
    288288    $Mesic = date('m') + 0;
    289289
     
    360360      // Update finance charge
    361361      $Output .= 'Měním aktuální parametry sítě...<br>';
    362       $this->Database->delete('finance_charge', 'period = 0');
    363       $DbResult = $this->Database->select('finance_charge', '*', 'period = 1');
     362      $this->Database->delete('FinanceCharge', 'Period = 0');
     363      $DbResult = $this->Database->select('FinanceCharge', '*', 'Period = 1');
    364364      $Charge = $DbResult->fetch_assoc();
    365365      //print_r($Charge);
    366       $DbResult = $this->Database->insert('finance_charge', array('period' => 0, 'internet' => $Charge['internet'], 'internet_speed' => $Charge['internet_speed'], 'internet_speed_reserve' => $Charge['internet_speed_reserve'], 'administration_per_user' => $Charge['administration_per_user'], 'kWh' => $Charge['kWh'], 'base_speed_element' => $Charge['base_speed_element'], 'BaseTariffPrice' => $Charge['BaseTariffPrice'], 'TopTariffPrice' => $Charge['TopTariffPrice']));
     366      $DbResult = $this->Database->insert('FinanceCharge', array('Period' => 0, 'Internet' => $Charge['Internet'], 'InternetSpeed' => $Charge['InternetSpeed'], 'InternetSpeedReserve' => $Charge['InternetSpeedReserve'], 'AdministrationPerUser' => $Charge['AdministrationPerUser'], 'kWh' => $Charge['kWh'], 'BaseSpeedElement' => $Charge['BaseSpeedElement'], 'BaseTariffPrice' => $Charge['BaseTariffPrice'], 'TopTariffPrice' => $Charge['TopTariffPrice']));
    367367
    368368      $Output .= 'Přidávám měsíční přehled...<br />';
    369       $this->Database->insert('finance_monthly_overall', array('date' => 'NOW()', 'money' => $Finance->Internet, 'kWh' => $Finance->kWh, 'administration' => $Finance->Sprava, 'administration_total' => $SpravaCelkem, 'consumption_total' => $TotalConsumptionCost, 'total_paid' => $Finance->TotalPaid, 'BaseTariffPrice' => $Charge['BaseTariffPrice'], 'TopTariffPrice' => $Charge['TopTariffPrice'], 'member_count' => $Finance->InternetUsers));
     369      $this->Database->insert('FinanceMonthlyOverall', array('Date' => 'NOW()', 'Money' => $Finance->Internet, 'kWh' => $Finance->kWh, 'Administration' => $Finance->Sprava, 'AdministrationTotal' => $SpravaCelkem, 'ConsumptionTotal' => $TotalConsumptionCost, 'TotalPaid' => $Finance->TotalPaid, 'BaseTariffPrice' => $Charge['BaseTariffPrice'], 'TopTariffPrice' => $Charge['TopTariffPrice'], 'MemberCount' => $Finance->InternetUsers));
    370370
    371371      // Update tarrifs
  • trunk/finance/monthly_overall.php

    r157 r407  
    1212
    1313    $Output = '<table class="WideTable"><tr><th>Rok</th><th>Měsíc</th><th>Internet [Kč]</th><th>Účastníků</th><th>Správa [Kč/účastníka]</th><th>Správa [Kč]</th><th>Spotřeba [Kč/kWh]</th><th>Spotřeba [Kč]</th><th>Obrat [Kč]</th><th>Průměrná cena [Kč/účastníka]</th><th align="center">Investice [Kč]</th></tr>';
    14     $Total = array('money' => 0, 'administration_total' => 0, 'consumption_total' => 0, 'total_paid' => 0, 'investment' => 0);
    15     $DbResult = $this->Database->select('finance_monthly_overall', '*', '1 ORDER BY date DESC');
     14    $Total = array('Money' => 0, 'AdministrationTotal' => 0, 'ConsumptionTotal' => 0, 'TotalPaid' => 0, 'Investment' => 0);
     15    $DbResult = $this->Database->select('FinanceMonthlyOverall', '*', '1 ORDER BY Date DESC');
    1616    while($Month = $DbResult->fetch_array())
    1717    {
    18       $DateParts = explode('-', $Month['date']);
    19       $Output .= '<tr><td>'.$DateParts[0].'</td><td align="center">'.$MonthNames[$DateParts[1] * 1].'</td><td align="center">'.$Month['money'].'</td><td align="center">'.$Month['member_count'].'</td><td align="center">'.$Month['administration'].'</td><td align="center">'.$Month['administration_total'].'</td><td align="center">'.$Month['kWh'].'</td><td align="center">'.$Month['consumption_total'].'</td><td align="center">'.$Month['total_paid'].'</td><td align="center">'.round($Month['total_paid'] / $Month['member_count']).'</td><td align="center">'.$Month['investment'].'</td></tr>';
     18      $DateParts = explode('-', $Month['Date']);
     19      $Output .= '<tr><td>'.$DateParts[0].'</td><td align="center">'.$MonthNames[$DateParts[1] * 1].'</td><td align="center">'.$Month['Money'].'</td><td align="center">'.$Month['MemberCount'].'</td><td align="center">'.$Month['Administration'].'</td><td align="center">'.$Month['AdministrationTotal'].'</td><td align="center">'.$Month['kWh'].'</td><td align="center">'.$Month['ConsumptionTotal'].'</td><td align="center">'.$Month['TotalPaid'].'</td><td align="center">'.round($Month['TotalPaid'] / $Month['MemberCount']).'</td><td align="center">'.$Month['Investment'].'</td></tr>';
    2020
    21       $Total['money'] += $Month['money'];
    22       $Total['administration_total'] += $Month['administration_total'];
    23       $Total['consumption_total'] += $Month['consumption_total'];
    24       $Total['total_paid'] += $Month['total_paid'];
    25           $Total['investment'] += $Month['investment'];
     21      $Total['Money'] += $Month['Money'];
     22      $Total['AdministrationTotal'] += $Month['AdministrationTotal'];
     23      $Total['ConsumptionTotal'] += $Month['ConsumptionTotal'];
     24      $Total['TotalPaid'] += $Month['TotalPaid'];
     25      $Total['Investment'] += $Month['Investment'];
    2626      //if($DateParts[1] == '01') echo('<tr><td style="font-size: 4;" colspan="10">&nbsp;</td></tr>');
    2727    }
    28     $Output .= '<tr><th colspan="2">Celkem</th><th>'.$Total['money'].'</th><th>&nbsp;</th><th>&nbsp;</th><th>'.$Total['administration_total'].'</th><th>&nbsp;</th><th>'.$Total['consumption_total'].'</th><th>'.$Total['total_paid'].'</th><th>&nbsp;</th><th>'.$Total['investment'].'</th>';
     28    $Output .= '<tr><th colspan="2">Celkem</th><th>'.$Total['Money'].'</th><th>&nbsp;</th><th>&nbsp;</th><th>'.$Total['AdministrationTotal'].'</th><th>&nbsp;</th><th>'.$Total['ConsumptionTotal'].'</th><th>'.$Total['TotalPaid'].'</th><th>&nbsp;</th><th>'.$Total['Investment'].'</th>';
    2929    $Output .= '</table>';
    3030    return($Output);
Note: See TracChangeset for help on using the changeset viewer.