Changeset 152 for www/finance/monthly_overall.php
- Timestamp:
- Feb 16, 2009, 2:09:57 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
www/finance/monthly_overall.php
r129 r152 1 1 <?php 2 include('../global.php'); 3 include('../style.php'); 4 include('include.php'); 5 ShowHeader('Měsíční přehledy', 'Měsíční přehledy'); 2 include_once('../global.php'); 3 include_once('include.php'); 6 4 7 echo('<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>Investice [Kč]</th></tr>'); 8 $Total = array('money' => 0, 'administration_total' => 0, 'consumption_total' => 0, 'total_paid' => 0, 'investment' => 0); 9 $DbResult = $Database->select('finance_monthly_overall', '*', '1 ORDER BY date ASC'); 10 while($Month = $DbResult->fetch_array()) 5 class FinanceMonthlyOverallPage extends Page 11 6 { 12 $DateParts = explode('-', $Month['date']); 13 echo('<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>'); 14 // echo('<tr><td>'.$Month['date'].'</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></tr>'); 7 var $FullTitle = 'Měsíční přehledy'; 8 var $ShortTitle = 'Měsíční přehledy'; 15 9 16 $Total['money'] += $Month['money']; 17 $Total['administration_total'] += $Month['administration_total']; 18 $Total['consumption_total'] += $Month['consumption_total']; 19 $Total['total_paid'] += $Month['total_paid']; 20 $Total['investment'] += $Month['investment']; 21 //if($DateParts[1] == '01') echo('<tr><td style="font-size: 4;" colspan="10"> </td></tr>'); 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); 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"> </td></tr>'); 28 } 29 $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>'; 30 $Output .= '</table>'; 31 return($Output); 32 } 22 33 } 23 echo('<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'].'</tr>');24 echo('</table>');25 34 26 ShowFooter(); 35 $System->AddModule(new FinanceMonthlyOverallPage()); 36 $System->Modules['FinanceMonthlyOverallPage']->GetOutput(); 37 27 38 ?>
Note:
See TracChangeset
for help on using the changeset viewer.