--- html/ic.php 2000/07/11 13:49:15 1.3
+++ html/ic.php 2000/07/30 18:22:14 1.4.2.1
@@ -8,10 +8,11 @@
if (! isset($datum)) {
-$result = pg_Exec ($conn, "
+$sth = $dbh->prepare("
select datum,count(*) as nr from izvjestaji group by datum
- order by datum
+ order by datum desc
");
+$sth->execute();
print '
Izvještaji o otvaranju računa
@@ -20,8 +21,7 @@
datum izvještaja | broj otvorenih računa |
';
-for ($k=0; $k < pg_numrows($result); $k++) {
- $arr=pg_fetch_row($result,$k);
+while ($arr=$sth->fetchrow_array()) {
print "$arr[0] |
$arr[1] |
\n";
}
@@ -32,7 +32,7 @@
} else { // isset(datum)
-$result = pg_Exec ($conn, "
+$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,
@@ -46,6 +46,7 @@
order by lokacije.naziv,org_jed.naziv,osobe.id
");
+$sth->execute();
print '
Izvještaj o otvaranju računa
@@ -54,35 +55,53 @@
rbr | id | ime i prezime | tel | lokacija | org.jed |
- | | lokacija računala, mreža | ž | objekat / kat / soba |
+podešeno | lokacija računala, mreža | ž | objekat / kat / soba |
';
$lokacija="";
$mreza="";
$rbr=1;
+$podeseno=" ";
-for ($k=0; $k < pg_numrows($result); $k++) {
- $arr=pg_fetch_row($result,$k);
+while ($arr=$sth->fetchrow_array()) {
if ($lokacija != $arr[4]) {
$lokacija=$arr[4];
print "$lokacija |
";
}
+
print "$rbr | $arr[0] | $arr[1] $arr[2] | tel: $arr[3] | $arr[4] | $arr[5] $arr[6] |
\n";
- if ($arr[12] == 0) {
+
+
+ if ($arr[12] == "f") {
$mreza='umreženo';
} else {
- $result2 = pg_Exec ($conn, "
+ $sth2 = $dbh->prepare("
select count(status_tip_id) as nr_of_status8 from status
where osoba_id = $arr[0] and status_tip_id=8");
- $row2=pg_fetch_row($result2,0);
+ $sth2->execute();
+ $row2=$sth2->fetchrow_array()
if ($row2["nr_of_status8"] > 0) {
$mreza='umrežavanje obavljeno';
} else {
$mreza='potrebno umrežavanje';
}
}
- print " | $arr[7] $mreza | ž-$arr[11] | $arr[8] / $arr[9] / $arr[10] |
\n";
+
+ $sth3 = $dbh->prepare("
+ 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_array()
+ if ($row3["nr_of_status6"] > 0) {
+ $podeseno=show_bool("t");
+ } else {
+ $podeseno="".show_bool("f")."";
+ }
+
+# print "$arr[12] | ".$row2["nr_of_status8"]." | ".$row3["nr_of_status6"]." |
\n";
+
+ print "$podeseno | $arr[7] $mreza | ž-$arr[11] | $arr[8] / $arr[9] / $arr[10] |
\n";
$rbr++;
}
@@ -91,7 +110,11 @@
} // isset(datum)
-print "Povratak na početnu stranicu.";
+print "
Povratak na ";
+if (isset($HTTP_REFERER)) {
+ print "stranicu sa koje ste došli ili ";
+}
+print "početnu stranicu.";
include("inc/footer.inc");