jablonka.czprosek.czf

is

Subversion Repositories:
[/] [trunk/] [html/] [add_ip.php] - Rev 6 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">
<style type="text/css" media="screen"> @import "style.css"; </style>
<title>add ip</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)
{

if (!@$adresa) {
echo "<br><b>Není nalezena adresa pro umístění IP adresy!</b>";
} else {
echo '
<b>Přidání IP adresy pro uživatele <a class="odkaz" target="_self" href="clen.php?clen='.$clen.'">'.id_to_name($clen).'</a> :</b><br>

<form action="add_ip.php?action=save" method=POST>
<table>
  <tr>
     <td class=text>DNS:</td><td><input class=field name="dns" type="text" value="" size=25></td>
  </tr>
  <tr>
     <td class=text>MAC:</td><td><input class=field name="mac" type="text" value="" size=25></td>
  </tr>
  <tr>
     <td class=text>IP:</td><td><input class=field name="ip" type="text" value="" size=25></td>
  </tr>
  <tr><td class=text></td><td><textarea class=fieldthin name="komentar" rows=10 cols=45></textarea></td></tr>

</table>
<br><br>
<input class=field type="submit" name="OK" value="&nbsp;vytvoř ipéčko&nbsp;">
<input name="clen" type="hidden" value="'.$clen.'">
<input name="adresa" type="hidden" value="'.$adresa.'">
</form>
';
}

}
else
{
$test=MySQL_Query("SELECT MAX(id) FROM ipecka");
$test=MySQL_Fetch_Array($test);
$id=$test["MAX(id)"];
$id++;

$result = MySQL_Query("INSERT INTO ipecka VALUES ('$id','$clen','$adresa','$dns','$mac','$ip','$komentar')");

if (!$result) {
echo "<br><b>Výsledek : ".mysql_error()."</b>";
} else {
echo '
<br><b>Ipéčko uživatele <a class="odkaz" target="_self" href="clen.php?clen='.$clen.'">'.id_to_name($clen).'</a> bylo úspěšně přidáno!</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="seznam.php" class=odkaz>zpět na seznam</a>

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

Powered by WebSVN 2.2.1