jablonka.czprosek.czf

is

Subversion Repositories:
[/] [trunk/] [html/] [edit_user.php] - Rev 2

Compare with Previous - Blame - Download


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<style type="text/css" media="screen"> @import "style.css"; </style>
<title>Editace uživatele</title>
</head>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body topmargin=0 leftmargin=10>
<?
include("header.htm");
require('grab_globals.lib.php');
include ("fce.php");
$spojeni = MySQL_Connect($db_host, $db_user, $db_pass);
MySQL_Select_DB($db_name);
if(!@$action)
{
$dotaz=MySQL_Query("SELECT * FROM cleni WHERE id='$id' ");
$pocet_obyvatel=MySQL_Num_Rows($dotaz);
$dotaz=MySQL_Fetch_Array($dotaz);

echo '
<b>Editace uživatele '.id_to_name($id).':</b><br>
<form action="edit_user.php?action=save" method=POST>
<table>
  <tr>
     <td class=text>jméno:</td><td><input class=field name="jmeno" type="text" value="'.$dotaz["jmeno"].'" size=25></td>
     <td class=text>příjmení:</td><td><input class=field name="prijmeni" type="text" value="'.$dotaz["prijmeni"].'" size=25></td>
  </tr>
  <tr>
     <td class=text>přezdívka:</td><td><input class=field name="prezdivka" type="text" value="'.$dotaz["prezdivka"].'" size=25></td>
     <td class=text>narozen:</td><td><input class=field name="narozen" type="text" value="'.$dotaz["narozen"].'" size=25></td>
  </tr>
  <tr>
     <td class=text>domu:</td><td><input class=field name="domu" type="text" value="'.$dotaz["domu"].'" size=25></td>
     <td class=text>mobil:</td><td><input class=field name="mobil" type="text" value="'.$dotaz["mobil"].'" size=25></td>
  </tr>
  <tr>
     <td class=text>email:</td><td><input class=field name="email" type="text" value="'.$dotaz["email"].'" size=25></td>
     <td class=text>ICQ:</td><td><input class=field name="icq" type="text" value="'.$dotaz["icq"].'" size=25></td>
  </tr>
  <tr>
     <td class=text>var.symb.:</td><td><input class=field name="vs" type="text" value="'.$dotaz["vs"].'" size=25></td>
  </tr>
  <tr><td colspan=3 class=text>poznámka:<br>
  <textarea class=fieldthin name="komentar" rows=3 cols=40>'.$dotaz["komentar"].'</textarea></td>
     <td class=text>finance:&nbsp;&nbsp;
     <input class=radio name="finance" type="radio" ';if($dotaz["finance"]==1){ echo 'checked';} echo ' value="1"> ano
     &nbsp;&nbsp;<input class=radio name="finance" type="radio" ';if($dotaz["finance"]==0){ echo 'checked';} echo ' value="0"> ne
     <br>
     internet:&nbsp;&nbsp;
     <input class=radio name="internet" type="radio" ';if($dotaz["internet"]==1){ echo 'checked';} echo ' value="1"> ano
     &nbsp;&nbsp;<input class=radio name="internet" type="radio" ';if($dotaz["internet"]==0){ echo 'checked';} echo ' value="0"> ne
     <br>
     elektřina:&nbsp;&nbsp;
     <input class=radio name="energy" type="radio" ';if($dotaz["energy"]==2){ echo 'checked';} echo ' value="2"> ano
     &nbsp;&nbsp;<input class=radio name="energy" type="radio" ';if($dotaz["energy"]==1){ echo 'checked';} echo ' value="1"> ano - sleva
     &nbsp;&nbsp;<input class=radio name="energy" type="radio" ';if($dotaz["energy"]==0){ echo 'checked';} echo ' value="0"> ne
     <br>
     aktivní:&nbsp;&nbsp;
     <input class=radio name="active" type="radio" ';if($dotaz["active"]==1){ echo 'checked';} echo ' value="1"> ano
     &nbsp;&nbsp;<input class=radio name="active" type="radio" ';if($dotaz["active"]==0){ echo 'checked';} echo ' value="0"> ne
     </td>
  </tr>
</table>
<input class=field type="submit" name="OK" value="&nbsp;ulož změny&nbsp;">
<input name="id" type="hidden" value="'.$id.'">
</form>
';
}
else
{
$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'");

if (!$result) {
echo "<br><b>Výsledek : ".mysql_error()."</b>";
} else {
echo "<br><b>Záznam uživatele <a href=\"clen.php?clen=".$id."\">".id_to_name($id)."</a> byl úspěšně změněn!</b>";
}

echo '
<br>
<br>
<img src=images/arrow.jpg>&nbsp;<a href="javascript:history.go(-2)" class=odkaz>zpět</a>
';
}


MySQL_Close($spojeni);
?>
</body>
</html>

Powered by WebSVN 2.2.1