<?php
session_start();
if ($first_name>=1){
echo "Prego effettuare il login <a href=\"/contenuti.php\"> Qui<br>
&copy;Bloghosteria.com<br>
</a>";
}
 elseif  ( empty( $first_name ) ) {
?> Prego effettuare il login <a href="/contenuti.php"> Qui<br>
&copy;Bloghosteria.com<br>
</a>
<?php
} elseif ($first_name==$_SESSION['first_name']) { 
  include ("langselect.php");
  include ("config.php");
 echo "$lang0003, 
". $_SESSION['last_name'] ." <a href=logout.php> Logout</a><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;	
}
.style1 {
    color: #ff0000;
}

</style>  <p><a href=/sample2.php?last_name=$last_name>$lang0073</a> | 
<a href=Nuova_Fattura_Fornitore.php?Ragione_Sociale=$last_name>$lang0074</a> |
<a href=mailto:$emailwebm>$lang0006</a> | 
<a href= gestfattforn.php?Ragione_Sociale=$last_name>$lang0075</a></p>
<table align = center width=90%  border=1 cellspacing=0 cellpadding=1>
  <tr>
    <td width=10%><div align=center><font color=#999999><strong>$lang0076</strong></font></div></td>
    <td width=21%><div align=center><font color=#999999><strong>$lang0077</strong></font></div></td>
    <td width=19%><div align=center><font color=#999999><strong>$lang0078</strong></font></div></td>
    <td width=16%><div align=center><font color=#999999><strong>$lang0079</strong></font></div></td>
    <td width=15%><div align=center><font color=#999999><strong>$lang0080</strong></font></div></td>
    <td width=19%><div align=center><font color=#999999><strong>$lang0081 .jpg</strong></font></div></td>
</tr>";


   
mysql_connect("$hhost","$login","$pass") or die ("Problem connecting to DataBase"); 
$query = "SELECT * FROM sd_fatture_acquisto WHERE Ragione_Sociale = '$Ragione_Sociale'";
$result = mysql_db_query("$dbname", $query); 
if ($result) { 

while ($r = mysql_fetch_array($result)) { 
$Ragione_Sociale = $r["Ragione_Sociale"];
$N_Fattura = $r["N_Fattura"];
$Data_Fattura = $r["Data_Fattura"];
$Scadenza = $r["Scadenza"];
$Totale = $r["Totale"];
$Note = $r["Note"];

echo" <tr>
    <td width=9%><div align=center>$N_Fattura</div></td>
    <td width=23%><div align=center>$Ragione_Sociale</div></td>
    <td width=17%><div align=center>$Totale</div></td>
    <td width=17%><div align=center>$Data_Fattura</div></td>
    <td width=16%><div align=center>$Scadenza</div></td>
    <td width=18%><div align=center><a href=$Note target=_blank>Clicca qui</a></div></td>
</tr>";


}

	 
	  
} else {
echo "There are not invoices.";
}


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