--- html/ic.php 2000/07/13 08:01:28 1.4
+++ html/ic.php 2000/07/31 10:41:57 1.4.2.2
@@ -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 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
@@ -62,24 +63,24 @@
$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";
+ print "$rbr | $arr[0] | $arr[1] $arr[2] | tel: $arr[3] | $arr[4] | $arr[5] $arr[6] |
\n";
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_array($result2,0);
+ $sth2->execute();
+ $row2=$sth2->fetchrow_hash();
if ($row2["nr_of_status8"] > 0) {
$mreza='umrežavanje obavljeno';
} else {
@@ -87,14 +88,15 @@
}
}
- $result3 = pg_Exec ($conn, "
+ $sth3 = $dbh->prepare("
select count(status_tip_id) as nr_of_status6 from status
where osoba_id = $arr[0] and status_tip_id=6");
- $row3=pg_fetch_array($result3,0);
+ $sth3->execute();
+ $row3=$sth3->fetchrow_hash();
if ($row3["nr_of_status6"] > 0) {
$podeseno=show_bool("t");
} else {
- $podeseno="".show_bool("f")."";
+ $podeseno="".show_bool("f")."";
}
# print "$arr[12] | ".$row2["nr_of_status8"]." | ".$row3["nr_of_status6"]." |
\n";