jablonka.czprosek.czf

is

Subversion Repositories:
[/] [trunk/] [html/] [add_user.php] - Blame information for rev 2

 

Line No. Rev Author Line
12simandl<!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<?
6require('grab_globals.lib.php');
7?>
8<style type="text/css" media="screen"> @import "style.css"; </style>
9<title>db.jablonka.cz - Přidání uživatele</title>
10</head>
11<link rel="stylesheet" type="text/css" href="style.css">
12</head>
13<body topmargin=0 leftmargin=10>
14<?
15include("header.htm");
16include ("fce.php");
17$spojeni = MySQL_Connect($db_host, $db_user, $db_pass);
18MySQL_Select_DB($db_name);
19if(!@$action)
20{
21$dbid=MySQL_Query("SELECT MAX(id) FROM cleni");
22$dbid=MySQL_Fetch_Array($dbid);
23$nove_id=$dbid["MAX(id)"]+1;
24echo '
25<b>Přidání uživatele:</b><br>
26 
27<form action="add_user.php?action=save" method=POST>
28<table>
29 <tr>
30 <td class=text>jméno:</td><td><input class=field name="jmeno" type="text" value="" size=25></td>
31 <td class=text>příjmení:</td><td><input class=field name="prijmeni" type="text" value="" size=25></td>
32 </tr>
33 <tr>
34 <td class=text>přezdívka:</td><td><input class=field name="prezdivka" type="text" value="" size=25></td>
35 <td class=text>narozen:</td><td><input class=field name="narozen" type="text" value="" size=25></td>
36 </tr>
37 <tr>
38 <td class=text>domu:</td><td><input class=field name="domu" type="text" value="" size=25></td>
39 <td class=text>mobil:</td><td><input class=field name="mobil" type="text" value="" size=25></td>
40 </tr>
41 <tr>
42 <td class=text>email:</td><td><input class=field name="email" type="text" value="" size=25></td>
43 <td class=text>ICQ:</td><td><input class=field name="icq" type="text" value="" size=25></td>
44 </tr>
45 <tr>
46 <td class=text>var.symb.:</td><td><input class=field name="vs" type="text" value="1100'.$nove_id.'" size=25></td>
47 </tr>
48 <tr><td colspan=3 class=text>poznámka<br>
49 <textarea class=fieldthin name="komentar" rows=3 cols=40></textarea>
50 </td>
51 <td class=text>finance:
52 &nbsp;&nbsp;<input class=radio name="finance" type="radio" checked value="1"> ano
53 &nbsp;&nbsp;<input class=radio name="finance" type="radio" value="0"> ne
54 <br>internet:
55 &nbsp;&nbsp;<input class=radio name="internet" type="radio" checked value="1"> ano
56 &nbsp;&nbsp;<input class=radio name="internet" type="radio" value="0"> ne
57 <br>elektřina:
58 &nbsp;&nbsp;<input class=radio name="energy" type="radio" checked value="2"> ano
59 &nbsp;&nbsp;<input class=radio name="energy" type="radio" value="1"> ano - sleva
60 &nbsp;&nbsp;<input class=radio name="energy" type="radio" value="0"> ne
61 <br>
62 aktivní:
63 &nbsp;&nbsp;<input class=radio name="active" type="radio" checked value="1"> ano
64 &nbsp;&nbsp;<input class=radio name="active" type="radio" value="0"> ne
65 </td>
66 </tr>
67</table>
68<input class=field type="submit" name="OK" value="&nbsp;vytvoř uživatele&nbsp;">
69</form>
70';
71}
72else
73{
74$dbid=MySQL_Query("SELECT MAX(id) FROM cleni");
75$dbid=MySQL_Fetch_Array($dbid);
76$id=$dbid["MAX(id)"];
77$id++;
78 
79$result = MySQL_Query("INSERT INTO cleni VALUES ('$id','$prezdivka','$jmeno','$prijmeni','$narozen','$domu','$mobil','$email','$icq','$komentar','$active','$finance','$energy','$internet','$vs')");
80 
81if (!$result) {
82echo "<br><b>Výsledek : ".mysql_error()."</b>";
83} else {
84echo "<br><b>Uživatel ".$jmeno." ".$prijmeni." byl úspěšně přidán!</b>";
85}
86 
87echo '
88<br>
89<br>
90<img src=images/arrow.jpg>&nbsp;<a href="javascript:history.go(-2)" class=odkaz>zpět</a>
91<img src=images/arrow.jpg>&nbsp;<a href="add_adres.php?clen='.$id.'" class=odkaz>přidat adresu</a>
92';
93}
94MySQL_Close($spojeni);
95?>
96</body>
97</html>

Powered by WebSVN 2.2.1