jablonka.czprosek.czf

is

Subversion Repositories:
[/] [trunk/] [html/] [edit_user.php] - Blame information for rev 7

 

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

Powered by WebSVN 2.2.1