<?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 class=style5>Dati Modificati</p>";

include 'config.php';
mysql_connect("$hhost","$login","$pass") or die ("Problem connecting to DataBase");

$query = "update users  set  first_name='$first_name', last_name='$last_name', cogn='$cogn', nome='$nome', email_address='$email_address', via='$via', citta='$citta', prov='$prov', cap='$cap', piva='$piva', codfisc='$codfisc', telef='$telef', fax='$fax' WHERE last_name='$last_name'";
$result = mysql_db_query("$dbname", $query);



echo"<table width=300 border=1 cellspacing=0 cellpadding=0.3>
  <tr>
    <td width=89>Ditta</td>
    <td width=205>$last_name</td>
  </tr>
  <tr>
    <td width=89>Cognome</td>
    <td width=205>$cogn</td>
  </tr>
  <tr>
    <td width=89>Nome</td>
    <td width=205>$nome</td>
  </tr>
  <tr>
    <td>Via</td>
    <td>$via</td>
  </tr>
  <tr>
    <td>Citt&agrave;</td>
    <td>$citta</td>
  </tr>
  <tr>
    <td>Prov/state</td>
    <td>$prov</td>
  </tr>
  <tr>
    <td>Cap</td>
    <td>$cap</td>
  </tr>
  <tr>
    <td>P.Iva</td>
    <td>$piva</td>
  </tr>
  <tr>
    <td>Cod. Fisc.</td>
    <td>$codfisc</td>
  </tr>
  <tr>
    <td>Tel.</td>
    <td>$telef</td>
  </tr>
  <tr>
    <td>Fax</td>
    <td>$fax</td>
  </tr>
    <tr>
    <td>email</td>
    <td>$email_address</td>
  </tr>
</table>";
if ($first_name=="Cli"){
$motreg="regamm.php";
} else {
$motreg="regamm2.php";
}
 echo "<form name=form1 method=post action=$motreg>
 
        
     
	
  
      <input name=form[Ragione_Sociale] type=hidden value=\"$last_name\" id=Ragione_sociale maxlength=100 size=50 >
	  <input name=form[Cognome] type=hidden value=$cogn id=Cognome >
	  <input name=form[Nome] type=hidden value=$nome id=Nome>

      <input name=form[PI] type=hidden value=$piva id=PI maxlength=16 size=12>
	  <input name=form[CF] type=hidden value=$codfisc id=CF>

     <input name=form[Indirizzo] type=hidden value=\"$via\" id=indirizzo maxlength=60 size=50>
    
      <input name=form[Citta] type=hidden value=$citta id=citta maxlength=60 size=50>
   
      <input name=form[Provincia] type=hidden value=$prov id=prov maxlength=2 size=2>

      <input name=form[CAP] type=hidden value=$cap id=cap maxlength=5 size=5>
   
      <input name=form[Telefono] type=hidden value=$telef id=telefono maxlength=20 size=20>
  
      <input name=form[Fax] type=hidden value=$fax id=fax maxlength=20 size=20>

     <input name=form[E_mail] type=hidden value=$email_address id=email>
 
      <input type=submit name=Submit value=submit>
  

</form>
<p> Clicca su submit per confermare oppure se errato <a href=\"modfdati2.php?userid=$userid&last_name=$last_name\">clicca qui</a> per reinserire i dati.";

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