1 | 2 | simandl | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
2 | | | <html> |
3 | | | <head> |
4 | | | <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2"> |
5 | | | <style type="text/css" media="screen"> @import "style.css"; </style> |
6 | | | <title>db.jablonka.cz finance uživatele</title> |
7 | | | </head> |
8 | | | <link rel="stylesheet" type="text/css" href="style.css"> |
9 | | | <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2"> |
10 | | | </head> |
11 | | | <body topmargin=0 leftmargin=10> |
12 | | | |
13 | | | <? |
14 | | | require('grab_globals.lib.php'); |
15 | | | include ("header.htm"); |
16 | | | include ("fce.php"); |
17 | | | $spojeni = MySQL_Connect($db_host, $db_user, $db_pass); |
18 | | | MySQL_Select_DB($db_name); |
19 | | | if($year=="") $year=date("Y"); |
20 | | | $table="finance"; |
21 | | | if($order=="" || $order=="datum") $dotaz=MySQL_Query("SELECT * FROM $table WHERE clen='$user_id' ORDER BY datum"); |
22 | | | if($order=="castka") $dotaz=MySQL_Query("SELECT * FROM $table WHERE user_id='$user_id' ORDER BY money,month,day"); |
23 | | | if($order=="typ") $dotaz=MySQL_Query("SELECT * FROM $table WHERE user_id='$user_id' ORDER BY type,month,day"); |
24 | | | ?> |
25 | | | <br> |
26 | | | <br> |
27 | | | <form action="viewfinance_user.php" method=POST> |
28 | | | <b>Finance uživatele <font color=red><? echo id_to_name($user_id)?></font> pro rok |
29 | | | <select class=field name="year"> |
30 | | | <? |
31 | | | for ($i=2004;$i<2010;$i++) |
32 | | | { |
33 | | | echo '<option '; if($year==$i){ echo 'selected';} echo'>'.$i.'</option>'; |
34 | | | } |
35 | | | echo' |
36 | | | </select><br> |
37 | | | <input class=field type="submit" name="OK" value="zobrazit"> |
38 | | | <input name="user_id" type="hidden" value="'.$user_id.'"> |
39 | | | </form>'; |
40 | | | ?> |
41 | | | <center> |
42 | | | <table width=80% cellspacing=1> |
43 | | | <tr> |
44 | | | <td bgcolor=#C00000> |
45 | | | <table cellspacing=0 cellpadding=0 width=100%> |
46 | | | <tr> |
47 | | | <td bgcolor=#FFFFFF> </td> |
48 | | | <td bgcolor=#FFFFFF class=text> |
49 | | | <a title="seřadit podle data" class=odkaz href="viewfinance_user.php?user_id=<? echo $user_id;?>&order=datum&year=<? echo $year;?>">Datum</a> |
50 | | | </td> |
51 | | | <td bgcolor=#FFFFFF class=text> |
52 | | | <a title="seřadit podle částky" class=odkaz href="viewfinance_user.php?user_id=<? echo $user_id;?>&order=castka&year=<? echo $year;?>">Částka</a> |
53 | | | </td> |
54 | | | <td bgcolor=#FFFFFF class=text> |
55 | | | <a title="seřadit podle druhu platby" class=odkaz href="viewfinance_user.php?user_id=<? echo $user_id;?>&order=typ&year=<? echo $year;?>">Typ platby</a> |
56 | | | </td> |
57 | | | <td bgcolor=#FFFFFF class=text width=200> |
58 | | | Poznámka |
59 | | | </td> |
60 | | | <td bgcolor=#FFFFFF><br><br> |
61 | | | </td> |
62 | | | </tr><? |
63 | | | |
64 | | | while($string=MySQL_Fetch_Array($dotaz)) |
65 | | | { |
66 | | | $comment=str_split($string["comment"],40); |
67 | | | |
68 | | | if ($string["money"]<0) |
69 | | | { |
70 | | | $barva="#FAEEEE"; |
71 | | | } |
72 | | | else |
73 | | | { |
74 | | | $barva="#E7FFF1"; |
75 | | | } |
76 | | | echo ' |
77 | | | <tr> |
78 | | | <td bgcolor='.$barva.'> </td> |
79 | | | <td bgcolor='.$barva.' class=text> |
80 | | | '.$string["day"].'.'.$string["month"].'.'.$year.' |
81 | | | </td> |
82 | | | <td bgcolor='.$barva.' class=text> |
83 | | | '.$string["money"].' |
84 | | | </td> |
85 | | | <td bgcolor='.$barva.' class=text> |
86 | | | '.id_to_type($string["type"]).' |
87 | | | </td> |
88 | | | <td bgcolor='.$barva.' class=text>'; |
89 | | | ?> |
90 | | | <a class=odkaz href="javascript:;" onClick="javascript:window.open('comment.php?comment=<? echo $string["comment"];?>','poznámka','scrollbars=yes,status=no,menubar=no,resizable=no,directories=no,width=300,height=200');"> |
91 | | | <? |
92 | | | echo $comment[0]; |
93 | | | if ($string["comment"]!="") echo '...'; |
94 | | | echo ' |
95 | | | </a> |
96 | | | </td> |
97 | | | <td bgcolor='.$barva.' class=text>'; |
98 | | | ?> |
99 | | | <a class=odkaz href="javascript:;" onClick="javascript:window.open('updatefinance_user.php?year=<? echo $year;?>&id=<? echo $string["id"];?>','poznámka','scrollbars=yes,status=no,menubar=no,resizable=no,directories=no,width=300,height=300');"> |
100 | | | <? |
101 | | | echo 'upravit</a> |
102 | | | '; |
103 | | | ?> |
104 | | | <a class=odkaz href="javascript:;" onClick="javascript:window.open('delfinance_user.php?year=<? echo $year;?>&id=<? echo $string["id"];?>','poznámka','scrollbars=yes,status=no,menubar=no,resizable=no,directories=no,width=300,height=200');"> |
105 | | | <? |
106 | | | echo ' <font color="#C00000">smazat</font></a> |
107 | | | </td> |
108 | | | </tr> |
109 | | | <tr height=1> |
110 | | | <td colspan=6 bgcolor=#E6E4E4></td> |
111 | | | </tr> |
112 | | | '; |
113 | | | Next($string); |
114 | | | } |
115 | | | ?></table></tr></td></table></center><? |
116 | | | echo ' |
117 | | | <hr> |
118 | | | <b>Bilance plateb:</b><br>'; |
119 | | | $celkova_bilance=0; |
120 | | | for ($i=0;$i<type_count();$i++) |
121 | | | { |
122 | | | $bilance=0; |
123 | | | $dotaz=MySQL_Query("SELECT * FROM $table WHERE user_id='$user_id' AND type='$i'"); |
124 | | | while($string=MySQL_Fetch_Array($dotaz)) |
125 | | | { |
126 | | | $bilance+=$string["money"]; |
127 | | | Next($string); |
128 | | | } |
129 | | | if ($bilance<0) { $barva="#C00000"; }else{ $barva="green"; } |
130 | | | echo id_to_type($i).': <font color='.$barva.'>'.$bilance.'</font><br>'; |
131 | | | $celkova_bilance+=$bilance; |
132 | | | } |
133 | | | echo '-------------------------------------------<br>'; |
134 | | | $bilance=$celkova_bilance; |
135 | | | if ($bilance<0) { $barva="#C00000"; }else{ $barva="green"; } |
136 | | | echo ' |
137 | | | <b>Celková bilance:</b> <font color='.$barva.'>'.$bilance.'</font>'; |
138 | | | |
139 | | | echo' |
140 | | | <br> |
141 | | | <br> |
142 | | | <img src=images/arrow.jpg> <a href="addfinance_user.php?user_id='.$user_id.'" class=odkaz>přidat transakci uživateli '.id_to_name($user_id).'</a> |
143 | | | |
144 | | | <br> |
145 | | | <br>'; |
146 | | | MySQL_Close($spojeni); |
147 | | | ?> |
148 | | | </body> |
149 | | | </html> |