Changeset 12 for finance/index.php
- Timestamp:
- Aug 11, 2007, 1:55:06 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
finance/index.php
r5 r12 1 1 <? 2 2 3 include('administrace/george/db.php'); 4 include('config.php'); 5 DB_Init($DatabaseHost, $DatabaseUser, $DatabasePassword, 'wow'); 6 DB_Query('SET NAMES cp1250'); 7 3 8 // 2.12.2006 +2400 Maron 9 /* 4 10 $Operace = array( 5 11 array('18.7.2007', +300, 'WOMAC'), … … 65 71 $Total = $Total + $Item[1]; 66 72 } 67 echo('<p><strong>Stav konta: '.$Total.' Kè</strong></p>'); 73 */ 74 75 $OperationType = array( 76 'buy' => 'Nákup', 77 'sell' => 'Prodej', 78 'consumption' => 'Spotøeba', 79 'internet' => 'Internet', 80 'contribution' => 'Pøispìvek od', 81 ); 82 DB_Select('finance', 'SUM(money)'); 83 $Row = DB_Row(); 84 echo('<p><strong>Stav financí: '.$Row[0].' Kè</strong></p>'); 68 85 69 86 echo('<table style="font-size: small;" class="TableDonate" border="1" cellspacing="0" cellpadding="1"> 70 87 <tr><th>Datum</th><th>Suma</th><th>Popis</th></tr>'); 71 foreach($Operace as $Item) 88 DB_Select('finance', '*', '1 ORDER BY time DESC'); 89 while($Row = DB_Row()) 72 90 { 73 if($ Item[1] > 0)91 if($Row['money'] > 0) 74 92 { 75 93 $Plus = '+'; 76 $Typ = 'Pøíspìvek od ';77 94 } else 78 95 { 79 96 $Plus = ''; 80 $Typ = '';81 97 } 98 if($Row['time'] == '') $Row['time'] = ' '; 99 else 100 { 101 $DateTimeParts = explode(' ', $Row['time']); 102 $DateParts = explode('-', $DateTimeParts[0]); 103 $Row['time'] = ($DateParts[2]*1).'.'.($DateParts[1]*1).'.'.($DateParts[0]*1); 104 } 105 echo('<tr><td align="right">'.$Row['time'].'</td><td align="right">'.$Plus.$Row['money'].'</td><td>'.$OperationType[$Row['operation']].' '.$Row['description'].'</td></tr>'); 106 } 107 /* 108 foreach($Operace as $Item) 109 { 82 110 if($Item[0] == '') $Item[0] = ' '; 83 111 echo('<tr><td align="right">'.$Item[0].'</td><td align="right">'.$Plus.$Item[1].'</td><td>'.$Typ.$Item[2].'</td></tr>'); 84 112 } 113 */ 85 114 echo('</table>'); 86 115
Note:
See TracChangeset
for help on using the changeset viewer.