jablonka.czprosek.czf

is

Subversion Repositories:
[/] [trunk/] [html/] [add_adres.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>
<?
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)
{
echo '
<title>db.jablonka.cz - Přidání IP adresy pro člena '.id_to_name($clen).' </title>
</head>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body topmargin=0 leftmargin=10>
<b>Přidání adresy uživatele: <a class="odkaz" target="_self" href="clen.php?clen='.$clen.'">'.id_to_name($clen).'</a></b><br>

<form action="add_adres.php?action=save" method=POST>
<table>
  <tr>
     <td class=text>Ulice:</td><td><input class=field name="ulice" type="text" value="" size=25></td>
     <td class=text>Město:</td><td><input class=field name="mesto" type="text" value="" size=25></td>
  </tr>
  <tr>
     <td class=text>č.p.:</td><td><input class=field name="cp" type="text" value="" size=25></td>
     <td class=text>PSČ:</td><td><input class=field name="psc" type="text" value="" size=25></td>
  </tr>
  <tr>
     <td class=text>Byt:</td><td><input class=field name="byt" type="text" value="" size=25></td>
  </tr>
  <tr>
     <td class=text>šířka:</td><td><input class=field name="sirka" type="text" value="" size=25></td>
     <td class=text>délka:</td><td><input class=field name="delka" type="text" value="" size=25></td>
     <td class=text>výška:</td><td><input class=field name="vyska" type="text" value="" size=25></td>
  </tr>
  <tr>
     <td class=text>otočení:</td><td><input class=field name="otoceni" type="text" value="" size=25></td>
     <td class=text>náklon:</td><td><input class=field name="naklon" type="text" value="" size=25></td>
  </tr>
  <tr>

    <td class=text>objekt:</td>
    <td colspan=5>
      <select class=field name="objekt">'."\n";
      #vypis vsech moznosti a predvybrani podle clena
      $string=MySQL_Query("SELECT * FROM objekty ORDER BY id");
      echo '<option value=null>není</option>';
      while($vysledek=MySQL_Fetch_Array($string))
      {
        echo '<option value='.$vysledek["id"].'>'.substr($vysledek["nazev"]." (".$vysledek["komentar"],0,100).')</option>'."\n";
      }
      echo '
      </select>
    </td>
  </tr>
  <tr>
     <td class=text></td><td><textarea class=fieldthin name="komentar" rows=3 cols=40></textarea></td>
  </tr>

</table>
<input class=field type="submit" name="OK" value="&nbsp;vytvoř adresu&nbsp;">
<input name="clen" type="hidden" value="'.$clen.'">
</form>
';
}
else
{
$dbid=MySQL_Query("SELECT MAX(id) FROM adresy");
$dbid=MySQL_Fetch_Array($dbid);
$id=$dbid["MAX(id)"];
$id++;

$result = MySQL_Query("INSERT INTO adresy VALUES ('$id','$clen','$mesto','$ulice','$cp','$psc','$byt','$komentar','$sirka','$delka','$vyska','$otoceni','$naklon','$objekt')");

if (!$result) {
echo "<br><b>Výsledek : ".mysql_error()."</b>";
} else {
echo '
<br><b>Adresa '.$ulice.' '.$cp.' uživatele <a class="odkaz" target="_self" href="clen.php?clen='.$clen.'">'.id_to_name($clen).'</a> byla úspěšně přidána!</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_ip.php?clen='.$clen.'&adresa='.$id.'" class=odkaz>přidat IP adresu</a>
';
}
MySQL_Close($spojeni);
?>
</body>
</html>

Powered by WebSVN 2.2.1