jablonka.czprosek.czf

is

Subversion Repositories:
[/] [trunk/] [html/] [edit_ip.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 ípéčka</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 i.id as iid, i.komentar as ikomentar, i.*,a.id as aid, a.*, c.id as cid, c.* FROM (ipecka i LEFT JOIN adresy a ON i.adresa = a.id)LEFT JOIN cleni c ON i.clen = c.id WHERE i.id='$id' ");
$dotaz=MySQL_Fetch_Array($dotaz);
echo '
<b>Editace ípéčka:</b><br>
<br>

<form action="edit_ip.php?action=save" method=POST>
<table>
  <tr>
     <td class=text>Uživatel:</td><td>'.$dotaz["jmeno"]." ".$dotaz["prijmeni"].'</td>
     <td class=text><a href=del_ip.php?id='.$id.'>Smazat tuto IP adresu!</a></td>
  </tr>
  <tr>
     <td class=text>Adresa:</td><td>'.$dotaz["ulice"]." ".$dotaz["cp"].'</td>
  </tr>
  <tr>
     <td class=text>DNS:</td><td><input class=field name="dns" type="text" value="'.$dotaz["dns"].'" size=25></td>
  </tr>
  <tr>
     <td class=text>MAC:</td><td><input class=field name="mac" type="text" value="'.$dotaz["mac"].'" size=25></td>
  </tr>
  <tr>
     <td class=text>IP:</td><td><input class=field name="ip" type="text" value="'.$dotaz["ip"].'" size=25></td>
  </tr>
  <tr><td class=text></td><td><textarea class=fieldthin name="komentar" rows=10 cols=45>'.$dotaz["ikomentar"].'</textarea></td></tr>

</table>
<br><br>
<input class=field type="submit" name="OK" value="&nbsp;ulož změny&nbsp;">
<input name="id" type="hidden" value="'.$id.'">
<input name="clen" type="hidden" value="'.$dotaz["clen"].'">
<input name="adresa" type="hidden" value="'.$dotaz["adresa"].'">
</form>
';
}
else
{
$result = MySQL_Query("UPDATE ipecka SET clen='$clen',adresa='$adresa',dns='$dns',mac='$mac',ip='$ip',komentar='$komentar' WHERE id='$id'");

if (!$result) {
echo "<br><b>Výsledek : ".mysql_error()."</b>";
} else {
echo "<br><b>Ipéčko uživatele ".id_to_name($clen)." bylo úspěšně změněno!</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