/[informatika.old]/html/ic.php
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /html/ic.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4.2.1 by dpavlin, Sun Jul 30 18:22:14 2000 UTC revision 1.5 by dpavlin, Thu Oct 5 11:10:27 2000 UTC
# Line 6  include("inc/show_bool.inc"); Line 6  include("inc/show_bool.inc");
6  include("inc/bgcolor.inc");  include("inc/bgcolor.inc");
7  include("inc/radio.inc");  include("inc/radio.inc");
8    
9  if (! isset($datum)) {  if (!isset($datum) and !isset($lokacija)) {
10    
11  $sth = $dbh->prepare("  $result = pg_Exec ($conn, "
12          select datum,count(*) as nr from izvjestaji group by datum          select datum,count(*) as nr from izvjestaji group by datum
13          order by datum desc          order by datum desc
14          ");          ");
 $sth->execute();  
15    
16  print '  print '
17  <h1>Izvještaji o otvaranju računa</h1>  <h1>Izvještaji o otvaranju računa</h1>
 <table>  
18  <table border=1>  <table border=1>
19  <tr bgcolor="#e0e0f0"><th>datum izvještaja</th><th>broj otvorenih računa</th></tr>  <tr bgcolor="#e0e0f0"><th>datum izvještaja</th><th>broj otvorenih računa</th></tr>
20  ';  ';
21    
22  while ($arr=$sth->fetchrow_array()) {  for ($k=0; $k < pg_numrows($result); $k++) {
23            $arr=pg_fetch_row($result,$k);
24          print "<tr".bgcolor()."><td><a href=\"$PHP_SELF?datum=".rawurlencode($arr[0])."\">$arr[0]</a></td>          print "<tr".bgcolor()."><td><a href=\"$PHP_SELF?datum=".rawurlencode($arr[0])."\">$arr[0]</a></td>
25                  <td align=center>$arr[1]</td></tr>\n";                  <td align=center>$arr[1]</td></tr>\n";
26  }  }
27    
28  print '</table>';  print '</table>';
29    
30    print "<table border=0>
31    <tr><td>Zahtjevi sa lokacije:</td>
32    <td><form action=$PHP_SELF><select name=lokacija>";
33    
34    $result = pg_Exec ($conn, "select id,naziv from lokacije where aktivna is true order by naziv");
35    for ($k=0; $k < pg_numrows($result); $k++) {
36            $arr=pg_fetch_row($result,$k);
37            print "<option value=$arr[0]>$arr[1]</option>\n";
38    }
39    print "</select></td><td><input type=submit value=Prikazi></td></tr></table>";
40    
41  } else {        // isset(datum)  } else {        // isset(datum)
42            print "<h1>Izvještaj o otvaranju računa</h1>";
43    
44            if (isset($datum)) {
45                    $result = pg_Exec ($conn, "
46                            select osobe.id,ime,prezime,tel,lokacije.naziv,
47                                    org_jed.naziv,org_pod_jed.pod_naziv,
48                                    lok_racunala,objekt,kat,soba,z_rac,umrezavanje,
49                                    kontakt_osobe.e_mail,podesavanje
50                            from osobe
51                            where osobe.id in ( select osoba_id from izvjestaji where datum='$datum' )
52                                    and lokacija_id=lokacije.id
53                                    and org_jed_id=org_jed.id
54                                    and org_pod_jed_id=org_pod_jed.pod_id
55                                    and podesavanje=true
56                                    and kontakt_osobe.id=kontakt_osoba_id
57                            order by lokacije.naziv,org_jed.naziv,osobe.id
58                            ");
59                    print "<p>Izvještaj za: $datum<p>";
60            } else {
61                    $sql="select osobe.id,ime,prezime,tel,lokacije.naziv,
62                                    org_jed.naziv,org_pod_jed.pod_naziv,
63                                    lok_racunala,objekt,kat,soba,z_rac,umrezavanje,
64                                    kontakt_osobe.e_mail,podesavanje
65                            from osobe
66                            where lokacija_id = $lokacija
67                                    and lokacija_id=lokacije.id
68                                    and org_jed_id=org_jed.id
69                                    and org_pod_jed_id=org_pod_jed.pod_id
70                                    and podesavanje=true
71                                    and kontakt_osobe.id=kontakt_osoba_id
72                            order by lokacije.naziv,org_jed.naziv,osobe.id
73                            ";
74    #               print "<pre>$sql</pre>";
75                    $result = pg_Exec ($conn, "$sql");
76            }
77    
 $sth = $dbh->prepare("  
         select osobe.id,ime,prezime,tel,lokacije.naziv,  
                 org_jed.naziv,org_pod_jed.pod_naziv,  
                 lok_racunala,objekt,kat,soba,z_rac,umrezavanje,  
                 kontakt_osobe.e_mail,podesavanje  
         from osobe  
         where osobe.id in ( select osoba_id from izvjestaji where datum='$datum' )  
                 and lokacija_id=lokacije.id and org_jed_id=org_jed.id  
                 and org_pod_jed_id=org_pod_jed.pod_id  
                 and podesavanje=true  
                 and kontakt_osobe.id=kontakt_osoba_id  
         order by lokacije.naziv,org_jed.naziv,osobe.id  
   
         ");  
 $sth->execute();  
78    
79  print '  print '
 <h1>Izvještaj o otvaranju računa</h1>  
   
 <p>Izvještaj za: '.$datum.'<p>  
   
80  <table border=1>  <table border=1>
81  <tr bgcolor="#e0e0f0"><th>rbr</th><th>id</th><th>ime i prezime</th><th>tel</th><th>lokacija</th><th>org.jed</th></tr>  <tr bgcolor="#e0e0f0"><th>rbr</th><th>id</th><th>ime i prezime</th><th>tel</th><th>lokacija</th><th>org.jed</th></tr>
82  <tr bgcolor="#e0e0f0"><th colspan=2>podešeno</th><th>lokacija računala, mreža</th><th>ž</th><th colspan=2>objekat / kat / soba</th></tr>  <tr bgcolor="#e0e0f0"><th colspan=2>podešeno</th><th>lokacija računala, mreža</th><th>ž</th><th colspan=2>objekat / kat / soba</th></tr>
# Line 63  $mreza=""; Line 87  $mreza="";
87  $rbr=1;  $rbr=1;
88  $podeseno="&nbsp;";  $podeseno="&nbsp;";
89    
90  while ($arr=$sth->fetchrow_array()) {  for ($k=0; $k < pg_numrows($result); $k++) {
91            $arr=pg_fetch_row($result,$k);
92    
93          if ($lokacija != $arr[4]) {          if ($lokacija != $arr[4]) {
94                  $lokacija=$arr[4];                  $lokacija=$arr[4];
# Line 76  while ($arr=$sth->fetchrow_array()) { Line 101  while ($arr=$sth->fetchrow_array()) {
101          if ($arr[12] == "f") {          if ($arr[12] == "f") {
102                  $mreza='umreženo';                  $mreza='umreženo';
103          } else {          } else {
104                  $sth2 = $dbh->prepare("                  $result2 = pg_Exec ($conn, "
105                          select count(status_tip_id) as nr_of_status8 from status                          select count(status_tip_id) as nr_of_status8 from status
106                          where osoba_id = $arr[0] and status_tip_id=8");                          where osoba_id = $arr[0] and status_tip_id=8");
107                  $sth2->execute();                  $row2=pg_fetch_array($result2,0);
                 $row2=$sth2->fetchrow_array()  
108                  if ($row2["nr_of_status8"] > 0) {                  if ($row2["nr_of_status8"] > 0) {
109                          $mreza='<i>umrežavanje obavljeno</i>';                          $mreza='<i>umrežavanje obavljeno</i>';
110                  } else {                  } else {
# Line 88  while ($arr=$sth->fetchrow_array()) { Line 112  while ($arr=$sth->fetchrow_array()) {
112                  }                  }
113          }          }
114    
115          $sth3 = $dbh->prepare("          $result3 = pg_Exec ($conn, "
116                  select count(status_tip_id) as nr_of_status6 from status                  select count(status_tip_id) as nr_of_status6 from status
117                  where osoba_id = $arr[0] and status_tip_id=6");                  where osoba_id = $arr[0] and status_tip_id=6");
118          $sth3->execute();          $row3=pg_fetch_array($result3,0);
         $row3=$sth3->fetchrow_array()  
119          if ($row3["nr_of_status6"] > 0) {          if ($row3["nr_of_status6"] > 0) {
120                  $podeseno=show_bool("t");                  $podeseno=show_bool("t");
121          } else {          } else {

Legend:
Removed from v.1.4.2.1  
changed lines
  Added in v.1.5

  ViewVC Help
Powered by ViewVC 1.1.26