/[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.7 by dpavlin, Mon Feb 4 15:55:12 2002 UTC
# Line 5  include("inc/prava.inc"); Line 5  include("inc/prava.inc");
5  include("inc/show_bool.inc");  include("inc/show_bool.inc");
6  include("inc/bgcolor.inc");  include("inc/bgcolor.inc");
7  include("inc/radio.inc");  include("inc/radio.inc");
8    include("inc/sap_org_jed.inc");
9    
10    if (!isset($datum) and !isset($lokacija)) {
11    
12  $result = pg_Exec ($conn, "  $result = pg_Exec ($conn, "
13          select osobe.id as id,osobe.ime as ime,osobe.prezime as prezime,          select datum,count(*) as nr from izvjestaji group by datum
14                  max(status_tip_id) as mxstat,          order by datum desc
                 (max(status_tip_id) = 6) as podesen,  
                 max(kontakt_osobe.ime||' '||kontakt_osobe.prezime) as stwho  
         from osobe,status,kontakt_osobe,status_tip  
         where osobe.id=osoba_id and  
                 umrezavanje and  
                 status_tip_id > 3 and status_tip_id <= 6 and  
                 status_tip_id = status_tip.id and  
                 status.kontakt_osoba_id=kontakt_osobe.id  
         group by  
                 osobe.ime,osobe.prezime,osobe.id,  
                 umrezavanje  
         order by osobe.id  
15          ");          ");
16    
17    print '
18    <h1>Izvještaji o otvaranju računa</h1>
19    <table border=1>
20    <tr bgcolor="#e0e0f0"><th>datum izvještaja</th><th>broj otvorenih računa</th></tr>
21    ';
22    
23    for ($k=0; $k < pg_numrows($result); $k++) {
24            $arr=pg_fetch_row($result,$k);
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  print "  print "
32          <h1>Prikaz zahtjeva koji traže podešavanje</h1>  <form action=$PHP_SELF>
33          <form action=$PHP_SELF>  <table border=0>
34          <table border=0>  <tr><td>
35          <tr><td>  Zahtjevi koji
36          <small>  </td><td>
37          ".radio("samo_nepodesene",1,$samo_nepodesene,0)." prikaži sve zahtjeve  <input type=radio name=preskoci_podesene value=1 checked>čekaju podešavanje<br>
38          <br>".radio("samo_nepodesene",0,$samo_nepodesene,1)." prikaži samo nepodešene  <input type=radio name=preskoci_podesene value=0>pripadaju
39          </small>  </td><td>
40          </td><td>  lokacija
41          <input type=submit value=\"Odaberi\">  <select name=lokacija>
42          </td><tr>  ";
         </table>  
         </form>  
   
         <table border=0>  
         <tr><th>zah.</th><th>ime i prezime</th><th>podešen</th>  
         </tr>  
43    
44          ";  $result = pg_Exec ($conn, "select id,naziv from lokacije where aktivna is true order by naziv");
45  for ($k=0; $k < pg_numrows($result); $k++) {  for ($k=0; $k < pg_numrows($result); $k++) {
46          $row=pg_fetch_array($result,$k);          $arr=pg_fetch_row($result,$k);
47          if (!$samo_nepodesene && $row[mxstat] == 8) {          print "<option value=$arr[0]>$arr[1]</option>\n";
48                  // null == skip this one!  }
49    print "</select>
50    <input type=submit value=Prikazi>
51    </td></tr>
52    </table>
53    </form>
54    ";
55    
56    } else {        // isset(datum)
57            print "<h1>Izvještaj o otvaranju računa</h1>";
58    
59            if (isset($datum)) {
60                    $result = pg_Exec ($conn, "
61                            select osobe.id,ime,prezime,tel,lokacije.naziv,
62                                    sifra,'',
63                                    lok_racunala,objekt,kat,soba,z_rac,umrezavanje,
64                                    kontakt_osobe.e_mail,podesavanje
65                            from osobe
66                            where osobe.id in ( select osoba_id from izvjestaji where datum='$datum' )
67                                    and lokacija_id=lokacije.id
68                                    and podesavanje=true
69                                    and kontakt_osobe.id=kontakt_osoba_id
70                            order by lokacije.naziv,osobe.id
71                            ");
72                    print "<p>Izvještaj za: $datum<p>";
73          } else {          } else {
74          print "<tr".bgcolor().">                  $sql="select osobe.id,ime,prezime,tel,lokacije.naziv,
75                  <!-- $row[mxstat] -->                                  sifra,'',
76                  <td>$row[id]</td>                                  lok_racunala,objekt,kat,soba,z_rac,umrezavanje,
77                  <td>$row[ime] $row[prezime]</td>                                  kontakt_osobe.e_mail,podesavanje
78                  <td>".show_bool($row[podesen])."</td>                          from osobe
79                  <td><a href=\"obavijest.php?id=$row[id]\">                          where lokacija_id = $lokacija
80                          <img src=pix/text.gif border=0                                  and lokacija_id=lokacije.id
81                          alt=\"Prikaži sve podatke o ovom zahtjevu\"></a>                                  and podesavanje=true
82                  </td>                                  and kontakt_osobe.id=kontakt_osoba_id
83                  </tr>";                          order by lokacije.naziv,osobe.id
84                            ";
85    #               print "<pre>$sql</pre>";
86                    $result = pg_Exec ($conn, "$sql");
87          }          }
88    
89    
90    print '
91    <table border=1>
92    <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>
93    <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>
94    ';
95    
96    $lokacija="";
97    $mreza="";
98    $rbr=1;
99    $podeseno="&nbsp;";
100    
101    for ($k=0; $k < pg_numrows($result); $k++) {
102            $arr=pg_fetch_row($result,$k);
103    
104            if ($lokacija != $arr[4]) {
105                    $lokacija=$arr[4];
106                    print "<tr bgcolor=#000000><td colspan=6><font size=+1 color=#ffffff>$lokacija</font></td></tr>";
107            }
108    
109            $out="<tr".bgcolor()."><td>$rbr</td><td><a href=\"http://support.pliva.hr/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>".sap_org_jed($arr[5])."</td></tr>\n";
110    
111    
112            if ($arr[12] == "f") {
113                    $mreza='umreženo';
114            } else {
115                    $result2 = pg_Exec ($conn, "
116                            select count(status_tip_id) as nr_of_status8 from status
117                            where osoba_id = $arr[0] and status_tip_id=8");
118                    $row2=pg_fetch_array($result2,0);
119                    if ($row2["nr_of_status8"] > 0) {
120                            $mreza='<i>umrežavanje obavljeno</i>';
121                    } else {
122                            $mreza='<b>potrebno umrežavanje</b>';
123                    }
124            }
125    
126            $result3 = pg_Exec ($conn, "
127                    select count(status_tip_id) as nr_of_status6 from status
128                    where osoba_id = $arr[0] and status_tip_id=6");
129            $row3=pg_fetch_array($result3,0);
130            if ($row3["nr_of_status6"] > 0) {
131                    $podeseno_html=show_bool("t");
132                    $podeseno=1;
133            } else {
134                    $podeseno_html="<a href=\"http://support.pliva.hr/obavijest.php?id=$arr[0]\">".show_bool("f")."</a>";
135                    $podeseno=0;
136            }
137    
138    #       print "<tr><td colspan=6>$arr[12] | ".$row2["nr_of_status8"]." | ".$row3["nr_of_status6"]."</td></tr>\n";
139    
140            $out.="<tr".bgcolor()."><td colspan=2>$podeseno_html</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";
141    
142            if ($preskoci_podesene & ! $podeseno || ! $preskoci_podesene) {
143                    print "$out";
144            }
145            $rbr++;
146    
147  }  }
148    print "</table>";
149    
150  print "</table>  }               // isset(datum)
151          <p>Povratak na <a href=\"index.php\">početnu stranicu</a>.  
152          ";  
153    print "<p>Povratak na ";
154    if (isset($HTTP_REFERER)) {
155            print "<a href=\"$HTTP_REFERER\">stranicu sa koje ste došli</a> ili ";
156    }
157    print "<a href=\"/\">početnu stranicu</a>.";
158    
159  include("inc/footer.inc");  include("inc/footer.inc");
160    

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

  ViewVC Help
Powered by ViewVC 1.1.26