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)) { |
if (!isset($datum) and !isset($lokacija)) { |
11 |
|
|
12 |
$sth = $dbh->prepare(" |
$result = pg_Exec ($conn, " |
13 |
select datum,count(*) as nr from izvjestaji group by datum |
select datum,count(*) as nr from izvjestaji group by datum |
14 |
order by datum desc |
order by datum desc |
15 |
"); |
"); |
|
$sth->execute(); |
|
16 |
|
|
17 |
print ' |
print ' |
18 |
<h1>Izvještaji o otvaranju računa</h1> |
<h1>Izvještaji o otvaranju računa</h1> |
|
<table> |
|
19 |
<table border=1> |
<table border=1> |
20 |
<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> |
21 |
'; |
'; |
22 |
|
|
23 |
while ($arr=$sth->fetchrow_array()) { |
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> |
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"; |
<td align=center>$arr[1]</td></tr>\n"; |
27 |
} |
} |
28 |
|
|
29 |
print '</table>'; |
print '</table>'; |
30 |
|
|
31 |
|
print " |
32 |
|
<form action=$PHP_SELF> |
33 |
|
<table border=0> |
34 |
|
<tr><td> |
35 |
|
Zahtjevi koji |
36 |
|
</td><td> |
37 |
|
<input type=radio name=preskoci_podesene value=1 checked>čekaju podešavanje<br> |
38 |
|
<input type=radio name=preskoci_podesene value=0>pripadaju |
39 |
|
</td><td> |
40 |
|
lokacija |
41 |
|
<select name=lokacija> |
42 |
|
"; |
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++) { |
46 |
|
$arr=pg_fetch_row($result,$k); |
47 |
|
print "<option value=$arr[0]>$arr[1]</option>\n"; |
48 |
|
} |
49 |
|
print "</select> |
50 |
|
<input type=submit value=Prikazi> |
51 |
|
</td></tr> |
52 |
|
</table> |
53 |
|
</form> |
54 |
|
"; |
55 |
|
|
56 |
} else { // isset(datum) |
} 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 { |
74 |
|
$sql="select osobe.id,ime,prezime,tel,lokacije.naziv, |
75 |
|
sifra,'', |
76 |
|
lok_racunala,objekt,kat,soba,z_rac,umrezavanje, |
77 |
|
kontakt_osobe.e_mail,podesavanje |
78 |
|
from osobe |
79 |
|
where lokacija_id = $lokacija |
80 |
|
and lokacija_id=lokacije.id |
81 |
|
and podesavanje=true |
82 |
|
and kontakt_osobe.id=kontakt_osoba_id |
83 |
|
order by lokacije.naziv,osobe.id |
84 |
|
"; |
85 |
|
# print "<pre>$sql</pre>"; |
86 |
|
$result = pg_Exec ($conn, "$sql"); |
87 |
|
} |
88 |
|
|
|
$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(); |
|
89 |
|
|
90 |
print ' |
print ' |
|
<h1>Izvještaj o otvaranju računa</h1> |
|
|
|
|
|
<p>Izvještaj za: '.$datum.'<p> |
|
|
|
|
91 |
<table border=1> |
<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> |
<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> |
<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> |
98 |
$rbr=1; |
$rbr=1; |
99 |
$podeseno=" "; |
$podeseno=" "; |
100 |
|
|
101 |
while ($arr=$sth->fetchrow_array()) { |
for ($k=0; $k < pg_numrows($result); $k++) { |
102 |
|
$arr=pg_fetch_row($result,$k); |
103 |
|
|
104 |
if ($lokacija != $arr[4]) { |
if ($lokacija != $arr[4]) { |
105 |
$lokacija=$arr[4]; |
$lokacija=$arr[4]; |
106 |
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>"; |
107 |
} |
} |
108 |
|
|
109 |
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>".sap_org_jed($arr[5])."</td></tr>\n"; |
110 |
|
|
111 |
|
|
112 |
if ($arr[12] == "f") { |
if ($arr[12] == "f") { |
113 |
$mreza='umreženo'; |
$mreza='umreženo'; |
114 |
} else { |
} else { |
115 |
$sth2 = $dbh->prepare(" |
$result2 = pg_Exec ($conn, " |
116 |
select count(status_tip_id) as nr_of_status8 from status |
select count(status_tip_id) as nr_of_status8 from status |
117 |
where osoba_id = $arr[0] and status_tip_id=8"); |
where osoba_id = $arr[0] and status_tip_id=8"); |
118 |
$sth2->execute(); |
$row2=pg_fetch_array($result2,0); |
|
$row2=$sth2->fetchrow_hash(); |
|
119 |
if ($row2["nr_of_status8"] > 0) { |
if ($row2["nr_of_status8"] > 0) { |
120 |
$mreza='<i>umrežavanje obavljeno</i>'; |
$mreza='<i>umrežavanje obavljeno</i>'; |
121 |
} else { |
} else { |
123 |
} |
} |
124 |
} |
} |
125 |
|
|
126 |
$sth3 = $dbh->prepare(" |
$result3 = pg_Exec ($conn, " |
127 |
select count(status_tip_id) as nr_of_status6 from status |
select count(status_tip_id) as nr_of_status6 from status |
128 |
where osoba_id = $arr[0] and status_tip_id=6"); |
where osoba_id = $arr[0] and status_tip_id=6"); |
129 |
$sth3->execute(); |
$row3=pg_fetch_array($result3,0); |
|
$row3=$sth3->fetchrow_hash(); |
|
130 |
if ($row3["nr_of_status6"] > 0) { |
if ($row3["nr_of_status6"] > 0) { |
131 |
$podeseno=show_bool("t"); |
$podeseno_html=show_bool("t"); |
132 |
|
$podeseno=1; |
133 |
} else { |
} else { |
134 |
$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>"; |
135 |
|
$podeseno=0; |
136 |
} |
} |
137 |
|
|
138 |
# 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"; |
139 |
|
|
140 |
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"; |
141 |
|
|
142 |
|
if ($preskoci_podesene & ! $podeseno || ! $preskoci_podesene) { |
143 |
|
print "$out"; |
144 |
|
} |
145 |
$rbr++; |
$rbr++; |
146 |
|
|
147 |
} |
} |