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

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

  ViewVC Help
Powered by ViewVC 1.1.26