Changeset 164 for www/finance/clenove.php
- Timestamp:
- Feb 21, 2009, 11:04:42 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
www/finance/clenove.php
r163 r164 11 11 $Finance = $this->System->Modules['Finance']; 12 12 $this->System->Modules['Finance']->RecalculateTariffs(1); 13 if($this->System->Modules['User']->CheckPermission('Finance', 'SubjectList')) 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 style="font-size: smaller;" border="1" cellspacing="0" cellpadding="3">'. 18 '<tr><th>JZá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></tr>'; 21 $TotalDevice = 0; 22 $TotalMonth = 0; 23 $TotalCash = 0; 24 $DbResult = $this->Database->query('SELECT MonthlyTotal, Cash, Subject.Id, Subject.Name, NetworkDevice, InternetTariffCurrentMonth, InternetTariffNextMonth, CONCAT(User.SecondName, " ", User.FirstName) AS FullName FROM MemberPayment JOIN Member ON Member.Id=MemberPayment.Member JOIN Subject ON Subject.Id=Member.Subject JOIN User ON User.Id=Member.ResponsibleUser ORDER BY FullName'); 25 while($Row = $DbResult->fetch_assoc()) 14 26 { 15 // Seznam členů 16 $Output = 'Seznam účastníků:<br>'. 17 '<table style="font-size: smaller;" border="1" cellspacing="0" cellpadding="3">'. 18 '<tr><th>Jméno</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></tr>'; 21 $TotalDevice = 0; 22 $TotalMonth = 0; 23 $TotalCash = 0; 24 $DbResult = $this->Database->query('SELECT * FROM MemberPayment JOIN Member ON Member.Id=MemberPayment.Member JOIN Subject ON Subject.Id=Member.Subject ORDER BY Name'); 25 while($Row = $DbResult->fetch_array()) 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->Tarify[$Row['InternetTariffCurrentMonth']]['name']; 31 $PristiTarif = $Finance->Tarify[$Row['InternetTariffNextMonth']]['name']; 32 $Output .= '<tr><td><a href="user_state.php?id='.$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></tr>'; 35 $TotalDevice += $Row['NetworkDevice']; 36 $TotalMonth += ($Row['MonthlyTotal']); 37 } 38 $Output .= '<tr><td><strong>Celkem</strong></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"> </td><td align="right"> </td><td align="right"> </td></tr>'; 41 $Output .= '</table>'; 42 } else $Output = 'Nemáte oprávnění'; 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->Tarify[$Row['InternetTariffCurrentMonth']]['name']; 31 $PristiTarif = $Finance->Tarify[$Row['InternetTariffNextMonth']]['name']; 32 $Output .= '<tr><td>'.$Row['FullName'].'</td><td><a href="user_state.php?userid='.$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></tr>'; 35 $TotalDevice += $Row['NetworkDevice']; 36 $TotalMonth += ($Row['MonthlyTotal']); 37 } 38 $Output .= '<tr><td><strong>Celkem</strong></td><td> </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"> </td><td align="right"> </td><td align="right"> </td></tr>'; 41 $Output .= '</table>'; 43 42 return($Output); 44 43 }
Note:
See TracChangeset
for help on using the changeset viewer.