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