jablonka.czprosek.czf

is

Subversion Repositories:
[/] [trunk/] [html/] [edit_ip.php] - Blame information for rev 8

 

Line No. Rev Author Line
12simandl<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2<html>
3<head>
4<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
5<style type="text/css" media="screen"> @import "style.css"; </style>
6<title>Editace ípéčka</title>
7</head>
8<link rel="stylesheet" type="text/css" href="style.css">
9</head>
10<body topmargin=0 leftmargin=10>
11<?
12include("header.htm");
13require('grab_globals.lib.php');
14include ("fce.php");
15$spojeni = MySQL_Connect($db_host, $db_user, $db_pass);
16MySQL_Select_DB($db_name);
17if(!@$action)
18{
19$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' ");
20$dotaz=MySQL_Fetch_Array($dotaz);
21echo '
22<b>Editace ípéčka:</b><br>
23<br>
24 
25<form action="edit_ip.php?action=save" method=POST>
26<table>
27 <tr>
28 <td class=text>Uživatel:</td><td>'.$dotaz["jmeno"]." ".$dotaz["prijmeni"].'</td>
29 <td class=text><a href=del_ip.php?id='.$id.'>Smazat tuto IP adresu!</a></td>
30 </tr>
31 <tr>
32 <td class=text>Adresa:</td><td>'.$dotaz["ulice"]." ".$dotaz["cp"].'</td>
33 </tr>
34 <tr>
35 <td class=text>DNS:</td><td><input class=field name="dns" type="text" value="'.$dotaz["dns"].'" size=25></td>
36 </tr>
37 <tr>
38 <td class=text>MAC:</td><td><input class=field name="mac" type="text" value="'.$dotaz["mac"].'" size=25></td>
39 </tr>
40 <tr>
41 <td class=text>IP:</td><td><input class=field name="ip" type="text" value="'.$dotaz["ip"].'" size=25></td>
42 </tr>
43 <tr><td class=text></td><td><textarea class=fieldthin name="komentar" rows=10 cols=45>'.$dotaz["ikomentar"].'</textarea></td></tr>
44 
45</table>
46<br><br>
47<input class=field type="submit" name="OK" value="&nbsp;ulož změny&nbsp;">
48<input name="id" type="hidden" value="'.$id.'">
49<input name="clen" type="hidden" value="'.$dotaz["clen"].'">
50<input name="adresa" type="hidden" value="'.$dotaz["adresa"].'">
51</form>
52';
53}
54else
55{
56$result = MySQL_Query("UPDATE ipecka SET clen='$clen',adresa='$adresa',dns='$dns',mac='$mac',ip='$ip',komentar='$komentar' WHERE id='$id'");
57 
58if (!$result) {
59echo "<br><b>Výsledek : ".mysql_error()."</b>";
60} else {
61echo "<br><b>Ipéčko uživatele ".id_to_name($clen)." bylo úspěšně změněno!</b>";
62}
63 
64echo '
65<br>
66<br>
67<img src=images/arrow.jpg>&nbsp;<a href="javascript:history.go(-2)" class=odkaz>zpět</a>
68';
69}
70 
71MySQL_Close($spojeni);
72?>
73</body>
74</html>

Powered by WebSVN 2.2.1