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
RevLine 
[4]1<?php
[152]2include('../global.php');
[1]3
[152]4class FinanceUserList extends Page
[1]5{
[152]6 var $FullTitle = 'Seznam účastníků sítě';
7 var $ShortTitle = 'Seznam účastníků';
[145]8
[152]9 function Show()
10 {
[157]11 $Finance = $this->System->Modules['Finance'];
[295]12 $this->System->Modules['Finance']->LoadTariffs(1);
13 if(!$this->System->Modules['User']->CheckPermission('Finance', 'SubjectList')) return('Nemáte oprávnění');
[164]14
[295]15 // Seznam členů
[164]16 $Output = 'Seznam účastníků:<br>'.
[167]17 '<table class="WideTable">'.
18 '<tr><th>Zástupce</th><th>Subjekt</th>';
[164]19 //<th>Cena za zařízení [Kč]</th>
[295]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>';
[164]21 $TotalDevice = 0;
22 $TotalMonth = 0;
23 $TotalCash = 0;
[295]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');
[164]25 while($Row = $DbResult->fetch_assoc())
[50]26 {
[164]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>';
[204]30 $Tarif = $Finance->Tariffs[$Row['InternetTariffCurrentMonth']]['Name'];
31 $PristiTarif = $Finance->Tariffs[$Row['InternetTariffNextMonth']]['Name'];
[178]32 $Output .= '<tr><td>'.$Row['FullName'].'</td><td><a href="user_state.php?Subject='.$Row['Id'].'">'.$Row['Name'].'</a></td>';
[164]33 //<td align="right">'.$Row['network_device'].'</td>
[295]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>';
[164]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>
[167]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>';
[164]41 $Output .= '</table>';
[152]42 return($Output);
[1]43 }
[152]44}
[4]45
[152]46$System->AddModule(new FinanceUserList());
47$System->Modules['FinanceUserList']->GetOutput();
48
[1]49?>
Note: See TracBrowser for help on using the repository browser.