File: storicoinsert.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 (68 lines) | stat: -rw-r--r-- 2,808 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
<? require("testa.php");?>

<B><? echo gettext ("Ledger item added");?></B>

<P>

<TABLE Border="0">
<TR>
 <TD colspan="4">
  <HR noshade size="2">
 </TD>
</TR>
<TR>
  <TH><? echo gettext ("ID");?></TH>
  <TH><? echo gettext ("Date");?></TH>
  <TH><? echo gettext ("Treatment");?></TH>
  <TH><? echo gettext ("Provider");?></TH>
</TR>
<TR>
 <TD colspan="4">
  <HR noshade size="2">
 </TD>
</TR>

<?php
                        //Settaggio data Formato Europeo 
                        pg_Exec($conn,"SET DATESTYLE TO 'European';");
                        //Inserimento nuovo Paziente  
                        $esitoX = pg_Exec($conn,
                        "INSERT INTO storico (id, cognome, nome, data, prestazione, operatore) VALUES ($idpz, '$cognome', '$nome', '$data', '$prestazione', '$operatore');");
                        pg_FreeResult($esitoX);

                        $esito = pg_Exec($conn, "SELECT * FROM storico WHERE id = '$idpz' ORDER BY data;");
                        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) {
                                    if (!($i % 2)) {
                                                               echo "<TR bgcolor=\"#C0C0C0\"><TD><CENTER>";
                                                              } else {
                                                                           echo "<TR bgcolor=\"#ffffff\"><TD><CENTER>";
                                                                          }
                                            echo pg_Result($esito, $i, "id");
                                            echo "</CENTER></TD><TD><U>";  
                                            echo pg_Result($esito, $i, "data");
                                            echo "</U></TD><TD>&nbsp;&nbsp;&nbsp;<FONT COLOR=\"#0000FF\">";
                                            echo pg_Result($esito, $i, "prestazione");
                                            echo "</FONT></TD><TD><CENTER>&nbsp;&nbsp;&nbsp;";
                                            echo pg_Result($esito, $i, "operatore");
                                            echo "</CENTER></TD></TR>";
                                            $i++;
                                            }
   pg_FreeResult($esito);
?>

</TABLE>

<BR><a href="storicopzinserimento.php">
<? echo gettext ("Add new item in ledger");?>
</a>
<BR><a href="index.php">
<? echo gettext ("Back to main menu");?>
</a>

<? include("piede.php");?>