source: www/finance/monthly_overall.php@ 156

Last change on this file since 156 was 156, checked in by george, 16 years ago
  • Opraveno: Některé soubory financí aktualizovány na nové rozvržení tabulek User, Member, Subject.
File size: 2.3 KB
Line 
1<?php
2include_once('../global.php');
3include_once('include.php');
4
5class FinanceMonthlyOverallPage extends Page
6{
7 var $FullTitle = 'Měsíční přehledy';
8 var $ShortTitle = 'Měsíční přehledy';
9
10 function Show()
11 {
12 global $MonthNames;
13
14 $Output = '<table cellspacing="0" cellpadding="2" border="1"><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>';
15 $Total = array('money' => 0, 'administration_total' => 0, 'consumption_total' => 0, 'total_paid' => 0, 'investment' => 0);
16 $DbResult = $this->Database->select('finance_monthly_overall', '*', '1 ORDER BY date DESC');
17 while($Month = $DbResult->fetch_array())
18 {
19 $DateParts = explode('-', $Month['date']);
20 $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>';
21
22 $Total['money'] += $Month['money'];
23 $Total['administration_total'] += $Month['administration_total'];
24 $Total['consumption_total'] += $Month['consumption_total'];
25 $Total['total_paid'] += $Month['total_paid'];
26 $Total['investment'] += $Month['investment'];
27 //if($DateParts[1] == '01') echo('<tr><td style="font-size: 4;" colspan="10">&nbsp;</td></tr>');
28 }
29 $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>';
30 $Output .= '</table>';
31 return($Output);
32 }
33}
34
35$System->AddModule(new FinanceMonthlyOverallPage());
36$System->Modules['FinanceMonthlyOverallPage']->GetOutput();
37
38?>
Note: See TracBrowser for help on using the repository browser.