--- html/ic.php 2000/07/31 10:41:57 1.4.2.2 +++ html/ic.php 2002/02/04 15:55:12 1.7 @@ -5,54 +5,89 @@ include("inc/show_bool.inc"); include("inc/bgcolor.inc"); include("inc/radio.inc"); +include("inc/sap_org_jed.inc"); -if (! isset($datum)) { +if (!isset($datum) and !isset($lokacija)) { -$sth = $dbh->prepare(" +$result = pg_Exec ($conn, " select datum,count(*) as nr from izvjestaji group by datum order by datum desc "); -$sth->execute(); print '

Izvještaji o otvaranju računa

-
'; -while ($arr=$sth->fetchrow_array()) { +for ($k=0; $k < pg_numrows($result); $k++) { + $arr=pg_fetch_row($result,$k); print "\n"; } print '
datum izvještajabroj otvorenih računa
$arr[0] $arr[1]
'; +print " +
+ + +
+Zahtjevi koji + +čekaju podešavanje
+pripadaju +
+lokacija + + +
+
+"; } else { // isset(datum) + print "

Izvještaj o otvaranju računa

"; + if (isset($datum)) { + $result = pg_Exec ($conn, " + select osobe.id,ime,prezime,tel,lokacije.naziv, + sifra,'', + 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 podesavanje=true + and kontakt_osobe.id=kontakt_osoba_id + order by lokacije.naziv,osobe.id + "); + print "

Izvještaj za: $datum

"; + } else { + $sql="select osobe.id,ime,prezime,tel,lokacije.naziv, + sifra,'', + lok_racunala,objekt,kat,soba,z_rac,umrezavanje, + kontakt_osobe.e_mail,podesavanje + from osobe + where lokacija_id = $lokacija + and lokacija_id=lokacije.id + and podesavanje=true + and kontakt_osobe.id=kontakt_osoba_id + order by lokacije.naziv,osobe.id + "; +# print "

$sql
"; + $result = pg_Exec ($conn, "$sql"); + } -$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(); print ' -

Izvještaj o otvaranju računa

- -

Izvještaj za: '.$datum.'

- @@ -63,24 +98,24 @@ $rbr=1; $podeseno=" "; -while ($arr=$sth->fetchrow_array()) { +for ($k=0; $k < pg_numrows($result); $k++) { + $arr=pg_fetch_row($result,$k); if ($lokacija != $arr[4]) { $lokacija=$arr[4]; print ""; } - print "\n"; + $out="\n"; if ($arr[12] == "f") { $mreza='umreženo'; } else { - $sth2 = $dbh->prepare(" + $result2 = pg_Exec ($conn, " select count(status_tip_id) as nr_of_status8 from status where osoba_id = $arr[0] and status_tip_id=8"); - $sth2->execute(); - $row2=$sth2->fetchrow_hash(); + $row2=pg_fetch_array($result2,0); if ($row2["nr_of_status8"] > 0) { $mreza='umrežavanje obavljeno'; } else { @@ -88,20 +123,25 @@ } } - $sth3 = $dbh->prepare(" + $result3 = pg_Exec ($conn, " select count(status_tip_id) as nr_of_status6 from status where osoba_id = $arr[0] and status_tip_id=6"); - $sth3->execute(); - $row3=$sth3->fetchrow_hash(); + $row3=pg_fetch_array($result3,0); if ($row3["nr_of_status6"] > 0) { - $podeseno=show_bool("t"); + $podeseno_html=show_bool("t"); + $podeseno=1; } else { - $podeseno="".show_bool("f").""; + $podeseno_html="".show_bool("f").""; + $podeseno=0; } # print "\n"; - print "\n"; + $out.="\n"; + + if ($preskoci_podesene & ! $podeseno || ! $preskoci_podesene) { + print "$out"; + } $rbr++; }
rbridime i prezimetellokacijaorg.jed
podešenolokacija računala, mrežažobjekat / kat / soba
$lokacija
$rbr$arr[0]$arr[1] $arr[2]tel: $arr[3]$arr[4]$arr[5]
$arr[6]
$rbr$arr[0]$arr[1] $arr[2]tel: $arr[3]$arr[4]".sap_org_jed($arr[5])."
$arr[12] | ".$row2["nr_of_status8"]." | ".$row3["nr_of_status6"]."
$podeseno$arr[7] $mrezaž-$arr[11]$arr[8] / $arr[9] / $arr[10]
$podeseno_html$arr[7] $mrezaž-$arr[11]$arr[8] / $arr[9] / $arr[10]