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 " |
31 |
|
<form action=$PHP_SELF> |
32 |
|
<table border=0> |
33 |
|
<tr><td> |
34 |
|
Zahtjevi koji |
35 |
|
</td><td> |
36 |
|
<input type=radio name=preskoci_podesene value=1 checked>čekaju podešavanje<br> |
37 |
|
<input type=radio name=preskoci_podesene value=0>pripadaju |
38 |
|
</td><td> |
39 |
|
lokacija |
40 |
|
<select name=lokacija> |
41 |
|
"; |
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++) { |
45 |
|
$arr=pg_fetch_row($result,$k); |
46 |
|
print "<option value=$arr[0]>$arr[1]</option>\n"; |
47 |
|
} |
48 |
|
print "</select> |
49 |
|
<input type=submit value=Prikazi> |
50 |
|
</td></tr> |
51 |
|
</table> |
52 |
|
</form> |
53 |
|
"; |
54 |
|
|
55 |
} else { // isset(datum) |
} 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 { |
75 |
|
$sql="select osobe.id,ime,prezime,tel,lokacije.naziv, |
76 |
|
org_jed.naziv,org_pod_jed.pod_naziv, |
77 |
|
lok_racunala,objekt,kat,soba,z_rac,umrezavanje, |
78 |
|
kontakt_osobe.e_mail,podesavanje |
79 |
|
from osobe |
80 |
|
where lokacija_id = $lokacija |
81 |
|
and lokacija_id=lokacije.id |
82 |
|
and org_jed_id=org_jed.id |
83 |
|
and org_pod_jed_id=org_pod_jed.pod_id |
84 |
|
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 |
|
|
|
$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(); |
|
92 |
|
|
93 |
print ' |
print ' |
|
<h1>Izvještaj o otvaranju računa</h1> |
|
|
|
|
|
<p>Izvještaj za: '.$datum.'<p> |
|
|
|
|
94 |
<table border=1> |
<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> |
<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> |
<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> |
101 |
$rbr=1; |
$rbr=1; |
102 |
$podeseno=" "; |
$podeseno=" "; |
103 |
|
|
104 |
while ($arr=$sth->fetchrow_array()) { |
for ($k=0; $k < pg_numrows($result); $k++) { |
105 |
|
$arr=pg_fetch_row($result,$k); |
106 |
|
|
107 |
if ($lokacija != $arr[4]) { |
if ($lokacija != $arr[4]) { |
108 |
$lokacija=$arr[4]; |
$lokacija=$arr[4]; |
109 |
print "<tr bgcolor=#000000><td colspan=6><font size=+1 color=#ffffff>$lokacija</font></td></tr>"; |
print "<tr bgcolor=#000000><td colspan=6><font size=+1 color=#ffffff>$lokacija</font></td></tr>"; |
110 |
} |
} |
111 |
|
|
112 |
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"; |
$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") { |
if ($arr[12] == "f") { |
116 |
$mreza='umreženo'; |
$mreza='umreženo'; |
117 |
} else { |
} else { |
118 |
$sth2 = $dbh->prepare(" |
$result2 = pg_Exec ($conn, " |
119 |
select count(status_tip_id) as nr_of_status8 from status |
select count(status_tip_id) as nr_of_status8 from status |
120 |
where osoba_id = $arr[0] and status_tip_id=8"); |
where osoba_id = $arr[0] and status_tip_id=8"); |
121 |
$sth2->execute(); |
$row2=pg_fetch_array($result2,0); |
|
$row2=$sth2->fetchrow_hash(); |
|
122 |
if ($row2["nr_of_status8"] > 0) { |
if ($row2["nr_of_status8"] > 0) { |
123 |
$mreza='<i>umrežavanje obavljeno</i>'; |
$mreza='<i>umrežavanje obavljeno</i>'; |
124 |
} else { |
} else { |
126 |
} |
} |
127 |
} |
} |
128 |
|
|
129 |
$sth3 = $dbh->prepare(" |
$result3 = pg_Exec ($conn, " |
130 |
select count(status_tip_id) as nr_of_status6 from status |
select count(status_tip_id) as nr_of_status6 from status |
131 |
where osoba_id = $arr[0] and status_tip_id=6"); |
where osoba_id = $arr[0] and status_tip_id=6"); |
132 |
$sth3->execute(); |
$row3=pg_fetch_array($result3,0); |
|
$row3=$sth3->fetchrow_hash(); |
|
133 |
if ($row3["nr_of_status6"] > 0) { |
if ($row3["nr_of_status6"] > 0) { |
134 |
$podeseno=show_bool("t"); |
$podeseno_html=show_bool("t"); |
135 |
|
$podeseno=1; |
136 |
} else { |
} else { |
137 |
$podeseno="<a href=\"obavijest.php?id=$arr[0]\">".show_bool("f")."</a>"; |
$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"; |
# print "<tr><td colspan=6>$arr[12] | ".$row2["nr_of_status8"]." | ".$row3["nr_of_status6"]."</td></tr>\n"; |
142 |
|
|
143 |
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"; |
$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++; |
$rbr++; |
149 |
|
|
150 |
} |
} |