<?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;	
}
</style>
<p><a href=\"sample.php?last_name=$Ragione_Sociale\">$lang0004</a> | 
<a href=\"clgestord.php?Ragione_Sociale=$last_name\">$lang0005</a> |
<a href=mailto:$emailwebm>$lang0006</a> | 
<a href=\"gestpag.php?Ragione_Sociale=$last_name\">$lang0007</a></p>";


   echo"<p align=center> 
<div align=center>";
if ($pagam=="crtcc"){
echo"<form name=Conferma_Pagamento action=https://secure.paypal.com/cgi-bin/webscr method=post>
<input type=hidden name=cmd value=_xclick>
<input type=hidden name=business value=\"$emailwebm\">
<input type=hidden name=item_name value=\"$Ordini\">
<input type=hidden name=amount value=\"$ImpPag\">
<input type=hidden name=shipping value=10.0>
<input type=hidden name=currency_code value=EUR>
<input type=hidden name=return value=".$fullindlash."pagpaypal.php?Ragione_Sociale=$Ragione_Sociale>
<input type=hidden name=cancel_return value=".$fullindlash."sample.php?last_name=$Ragione_Sociale>
<input type=submit name=Submit value=\"$lang0051\">
</form>";
} elseif ($pagam=="bonif"){
echo " <p>$lang0052 $ImpPag $lang0053</p>";
 		
mysql_connect("$hhost","$login","$pass") or die ("Problem connecting to DataBase");
$query = "SELECT * FROM sd_banche ";
$result = mysql_db_query("$dbname", $query);
if ($result) {
echo"<form  method=post action=pagscelto.php>
<table width=590 border=1 cellspacing=0 cellpadding=1>
 <tr>
    <td width=80><div align=center>$lang0054</div></td>
    <td width=53><div align=center>Cin</div></td>
    <td width=154><div align=center>$lang0038</div></td>
    <td width=69><div align=center>Abi</div></td>
    <td width=71><div align=center>Cab</div></td>
    <td width=43><div align=center>c/c n</div></td>
    <td width=60><div align=center>$lang0055</div></td>
    <td width=60><div align=center>Sel.</div></td>
  </tr>";
while ($r = mysql_fetch_array($result)) {
$ID_Banca = $r["ID_Banca"];
$Banca = $r["Banca"];
$Indirizzo = $r["Indirizzo"];
$Agenzia = $r["Agenzia"];
$Abi = $r["Abi"];
$Cab = $r["Cab"];
$Conto = $r["Conto"];
$Titolare = $r["Titolare"];

echo"
<tr>
    <td width=80><div align=center>$Banca</div></td>
    <td width=53><div align=center>$Agenzia</div></td>
    <td width=154><div align=center>$Indirizzo</div></td>
    <td width=69><div align=center>$Abi</div></td>
    <td width=71><div align=center>$Cab</div></td>
    <td width=43><div align=center>$Conto</div></td>
    <td width=60><div align=center>$Titolare</div></td>
    <td width=60><div align=center>
	<input name=Ragione_Sociale type=hidden value=\"$Ragione_Sociale\">
	<input name=Total type=hidden value=\"$ImpPag\">
	<input name=Tipo_Pagamento type=radio value=\"$ID_Banca\"></div></td>
    <input name=Ordini type=hidden value=\"$Ordini\">
  </tr>";

}
echo "</table>";
echo"<input type=submit name=Submit value=$lang0056>
</form>";

}

} elseif($pagam=="contras") {
echo"<p></p><p align=center>$lang0057 $ImpPag + s.p.</p>
<p align=center>$lang0058</p><p align=center>
<form  method=post action=pagscelto.php>
<p><input name=Ragione_Sociale type=hidden value=\"$Ragione_Sociale\"> 
<input name=Tipo_Pagamento type=hidden value=Contras>
<input name=Ordini type=hidden value=\"$Ordini\">
<input name=Total type=hidden value=\"$ImpPag\">
<input type=submit name=Submit value=$lang0056>
</form></p>";
}



echo "<p>$lang0059</p>";

mysql_connect("$hhost","$login","$pass") or die ("Problem connecting to DataBase");
$query = "SELECT * FROM users where last_name='$Ragione_Sociale' ";
$result = mysql_db_query("$dbname", $query);
if ($result) {
while ($r = mysql_fetch_array($result)) {
$last_name = $r["last_name"];
$cogn = $r["cogn"];
$nome = $r["nome"];
$via = $r["via"];
$citta = $r["citta"];
$prov = $r["prov"];
$cap = $r ["cap"];

echo"<p> $lang0035 $last_name</p>
<p>$lang0060 $cogn $nome</p>
<p>$via</p>
<p>$cap $citta $prov</p>";
}

}

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