source: trunk/finance/clenove.php@ 295

Last change on this file since 295 was 295, checked in by george, 15 years ago
  • Přidáno: Funkce pro zpožděné generování chybějících dokladů.
  • Property svn:executable set to *
File size: 2.6 KB
Line 
1<?php
2include('../global.php');
3
4class FinanceUserList extends Page
5{
6 var $FullTitle = 'Seznam účastníků sítě';
7 var $ShortTitle = 'Seznam účastníků';
8
9 function Show()
10 {
11 $Finance = $this->System->Modules['Finance'];
12 $this->System->Modules['Finance']->LoadTariffs(1);
13 if(!$this->System->Modules['User']->CheckPermission('Finance', 'SubjectList')) return('Nemáte oprávnění');
14
15 // Seznam členů
16 $Output = 'Seznam účastníků:<br>'.
17 '<table class="WideTable">'.
18 '<tr><th>Zástupce</th><th>Subjekt</th>';
19 //<th>Cena za zařízení [Kč]</th>
20 $Output .= '<th>Měsíční poplatek [Kč]</th><th>Stav účtu [Kč]</th><th>Běžící tarif</th><th>Příští tarif</th><th>Poznámky</th><th>WWW</th></tr>';
21 $TotalDevice = 0;
22 $TotalMonth = 0;
23 $TotalCash = 0;
24 $DbResult = $this->Database->query('SELECT MonthlyTotal, Cash, Subject.Id, Subject.WWW, Subject.Note, Subject.Name, NetworkDevice, InternetTariffCurrentMonth, InternetTariffNextMonth, User.Name AS FullName FROM MemberPayment LEFT JOIN Member ON Member.Id=MemberPayment.Member LEFT JOIN Subject ON Subject.Id=Member.Subject JOIN User ON User.Id=Member.ResponsibleUser ORDER BY FullName');
25 while($Row = $DbResult->fetch_assoc())
26 {
27 //$Row['cash'] = $Row['AdvancesIn'] - $Row['AdvancesOut'] + $Row['Liabilities'] - $Row['Claims'];
28 $TotalCash += $Row['Cash'];
29 if($Row['Cash'] < 0) $Row['Cash'] = '<span style="color: red;">'.$Row['Cash'].'</span>';
30 $Tarif = $Finance->Tariffs[$Row['InternetTariffCurrentMonth']]['Name'];
31 $PristiTarif = $Finance->Tariffs[$Row['InternetTariffNextMonth']]['Name'];
32 $Output .= '<tr><td>'.$Row['FullName'].'</td><td><a href="user_state.php?Subject='.$Row['Id'].'">'.$Row['Name'].'</a></td>';
33 //<td align="right">'.$Row['network_device'].'</td>
34 $Output .= '<td align="right">'.$Row['MonthlyTotal'].'</td><td align="right">'.$Row['Cash'].'</td><td align="center">'.$Tarif.'</td><td align="center">'.$PristiTarif.'</td><td>'.$Row['Note'].'</td><td>'.$Row['WWW'].'</td></tr>';
35 $TotalDevice += $Row['NetworkDevice'];
36 $TotalMonth += ($Row['MonthlyTotal']);
37 }
38 $Output .= '<tr><td><strong>Celkem</strong></td><td>&nbsp;</td>';
39 //<td align="right"><strong>'.$TotalDevice.'</strong></td>
40 $Output .= '<td align="right"><strong>'.$TotalMonth.'</strong></td><td align="right"><strong>'.$TotalCash.'</strong></td><td align="right">&nbsp;</td><td align="right">&nbsp;</td></tr>';
41 $Output .= '</table>';
42 return($Output);
43 }
44}
45
46$System->AddModule(new FinanceUserList());
47$System->Modules['FinanceUserList']->GetOutput();
48
49?>
Note: See TracBrowser for help on using the repository browser.