jablonka.czprosek.czf

is

Subversion Repositories:
[/] [trunk/] [html/] [edit_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>
<title>Editace adresy</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 adresy WHERE id='$id' ");
$dotaz=MySQL_Fetch_Array($dotaz);
echo '
<b>Editace adresy:</b><br>
<br>
<form action="edit_adres.php?action=save" method=POST>
<table>
  <tr>
     <td class=text>Uživatel:</td><td><b>'.id_to_name($dotaz["clen"]).'</b></td>
    <td></td>
    <td></td>
     <td class=text colspan=2><a href=del_adres.php?id='.$id.'>Smazat tuto adresu!</a></td>
  </tr>
  <tr>
     <td class=text>Ulice:</td><td><input class=field name="ulice" type="text" value="'.$dotaz["ulice"].'" size=25></td>
     <td class=text>Město:</td><td><input class=field name="mesto" type="text" value="'.$dotaz["mesto"].'" size=25></td>
  </tr>
  <tr>
     <td class=text>č.p.:</td><td><input class=field name="cp" type="text" value="'.$dotaz["cp"].'" size=25></td>
     <td class=text>PSČ:</td><td><input class=field name="psc" type="text" value="'.$dotaz["psc"].'" size=25></td>
  </tr>
  <tr>
     <td class=text>Byt:</td><td><input class=field name="byt" type="text" value="'.$dotaz["byt"].'" size=25></td>
  </tr>
  <tr>
    <td class=text>šířka:</td><td><input class=field name="sirka" type="text" value="'.$dotaz["sirka"].'" size=25></td>
    <td class=text>délka:</td><td><input class=field name="delka" type="text" value="'.$dotaz["delka"].'" size=25></td>
    <td class=text>výška:</td><td><input class=field name="vyska" type="text" value="'.$dotaz["vyska"].'" size=25></td>
  </tr>
  <tr>
    <td class=text>otočení:</td><td><input class=field name="otoceni" type="text" value="'.$dotaz["otoceni"].'" size=25></td>
    <td class=text>náklon:</td><td><input class=field name="naklon" type="text" value="'.$dotaz["naklon"].'" 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 '; if($dotaz["objekt"]==$vysledek["id"]){ echo 'selected';} 
        echo' 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=10 cols=45>'.$dotaz["komentar"].'</textarea></td>
  </tr>

</table>

<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"].'">
</form>
';
}
else
{
$result = MySQL_Query("UPDATE adresy SET clen='$clen',mesto='$mesto',ulice='$ulice',cp='$cp',psc='$psc',byt='$byt',komentar='$komentar' WHERE id='$id'");

if (!$result) {
echo "<br><b>Výsledek : ".mysql_error()."</b>";
} else {
echo "<br><b>Adresa uživatele ".id_to_name($clen)." byla úspěšně upravena!</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