File: stampapianocura.php

package info (click to toggle)
odontolinux 0.6.1-6
  • links: PTS
  • area: main
  • in suites: woody
  • size: 1,128 kB
  • ctags: 566
  • sloc: php: 4,137; sh: 262; makefile: 46
file content (132 lines) | stat: -rw-r--r-- 4,741 bytes parent folder | download | duplicates (2)
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
124
125
126
127
128
129
130
131
132
<BODY bgcolor="#FFFFFF">
<b>
<? echo gettext ("Enclosed"); ?>
&nbsp;n. 1&nbsp;&nbsp;</b> - <B>&nbsp;&nbsp;
<? echo gettext ("Patient's treatment plan and related charges."); ?>
</B>

<P>
<table width="80%">


 <tr>
  <td>
    <? require("intestazione");?>
  </td>

  <td>
   <? 
   $conn = pg_Connect ("host=127.0.0.1 port=5432 dbname=odontolinux");
   if (!$conn) {
                echo "Si &egrave; verificato un errore.\n";
               } else {
                       $esito = pg_Exec($conn, "SELECT cognome, nome FROM anagrafica where id='$idpz';");
                       if (!$esito) {
                                     echo "Si &egrave; verificato un errore.\n";
                                     exit;
                                     } // Errore interrogazione database
                       $num = pg_NumRows($esito); //inizia l'output tabelare della query
                       $i = 0;
                       while ($i < $num) {
                                            echo "<P><B>";
			echo gettext ("Surname:");
		           echo "</B>";
                                           echo pg_Result($esito, $i, cognome);
                                           echo "<P><B>";
			echo gettext ("Name:");
		           echo "</B>";
                                           echo pg_Result($esito, $i, nome);
                                           $i++;
                                          }
                      }
                pg_FreeResult($esito); //liberazione memoria
echo "<P>"; print (date ("d.m.Y"));
?>

  </td>
 </tr>
</table>

<p>
<table>
	<hr noshade size="2" width="90%">
</table>

<P>
</CENTER>
<? echo gettext ("After a complete history, physical examination and the tests deemed necessary, a work-up plan with an estimate of the costs has been outlined."); ?>

<TABLE Border="0" cellpadding="5">
 <TR>
  <TH><u>
<? echo gettext ("Treatment"); ?>
</u></TH>
  <TH><u>
<? echo gettext ("Tooth/Region"); ?>
</u></TH>
  <TH><u>
<? echo gettext ("Q."); ?>
</u></TH>
  <TH><u>
<? echo gettext ("Charge/U"); ?>
</u></TH>
  <TH><u>
<? echo gettext ("Total charge"); ?>
</u></TH>
 </TR>


<? 
   $conn = pg_Connect ("host=127.0.0.1 port=5432 dbname=odontolinux");
   if (!$conn) {
                echo "Si &egrave; verificato un errore.\n";
               } else {

                $esito = pg_Exec($conn, "SELECT * FROM pianocura where pianocura.id = '$idpz' and vocepianocura = '$qualestampo';");
                if (!$esito) {
                              echo "Si &egrave; verificato un errore.\n";
                              exit;
                             } // Errore interrogazione database
                $nume = pg_NumRows($esito); //inizia l'output tabelare della query
                $i = 0;
                while ($i < $nume) {
                                    echo "<TR><TD><B>";
                                    echo pg_Result($esito, $i, "prestazione");
                                    echo "</B></TD><TD><I>";
                                    echo pg_Result($esito, $i, "posizione");
                                    echo "</I></TD><TD ALIGN=RIGHT NOSAVE>";
                                    echo pg_Result($esito, $i, "quantita");
                                    echo "</TD><TD ALIGN=RIGHT NOSAVE><TT>";
                                    echo number_format(pg_Result($esito, $i, "prezzounitario"),2,',','.');
                                    echo "</TT></TD><TD ALIGN=RIGHT NOSAVE><TT>&nbsp;";
                                    echo number_format(pg_Result($esito, $i, "prezzomoltiplicato"),2,',','.');
                                    echo "</TT></TD></TR>";
                                    $i++;
                                    } // Estrazione delle righe dell'interrogazione
                    $i--;
                echo "<OL><LI><B>";
		echo gettext ("Treatment plan's description");
	echo "</B></LI><BR>";
                echo pg_Result($esito, $i, "annotazioni");
                echo "<P><LI><B>";
echo gettext ("Description and cost of the services");
	echo "</B></LI></OL>";
                echo "</table><P>";
                pg_FreeResult($esito); //liberazione memoria
                $esito2 = pg_Exec($conn, "SELECT sum(prezzomoltiplicato) from pianocura where pianocura.id = '$idpz';");
                $riga = pg_fetch_row ($esito2, 0);
                $totale= $riga[0];
                pg_FreeResult($esito2); //liberazione memoria
                pg_Close($conn); //chiusura connessione db
	}
?>

<p>
<? echo gettext ("I hereby acknowledge that I have been informed and I have understood the plan and the estimate of the costs."); ?>
</p>

<p><b>
<? echo gettext ("Signature"); ?>
</b></P>
</BODY>
</HTML>