Changeset 165 for www/finance/user_state.php
- Timestamp:
- Mar 5, 2009, 10:16:12 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
www/finance/user_state.php
r163 r165 39 39 $User = $DbResult->fetch_assoc(); 40 40 $Output .= 'Výpis operací pro účastníka '.$User['Name'].':<br>'; 41 $Output .= '<table style="font-size: smaller;" border="1" cellspacing="0" cellpadding="3"><tr><th>Datum</th><th>Popis</th><th>Částka</th><th>Doklad</th></tr>';41 $Output .= '<table style="font-size: smaller;" class="WideTable"><tr><th>Datum</th><th>Popis</th><th>Částka</th><th>Doklad</th></tr>'; 42 42 $Operations = array(); 43 $DbResult = $this->Database->query('(SELECT Time, Value, Text, Bill FROM FinanceCashFlow WHERE Subject='.$Subject['Id'].') UNION ALL '. 44 '(SELECT TimeCreation as Time, -Value as Value, Text, Bill FROM FinanceClaimsLiabilities WHERE Subject='.$Subject['Id'].') ORDER BY Time DESC'); 43 $DbResult = $this->Database->query('(SELECT Time, Value, Text, Bill FROM FinanceOperation WHERE (DestinationSubject='.$Subject['Id'].') AND (SourceSubject = '.$Finance->ExternalSubject.')) UNION ALL '. 44 '(SELECT Time, -Value as Value, Text, Bill FROM FinanceOperation WHERE (SourceSubject='.$Subject['Id'].') AND (DestinationSubject='.$Finance->MainSubject.')) UNION ALL '. 45 '(SELECT Time, -Value as Value, Text, Bill FROM FinanceOperation WHERE (SourceSubject='.$Subject['Id'].') AND (DestinationSubject='.$Finance->ExternalSubject.')) UNION ALL '. 46 '(SELECT Time, Value, Text, Bill FROM FinanceOperation WHERE (DestinationSubject='.$Subject['Id'].') AND (SourceSubject = '.$Finance->MainSubject.')) '. 47 'ORDER BY Time DESC'); 45 48 while($DbRow = $DbResult->fetch_array()) 46 49 $Operations[] = $DbRow; … … 50 53 if($Row['Value'] > 0) $Row['Value'] = '+'.$Row['Value']; 51 54 if($Row['Bill'] > 0) $Invoice = '<a href="bill.php?Id='.$Row['Bill'].'">PDF</a>'; else $Invoice = ' '; 52 $Output .= '<tr><td align="right">'.HumanDate($Row['Time']).'</td><td>'.$Row['Text'].'</td><td style="text-align: right;">'.$Row['Value'].'</td><td style="text-align: center;">'.$Invoice.'</td></tr>';55 $Output .= '<tr><td style="text-align: right;">'.HumanDate($Row['Time']).'</td><td style="text-align: left;">'.$Row['Text'].'</td><td style="text-align: right;">'.$Row['Value'].'</td><td style="text-align: center;">'.$Invoice.'</td></tr>'; 53 56 } 54 57 //echo('<tr><td> </td><td>-'.$Row2['network_device'].'</td><td>Proměnná cena za zařízení</td></tr> 55 58 $Output .= '</table>'; 56 $DbResult = $this->Database->query('SELECT ((SELECT COALESCE(SUM(Value), 0) FROM FinanceCashFlow WHERE Subject='.$Subject['Id'].') + '. 57 '(SELECT COALESCE(SUM(-Value), 0) FROM FinanceClaimsLiabilities WHERE Subject='.$Subject['Id'].')) as Total'); 59 $DbResult = $this->Database->query('SELECT ('. 60 '(SELECT COALESCE(SUM(Value), 0) FROM FinanceOperation WHERE (DestinationSubject='.$Subject['Id'].') AND (SourceSubject = '.$Finance->ExternalSubject.')) - '. 61 '(SELECT COALESCE(SUM(Value), 0) FROM FinanceOperation WHERE (SourceSubject='.$Subject['Id'].') AND (DestinationSubject='.$Finance->MainSubject.')) - '. 62 '(SELECT COALESCE(SUM(Value), 0) FROM FinanceOperation WHERE (SourceSubject='.$Subject['Id'].') AND (DestinationSubject = '.$Finance->ExternalSubject.')) + '. 63 '(SELECT COALESCE(SUM(Value), 0) FROM FinanceOperation WHERE (DestinationSubject='.$Subject['Id'].') AND (SourceSubject='.$Finance->MainSubject.'))) as Total'); 58 64 $DbRow = $DbResult->fetch_array(); 59 65 $Total = $DbRow['Total']; … … 64 70 65 71 $Total = 0; 66 $Output .= 'Rozpis měsíčního poplatku:<br><table border="1" cellspacing="0" cellpadding="3">'.72 $Output .= 'Rozpis měsíčního poplatku:<br><table class="WideTable">'. 67 73 '<tr><th>Část</th><th>Cena [Kč]</th></tr>'. 68 74 '<tr><td>Internet - tarif '.$TarifName.'</td><td>'.$TarifPrice.'</td></tr>'; … … 78 84 { 79 85 $Output .= 'Měsíční příjem za spotřebu zařízení umístěných u uživatele:<br>'; 80 $Output .= '<table border="1" cellspacing="0" cellpadding="3"><tr><th>Název zařízení</th><th>Spotřeba [W]</th><th>Příjem [Kč]</th></tr>';86 $Output .= '<table class="WideTable"><tr><th>Název zařízení</th><th>Spotřeba [W]</th><th>Příjem [Kč]</th></tr>'; 81 87 $DbResult = $this->Database->query('SELECT * FROM network_devices WHERE user='.$UserId.' AND used=1'); 82 88 $TotalW = 0;
Note:
See TracChangeset
for help on using the changeset viewer.