<?php
session_start();
if ($finame>=1){
echo "Prego effettuare il login <a href=\"/admin/index.php\"> Qui<br>
&copy;Bloghosteria.com<br>
</a>";
}
 elseif  ( empty( $finame ) ) {
?> Prego effettuare il login <a href="/admin/index.php"> Qui<br>
&copy;Bloghosteria.com<br>
</a>
<?php
} elseif ($finame==$_SESSION['finame']) { 

include ("headnavadmin.php");
echo "<style type=\"text/css\">

a:link, a:visited {
	color: #009933; text-decoration: none;
	font-weight: bold;
}

a:hover {
	color: #ff6600;	text-decoration: none;
	font-weight: bold;	
}
.style2 {
color: #009933;
font-weight: bold;
}
.style3 {
color: #000000;

}
.style5 {
	color: #ff0000;
	font-size: 24px;
}
</style>
<p class=style2>Salve, 
". $_SESSION['laname'] ."  <a href=logout.php> Logout</a></p><p align=center class=style5>Modifica i dati.</p>";
include ("config.php");
mysql_connect("$hhost","$login","$pass") or die ("Problem connecting to DataBase");  
$query = "SELECT * FROM users where last_name='$last_name' "; 
$result = mysql_db_query("$dbname", $query); 

if ($result) { 
  


while ($r = mysql_fetch_array($result)) {
$userid = $r["userid"];
$first_name = $r["first_name"];
$nome = $r["nome"];
$cogn = $r["cogn"];
$email_address = $r["email_address"];
$last_name = $r["last_name"];
$via = $r["via"];
$citta = $r["citta"];
$prov = $r["prov"];
$cap = $r["cap"];
$piva = $r["piva"];
$codfisc = $r["codfisc"];
$telef = $r["telef"];
$fax = $r["fax"];
 
 echo "<html>
<head>
<style type=\"text/css\">

a:link, a:visited {
	color: #009933; text-decoration: none;
	font-weight: bold;
}

a:hover {
	color: #ff6600;	text-decoration: none;
	font-weight: bold;	
}
.style2 {
color: #009933;
font-weight: bold;
}
.style3 {
color: #FF0000;
font-weight: bold;
}
</style>
<title></title>
</head>
<body>
<p><a href=/admin/amministrazione.php>Index Admin</a></p>
<form name=form1 method=post action=update2.php>

  <table width=100% border=0 cellpadding=4 cellspacing=0>
  <tr>
    
      <td><input name=userid type=hidden value=$userid id=userid></td>
    </tr>
    <tr>
      <tr>
    
      <td><input name=first_name type=hidden value=$first_name id=first_name></td>
    </tr>
    <tr>
      <td align=left valign=top>Ditta</td>
      <td><input name=last_name type=text value=\"$last_name\" id=last_name></td>
    </tr>
	 
	
	<tr>
      <td align=left valign=top>Cognome</td>
      <td><input name=cogn type=text value=\"$cogn\" id=piva></td>
    </tr>
	<tr>
      <td align=left valign=top>Nome</td>
      <td><input name=nome type=text value=\"$nome\" id=piva></td>
    </tr>
	<tr>
      <td align=left valign=top>P. Iva</td>
      <td><input name=piva type=text value=$piva id=piva></td>
    </tr>
	<tr>
      <td align=left valign=top>Cod. Fisc.</td>
      <td><input name=codfisc type=text value=$codfisc id=piva></td>
    </tr>
	<tr>
      <td align=left valign=top>Via</td>
      <td><input name=via type=text value=\"$via\" id=via></td>
    </tr>
	<tr>
      <td align=left valign=top>Citt&agrave;</td>
      <td><input name=citta type=text value=\"$citta\" id=citta></td>
    </tr>
	<tr>
      <td align=left valign=top>Prov/stato</td>
      <td><input name=prov type=text value=\"$prov\" id=prov></td>
    </tr>
	<tr>
      <td align=left valign=top>Cap</td>
      <td><input name=cap type=text value=$cap id=cap></td>
    </tr>
	<tr>
      <td align=left valign=top>Tel.</td>
      <td><input name=telef type=text value=$telef id=telef></td>
    </tr>
	<tr>
      <td align=left valign=top>Fax</td>
      <td><input name=fax type=text value=$fax id=fax></td>
    </tr>
    <tr>
      <td align=left valign=top>Email</td>
      <td><input name=email_address type=text value=$email_address id=email_address></td>
    </tr>
   
    
      <td align=left valign=top>&nbsp;</td>
      <td><input type=submit name=Submit value=Aggiorna></td>
    </tr>
  </table>
</form>

</body>
</html>"; 
} 
 

} else { 

echo "No data."; 

} 

mysql_free_result($result); 

} else {
echo "Prego effettuare il login <a href=\"/admin/index.php\"> Qui<br>
&copy;Bloghosteria.com<br>
</a>";
}

?> 
