1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML LANG="it">
<HEAD>
<TITLE>OdontoLinux!</TITLE>
</HEAD>
<BODY MARGINWIDTH="0" MARGINHEIGHT="0" LEFTMARGIN="0" RIGHTMARGIN="0" TOPMARGIN="0"
BGCOLOR="#FFFFFF" TEXT="#000000"
LINK="#FF0033" VLINK="#FF0033" ALINK="#FF0033">
<? require("intestazione");?>
<TABLE>
<TR>
<TD width="300"><hr noshade></TD>
</TR>
</TABLE>
<TABLE>
<TR><TD width=550>Roma, <? $conn = pg_Connect ("host=127.0.0.1 port=5432 dbname=odontolinux");
if (!$conn) {
echo "Si è verificato un errore.\n";
} else {
$esito = pg_Exec($conn, "SELECT * FROM fattura where idfattura = '$idfatta';");
if (!$esito) {
echo "Si è verificato un errore.\n";
exit;
} // Errore interrogazione database
$nume = pg_NumRows($esito); //inizia l'output tabelare della query
$i = 0;
echo pg_Result($esito, $i, "data");
}
pg_FreeResult($esito); //liberazione memoria
pg_Close($conn);
?></TD>
</TR>
</TABLE>
<?
$conn = pg_Connect ("host=127.0.0.1 port=5432 dbname=odontolinux");
if (!$conn) {
echo "Si è verificato un errore.\n";
} else {
$esito = pg_Exec($conn, "SELECT * FROM anagrafica where id='$idpz';");
if (!$esito) {
echo "Si è verificato un errore.\n";
exit;
} // Errore interrogazione database
$num = pg_NumRows($esito); //inizia l'output tabelare della query
$i = 0;
while ($i < $num) {
echo "<table><tr><td width=550><b><FONT FACE=Lucida,Verdana,Helvetica,Arial>Fattura n</font></b> $idfatta <P></td><td><FONT FACE=Lucida,Verdana,Helvetica,Arial>";
echo pg_Result($esito, $i, cognome);
echo " ";
echo pg_Result($esito, $i, nome);
echo "</font></td></tr><tr><td> </td>";
echo "<td><FONT FACE=Lucida,Verdana,Helvetica,Arial>";
echo pg_Result($esito, $i, via);
echo "<BR>";
echo pg_Result($esito, $i, cap);
echo " - ";
echo pg_Result($esito, $i, citta);
echo "</font></td></tr><tr><td align=right>C.F./P.IVA:</td>";
echo "<td><FONT FACE=Lucida,Verdana,Helvetica,Arial>";
echo pg_Result($esito, $i, codicefiscale);
echo "</font></td></tr><tr><td align=right>Comune di nascita: </td><td><FONT FACE=Lucida,Verdana,Helvetica,Arial>";
echo pg_Result($esito, $i, luogonascita);
echo "</font></td></tr><tr><td align=right>Data di nascita: </td><td><FONT FACE=Lucida,Verdana,Helvetica,Arial>";
echo pg_Result($esito, $i, datanascita);
echo "</font></td></tr></table>";
$i++;
}
echo ("<P>");
}
pg_FreeResult($esito); //liberazione memoria
?>
<TABLE Border="0">
<TR>
<TD COLSPAN=4><HR NOSHADE></TD>
</TR>
<?
$esito = pg_Exec($conn, "SELECT * FROM fattura where idfattura = '$idfatta';");
if (!$esito) {
echo "Si è verificato un errore.\n";
exit;
} // Errore interrogazione database
$nume = pg_NumRows($esito); //inizia l'output tabelare della query
$i = 0;
$toto = 0;
while ($i < $nume) {
echo "<TR><TD width=450 colspan=2 align=left>";
echo pg_Result($esito, $i, "prestazione");
echo "</TD><TD colspan=2 align=right><b>";
echo pg_Result($esito, $i, "prezzomoltiplicato");
// $toto=$toto+pg_Result($esito, $i, "prezzomoltiplicato");
echo "</b></TD></TR>";
$i++;
} // Estrazione delle righe dell'interrogazione
pg_FreeResult($esito);
$esito2 = pg_Exec($conn, "SELECT sum(prezzomoltiplicato) from fattura where fattura.idfattura = '$idfatta';");
$riga = pg_fetch_row ($esito2, 0);
$totale= $riga[0];
pg_FreeResult($esito2);
pg_Close($conn); //chiusura connessione db
echo ("<tr><td height=290><p></td><td></td><td></td><td></td><td></td></tr>");
echo ("<tr><td colspan=4><hr noshade size=3></td></tr>");
echo ("<tr><td rowspan=4 align=center><FONT FACE=Lucida,Verdana,Helvetica,Arial size=-2>Marca<br>da<br>bollo</font> <td rowspan=4 width=300 align=center valign=top><FONT FACE=Lucida,Verdana,Helvetica,Arial>Per quietanza</font> <td width=200>Totale Prestazioni <td width=80 align=right>" . $totale);
echo ("<tr><td>Bollo <td align=right>2500");
echo ("<tr><td><b>Totale Fattura</b> <td align=right><b>" . ($totale + '2500'));
$euro = round ($totale / '1936');
echo ("</b><tr><td>Totale in Euro <td align=right>" . $euro);
echo ("</b><TR><TD colspan=4 ALIGN=CENTER><FONT FACE=\"Lucida,Verdana,Helvetica,Arial\" size=\"-2\">La ricevuta rilasciata per prestazioni sanitarie esente da IVA ai sensi dell'art. 10<BR>comma 1 n. 18 del D.P.R. 632/72, e successive modificazioni, soggetto a bollo di Lit. 2500 se l'importo supera le 150.000 lire</FONT></TD></TR>");
echo ("</table>");
?>
<P>
<? include("piede.php");?>
|