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 | | | </head> |
10 | | | <body topmargin=10 leftmargin=10> |
11 | | | <? |
12 | | | require('grab_globals.lib.php'); |
13 | | | include ("fce.php"); |
14 | | | $spojeni = MySQL_Connect($db_host, $db_user, $db_pass); |
15 | | | MySQL_Select_DB($db_name); |
16 | | | $dotaz=MySQL_Query("SELECT * FROM finance WHERE clen='$id'"); |
17 | | | $dotaz=MySQL_Fetch_Array($dotaz); |
18 | | | |
19 | | | if(!$action) |
20 | | | { |
21 | | | echo ' |
22 | | | <form action="updatefinance_user.php?action=save" method=POST> |
23 | | | <table> |
24 | | | <tr> |
25 | | | <td class=text>Rok:</td> |
26 | | | <td class=text> |
27 | | | '.$year.' |
28 | | | </td> |
29 | | | </tr> |
30 | | | <tr> |
31 | | | <td class=text>Měsíc:</td> |
32 | | | <td> |
33 | | | |
34 | | | <select class=field name="month">'; |
35 | | | for ($i=1;$i<13;$i++) |
36 | | | { |
37 | | | echo '<option '; if($dotaz["month"]==$i){ echo 'selected';} echo'>'.$i.'</option>'; |
38 | | | } |
39 | | | echo' |
40 | | | </select> |
41 | | | </td> |
42 | | | </tr> |
43 | | | <tr> |
44 | | | <td class=text>Den:</td> |
45 | | | <td> |
46 | | | |
47 | | | <select class=field name="day">'; |
48 | | | for ($i=1;$i<32;$i++) |
49 | | | { |
50 | | | echo '<option '; if($dotaz["day"]==$i){ echo 'selected';} echo'>'.$i.'</option>'; |
51 | | | } |
52 | | | echo' |
53 | | | </select> |
54 | | | </td> |
55 | | | </tr> |
56 | | | <tr> |
57 | | | <td class=text>typ transakce:</td> |
58 | | | <td> |
59 | | | <select class=field name="type">'; |
60 | | | $typdotaz=MySQL_Query("SELECT * from poplatky ORDER BY id ASC"); |
61 | | | $count=MySQL_Num_Rows($typdotaz); |
62 | | | |
63 | | | for ($i=0;$i<$count;$i++) |
64 | | | { |
65 | | | $string=MySQL_Fetch_Array($typdotaz); |
66 | | | echo '<option '; if($dotaz["type"]==$i){ echo 'selected';} echo' value='.$i.'>'.$string["type"].'</option>'; |
67 | | | Next($string); |
68 | | | } |
69 | | | echo '</select> |
70 | | | </td> |
71 | | | </tr> |
72 | | | <tr> |
73 | | | <td class=text>částka:</td><td><input class=field name="money" type="text" value="'.$dotaz["money"].'" size=25></td> |
74 | | | </tr> |
75 | | | <tr> |
76 | | | <td class=text valign=top>Poznámka:</td><td><textarea class=fieldthin name="comment" rows=8 cols=25>'.$dotaz["comment"].'</textarea></td> |
77 | | | </tr> |
78 | | | </table> |
79 | | | <br> |
80 | | | <center><input class=field type="submit" name="OK" value=" uloit "></center> |
81 | | | <input name="year" type="hidden" value="'.$year.'"><input name="id" type="hidden" value="'.$id.'"><input name="table" type="hidden" value="'.$table.'"> |
82 | | | '; |
83 | | | } |
84 | | | else |
85 | | | { |
86 | | | MySQL_Query("UPDATE $table SET month='$month', day='$day', type='$type', comment='$comment', money='$money' WHERE id='$id'"); |
87 | | | echo 'Změny uloeny. Prosím vyberte rok a klikněte na "zobrazit".'; |
88 | | | } |
89 | | | ?> |
90 | | | </body> |
91 | | | </html> |