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>Editace adresy</title> |
7 | | | </head> |
8 | | | <link rel="stylesheet" type="text/css" href="style.css"> |
9 | | | </head> |
10 | | | <body topmargin=0 leftmargin=10> |
11 | | | <? |
12 | | | include("header.htm"); |
13 | | | require('grab_globals.lib.php'); |
14 | | | include ("fce.php"); |
15 | | | $spojeni = MySQL_Connect($db_host, $db_user, $db_pass); |
16 | | | MySQL_Select_DB($db_name); |
17 | | | if(!@$action) |
18 | | | { |
19 | | | $dotaz=MySQL_Query("SELECT * FROM adresy WHERE id='$id' "); |
20 | | | $dotaz=MySQL_Fetch_Array($dotaz); |
21 | | | echo ' |
22 | | | <b>Editace adresy:</b><br> |
23 | | | <br> |
24 | | | <form action="edit_adres.php?action=save" method=POST> |
25 | | | <table> |
26 | | | <tr> |
27 | | | <td class=text>Uživatel:</td><td><b>'.id_to_name($dotaz["clen"]).'</b></td> |
28 | | | <td></td> |
29 | | | <td></td> |
30 | | | <td class=text colspan=2><a href=del_adres.php?id='.$id.'>Smazat tuto adresu!</a></td> |
31 | | | </tr> |
32 | | | <tr> |
33 | | | <td class=text>Ulice:</td><td><input class=field name="ulice" type="text" value="'.$dotaz["ulice"].'" size=25></td> |
34 | | | <td class=text>Město:</td><td><input class=field name="mesto" type="text" value="'.$dotaz["mesto"].'" size=25></td> |
35 | | | </tr> |
36 | | | <tr> |
37 | | | <td class=text>č.p.:</td><td><input class=field name="cp" type="text" value="'.$dotaz["cp"].'" size=25></td> |
38 | | | <td class=text>PSČ:</td><td><input class=field name="psc" type="text" value="'.$dotaz["psc"].'" size=25></td> |
39 | | | </tr> |
40 | | | <tr> |
41 | | | <td class=text>Byt:</td><td><input class=field name="byt" type="text" value="'.$dotaz["byt"].'" size=25></td> |
42 | | | </tr> |
43 | | | <tr> |
44 | | | <td class=text>šířka:</td><td><input class=field name="sirka" type="text" value="'.$dotaz["sirka"].'" size=25></td> |
45 | | | <td class=text>délka:</td><td><input class=field name="delka" type="text" value="'.$dotaz["delka"].'" size=25></td> |
46 | | | <td class=text>výška:</td><td><input class=field name="vyska" type="text" value="'.$dotaz["vyska"].'" size=25></td> |
47 | | | </tr> |
48 | | | <tr> |
49 | | | <td class=text>otočení:</td><td><input class=field name="otoceni" type="text" value="'.$dotaz["otoceni"].'" size=25></td> |
50 | | | <td class=text>náklon:</td><td><input class=field name="naklon" type="text" value="'.$dotaz["naklon"].'" size=25></td> |
51 | | | </tr> |
52 | | | <tr> |
53 | | | |
54 | | | <td class=text>objekt:</td> |
55 | | | <td colspan=5> |
56 | | | <select class=field name="objekt">'."\n"; |
57 | | | #vypis vsech moznosti a predvybrani podle clena |
58 | | | $string=MySQL_Query("SELECT * FROM objekty ORDER BY id"); |
59 | | | echo '<option value=null>není</option>'; |
60 | | | while($vysledek=MySQL_Fetch_Array($string)) |
61 | | | { |
62 | | | echo '<option '; if($dotaz["objekt"]==$vysledek["id"]){ echo 'selected';} |
63 | | | echo' value='.$vysledek["id"].'>'.substr($vysledek["nazev"]." ".$vysledek["komentar"],0,100).'</option>'."\n"; |
64 | | | } |
65 | | | echo ' |
66 | | | </select> |
67 | | | </td> |
68 | | | |
69 | | | |
70 | | | </tr> |
71 | | | <tr> |
72 | | | <td class=text></td><td><textarea class=fieldthin name="komentar" rows=10 cols=45>'.$dotaz["komentar"].'</textarea></td> |
73 | | | </tr> |
74 | | | |
75 | | | </table> |
76 | | | |
77 | | | <br> |
78 | | | <input class=field type="submit" name="OK" value=" ulož změny "> |
79 | | | <input name="id" type="hidden" value="'.$id.'"> |
80 | | | <input name="clen" type="hidden" value="'.$dotaz["clen"].'"> |
81 | | | </form> |
82 | | | '; |
83 | | | } |
84 | | | else |
85 | | | { |
86 | | | $result = MySQL_Query("UPDATE adresy SET clen='$clen',mesto='$mesto',ulice='$ulice',cp='$cp',psc='$psc',byt='$byt',komentar='$komentar' WHERE id='$id'"); |
87 | | | |
88 | | | if (!$result) { |
89 | | | echo "<br><b>Výsledek : ".mysql_error()."</b>"; |
90 | | | } else { |
91 | | | echo "<br><b>Adresa uživatele ".id_to_name($clen)." byla úspěšně upravena!</b>"; |
92 | | | } |
93 | | | |
94 | | | echo ' |
95 | | | <br> |
96 | | | <br> |
97 | | | <img src=images/arrow.jpg> <a href="javascript:history.go(-2)" class=odkaz>zpět</a> |
98 | | | '; |
99 | | | } |
100 | | | |
101 | | | MySQL_Close($spojeni); |
102 | | | ?> |
103 | | | </body> |
104 | | | </html> |