1 | <?php
|
---|
2 | include_once('../global.php');
|
---|
3 |
|
---|
4 | class FinanceMonthlyOverallPage extends Page
|
---|
5 | {
|
---|
6 | var $FullTitle = 'Měsíční přehledy';
|
---|
7 | var $ShortTitle = 'Měsíční přehledy';
|
---|
8 |
|
---|
9 | function Show()
|
---|
10 | {
|
---|
11 | global $MonthNames;
|
---|
12 |
|
---|
13 | $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');
|
---|
16 | while($Month = $DbResult->fetch_array())
|
---|
17 | {
|
---|
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>';
|
---|
20 |
|
---|
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'];
|
---|
26 | //if($DateParts[1] == '01') echo('<tr><td style="font-size: 4;" colspan="10"> </td></tr>');
|
---|
27 | }
|
---|
28 | $Output .= '<tr><th colspan="2">Celkem</th><th>'.$Total['money'].'</th><th> </th><th> </th><th>'.$Total['administration_total'].'</th><th> </th><th>'.$Total['consumption_total'].'</th><th>'.$Total['total_paid'].'</th><th> </th><th>'.$Total['investment'].'</th>';
|
---|
29 | $Output .= '</table>';
|
---|
30 | return($Output);
|
---|
31 | }
|
---|
32 | }
|
---|
33 |
|
---|
34 | $System->AddModule(new FinanceMonthlyOverallPage());
|
---|
35 | $System->Modules['FinanceMonthlyOverallPage']->GetOutput();
|
---|
36 |
|
---|
37 | ?>
|
---|