/[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.1 by dpavlin, Wed Jun 28 12:39:01 2000 UTC revision 1.4.2.2 by dpavlin, Mon Jul 31 10:41:57 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  $result = pg_Exec ($conn, "  if (! isset($datum)) {
10          select osobe.id as id,osobe.ime as ime,osobe.prezime as prezime,  
11                  max(status_tip_id) as mxstat,  $sth = $dbh->prepare("
12                  (max(status_tip_id) = 6) as podesen,          select datum,count(*) as nr from izvjestaji group by datum
13                  max(kontakt_osobe.ime||' '||kontakt_osobe.prezime) as stwho          order by datum desc
14          from osobe,status,kontakt_osobe,status_tip          ");
15          where osobe.id=osoba_id and  $sth->execute();
16                  umrezavanje and  
17                  status_tip_id > 3 and status_tip_id <= 6 and  print '
18                  status_tip_id = status_tip.id and  <h1>Izvještaji o otvaranju računa</h1>
19                  status.kontakt_osoba_id=kontakt_osobe.id  <table>
20          group by  <table border=1>
21                  osobe.ime,osobe.prezime,osobe.id,  <tr bgcolor="#e0e0f0"><th>datum izvještaja</th><th>broj otvorenih računa</th></tr>
22                  umrezavanje  ';
23          order by osobe.id  
24    while ($arr=$sth->fetchrow_array()) {
25            print "<tr".bgcolor()."><td><a href=\"$PHP_SELF?datum=".rawurlencode($arr[0])."\">$arr[0]</a></td>
26                    <td align=center>$arr[1]</td></tr>\n";
27    }
28    
29    print '</table>';
30    
31    
32    } else {        // isset(datum)
33    
34    
35    $sth = $dbh->prepare("
36            select osobe.id,ime,prezime,tel,lokacije.naziv,
37                    org_jed.naziv,org_pod_jed.pod_naziv,
38                    lok_racunala,objekt,kat,soba,z_rac,umrezavanje,
39                    kontakt_osobe.e_mail,podesavanje
40            from osobe
41            where osobe.id in ( select osoba_id from izvjestaji where datum='$datum' )
42                    and lokacija_id=lokacije.id and org_jed_id=org_jed.id
43                    and org_pod_jed_id=org_pod_jed.pod_id
44                    and podesavanje=true
45                    and kontakt_osobe.id=kontakt_osoba_id
46            order by lokacije.naziv,org_jed.naziv,osobe.id
47    
48          ");          ");
49    $sth->execute();
50    
51    print '
52    <h1>Izvještaj o otvaranju računa</h1>
53    
54    <p>Izvještaj za: '.$datum.'<p>
55    
56    <table border=1>
57    <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>
58    <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>
59    ';
60    
61    $lokacija="";
62    $mreza="";
63    $rbr=1;
64    $podeseno="&nbsp;";
65    
66  print "  while ($arr=$sth->fetchrow_array()) {
67          <h1>Prikaz zahtjeva koji traže podešavanje</h1>  
68          <form action=$PHP_SELF>          if ($lokacija != $arr[4]) {
69          <table border=0>                  $lokacija=$arr[4];
70          <tr><td>                  print "<tr bgcolor=#000000><td colspan=6><font size=+1 color=#ffffff>$lokacija</font></td></tr>";
71          <small>          }
72          ".radio("samo_nepodesene",1,$samo_nepodesene,0)." prikaži sve zahtjeve  
73          <br>".radio("samo_nepodesene",0,$samo_nepodesene,1)." prikaži samo nepodešene          print "<tr".bgcolor()."><td>$rbr</td><td><a href=\"obavijest.php?id=$arr[0]\">$arr[0]</a></td><td>$arr[1] $arr[2]</td><td>tel: $arr[3]</td><td><small>$arr[4]</small></td><td>$arr[5]<br>$arr[6]</td></tr>\n";
74          </small>  
75          </td><td>  
76          <input type=submit value=\"Odaberi\">          if ($arr[12] == "f") {
77          </td><tr>                  $mreza='umreženo';
78          </table>          } else {
79          </form>                  $sth2 = $dbh->prepare("
80                            select count(status_tip_id) as nr_of_status8 from status
81          <table border=0>                          where osoba_id = $arr[0] and status_tip_id=8");
82          <tr><th>zah.</th><th>ime i prezime</th><th>podešen</th>                  $sth2->execute();
83          </tr>                  $row2=$sth2->fetchrow_hash();
84                    if ($row2["nr_of_status8"] > 0) {
85          ";                          $mreza='<i>umrežavanje obavljeno</i>';
86  for ($k=0; $k < pg_numrows($result); $k++) {                  } else {
87          $row=pg_fetch_array($result,$k);                          $mreza='<b>potrebno umrežavanje</b>';
88          if (!$samo_nepodesene && $row[mxstat] == 8) {                  }
89                  // null == skip this one!          }
90    
91            $sth3 = $dbh->prepare("
92                    select count(status_tip_id) as nr_of_status6 from status
93                    where osoba_id = $arr[0] and status_tip_id=6");
94            $sth3->execute();
95            $row3=$sth3->fetchrow_hash();
96            if ($row3["nr_of_status6"] > 0) {
97                    $podeseno=show_bool("t");
98          } else {          } else {
99          print "<tr".bgcolor().">                  $podeseno="<a href=\"obavijest.php?id=$arr[0]\">".show_bool("f")."</a>";
                 <!-- $row[mxstat] -->  
                 <td>$row[id]</td>  
                 <td>$row[ime] $row[prezime]</td>  
                 <td>".show_bool($row[podesen])."</td>  
                 <td><a href=\"obavijest.php?id=$row[id]\">  
                         <img src=pix/text.gif border=0  
                         alt=\"Prikaži sve podatke o ovom zahtjevu\"></a>  
                 </td>  
                 </tr>";  
100          }          }
101    
102    #       print "<tr><td colspan=6>$arr[12] | ".$row2["nr_of_status8"]." | ".$row3["nr_of_status6"]."</td></tr>\n";
103    
104            print "<tr".bgcolor()."><td colspan=2>$podeseno</td><td><small>$arr[7] $mreza</small></a><td><small>ž-$arr[11]</small></td><td colspan=2><small>$arr[8] / $arr[9] / $arr[10]</small></td></tr>\n";
105            $rbr++;
106    
107  }  }
108    print "</table>";
109    
110  print "</table>  }               // isset(datum)
111          <p>Povratak na <a href=\"index.php\">početnu stranicu</a>.  
112          ";  
113    print "<p>Povratak na ";
114    if (isset($HTTP_REFERER)) {
115            print "<a href=\"$HTTP_REFERER\">stranicu sa koje ste došli</a> ili ";
116    }
117    print "<a href=\"/\">početnu stranicu</a>.";
118    
119  include("inc/footer.inc");  include("inc/footer.inc");
120    

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.4.2.2

  ViewVC Help
Powered by ViewVC 1.1.26