jablonka.czprosek.czf

is

Subversion Repositories:
[/] [trunk/] [html/] [add_user.php] - Rev 8 Go to most recent revision

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">
<?
require('grab_globals.lib.php');
?>
<style type="text/css" media="screen"> @import "style.css"; </style>
<title>db.jablonka.cz - Přidání uživatele</title>
</head>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body topmargin=0 leftmargin=10>
<?
include("header.htm");
include ("fce.php");
$spojeni = MySQL_Connect($db_host, $db_user, $db_pass);
MySQL_Select_DB($db_name);
if(!@$action)
{
$dbid=MySQL_Query("SELECT MAX(id) FROM cleni");
$dbid=MySQL_Fetch_Array($dbid);
$nove_id=$dbid["MAX(id)"]+1;
echo '
<b>Přidání uživatele:</b><br>

<form action="add_user.php?action=save" method=POST>
<table>
  <tr>
     <td class=text>jméno:</td><td><input class=field name="jmeno" type="text" value="" size=25></td>
     <td class=text>příjmení:</td><td><input class=field name="prijmeni" type="text" value="" size=25></td>
  </tr>
  <tr>
     <td class=text>přezdívka:</td><td><input class=field name="prezdivka" type="text" value="" size=25></td>
     <td class=text>narozen:</td><td><input class=field name="narozen" type="text" value="" size=25></td>
  </tr>
  <tr>
     <td class=text>domu:</td><td><input class=field name="domu" type="text" value="" size=25></td>
     <td class=text>mobil:</td><td><input class=field name="mobil" type="text" value="" size=25></td>
  </tr>
  <tr>
     <td class=text>email:</td><td><input class=field name="email" type="text" value="" size=25></td>
     <td class=text>ICQ:</td><td><input class=field name="icq" type="text" value="" size=25></td>
  </tr>
  <tr>
     <td class=text>var.symb.:</td><td><input class=field name="vs" type="text" value="1100'.$nove_id.'" size=25></td>
  </tr>
  <tr><td colspan=3 class=text>poznámka<br>
     <textarea class=fieldthin name="komentar" rows=3 cols=40></textarea>
     </td>
     <td class=text>finance:
     &nbsp;&nbsp;<input class=radio name="finance" type="radio" checked value="1"> ano
     &nbsp;&nbsp;<input class=radio name="finance" type="radio" value="0"> ne
     <br>internet:
     &nbsp;&nbsp;<input class=radio name="internet" type="radio" checked value="1"> ano
     &nbsp;&nbsp;<input class=radio name="internet" type="radio" value="0"> ne
     <br>elektřina:
     &nbsp;&nbsp;<input class=radio name="energy" type="radio" checked value="2"> ano
     &nbsp;&nbsp;<input class=radio name="energy" type="radio" value="1"> ano - sleva
     &nbsp;&nbsp;<input class=radio name="energy" type="radio" value="0"> ne
     <br>
     aktivní:
     &nbsp;&nbsp;<input class=radio name="active" type="radio" checked value="1"> ano
     &nbsp;&nbsp;<input class=radio name="active" type="radio" value="0"> ne
     </td>
  </tr>
</table>
<input class=field type="submit" name="OK" value="&nbsp;vytvoř uživatele&nbsp;">
</form>
';
}
else
{
$dbid=MySQL_Query("SELECT MAX(id) FROM cleni");
$dbid=MySQL_Fetch_Array($dbid);
$id=$dbid["MAX(id)"];
$id++;

$result = MySQL_Query("INSERT INTO cleni VALUES ('$id','$prezdivka','$jmeno','$prijmeni','$narozen','$domu','$mobil','$email','$icq','$komentar','$active','$finance','$energy','$internet','$vs')");

if (!$result) {
echo "<br><b>Výsledek : ".mysql_error()."</b>";
} else {
echo "<br><b>Uživatel ".$jmeno." ".$prijmeni." byl úspěšně přidán!</b>";
}

echo '
<br>
<br>
<img src=images/arrow.jpg>&nbsp;<a href="javascript:history.go(-2)" class=odkaz>zpět</a>
<img src=images/arrow.jpg>&nbsp;<a href="add_adres.php?clen='.$id.'" class=odkaz>přidat adresu</a>
';
}
MySQL_Close($spojeni);
?>
</body>
</html>

Powered by WebSVN 2.2.1