source: branches/posledni/pages/finance-vypis.php

Last change on this file was 711, checked in by george, 15 years ago
  • Zkopírováno: Větev trunk do branches jako posledni.
File size: 1.6 KB
Line 
1<?php
2
3$db->select_db($Config['Database']['Database']);
4
5$Output = '<h2 class="PageTitle">Výpis příspěvků</h2>';
6
7$operace = array(
8 'buy' => 'Nákup',
9 'sell' => 'Prodej',
10 'consumption' => 'Spotřeba',
11 'internet' => 'Internet',
12 'contribution' => 'Příspěvek od',
13 'hosting' => 'Server hosting',
14);
15
16if(array_key_exists('page_index', $_GET)) $Page = $_GET['page_index'];
17 else $Page = 0;
18$DbResult = $db->query('SELECT COUNT(*) FROM `Finance`');
19$DbRow = $DbResult->fetch_row();
20$TotalCount = $DbRow[0];
21
22$Output .= '<div class="Center">'.$html->PageList('page_index', $Page, $TotalCount, $Config['Web']['TableRowPerPage'], 10).'</div>';
23$Output .= '<table class="BaseTable">'.
24 '<tr>'.
25 '<th>Datum</th>'.
26 '<th>Suma</th>'.
27 '<th>Popis</th>'.
28 '<th>Odměna</th>'.
29 '</tr>';
30
31$load_dotation = $db->query('SELECT * FROM `Finance` ORDER BY `Time` DESC LIMIT '.($Page * $Config['Web']['TableRowPerPage']).','.$Config['Web']['TableRowPerPage']);
32while($row = $load_dotation->fetch_assoc())
33{
34 $odmena = $row['Reward'];
35
36 if($row['Time'] != '')
37 {
38 $date = $server->HumanDate($row['Time'], 0);
39 //$date = $row['time'];
40 } else $date = '';
41 if($row['Money'] > 0) $plus = '+';
42 else $plus = '';
43 $Output .= '<tr>'.
44 '<td>'.$date.'</td>'.
45 '<td>'.$plus.$row['Money'].'</td>'.
46 '<td>'.$operace[$row['Operation']].' '.$row['Description'].'</td>'.
47 '<td>'.$odmena.'</td>'.
48 '</tr>';
49}
50$Output .= '</table>';
51$Output .= '<div class="Center">'.$html->PageList('page_index', $Page, $TotalCount, $Config['Web']['TableRowPerPage'], 10).'</div>';
52
53echo($Output);
54
55?>
Note: See TracBrowser for help on using the repository browser.