--- html/obavijest.php 2000/07/27 08:35:35 1.15 +++ html/obavijest.php 2000/08/02 13:10:00 1.15.2.2 @@ -6,8 +6,9 @@ include("inc/bgcolor.inc"); if (isset($kontakt_osoba_id) && $what!="relogin") { - $result = pg_Exec ($conn, "select ime,prezime,passwd,prava from kontakt_osobe where aktivna=true and id=$kontakt_osoba_id"); - $korow=pg_fetch_array($result,0); + $sth = $dbh->prepare("select ime,prezime,passwd,prava from kontakt_osobe where aktivna=true and id=$kontakt_osoba_id"); + $sth->execute(); + $korow=$sth->fetchrow_hash(); # print "--$korow[passwd] | $md5_passwd | $passwd "; $prava=$korow[prava]; print "Trenutno ste prijavljeni kao $korow[ime] $korow[prezime], ako je to krivo odaberite ovaj link."; @@ -35,21 +36,21 @@ include("inc/obavjest-forma.inc"); } elseif (isset($id) && $what!="auth") { - -$result = pg_Exec ($conn, " +$sth = $dbh->prepare(" select osobe.id as id,ime,prezime,tel,lokacije.naziv as lok,sifra, org_jed.naziv as orgjed,org_pod_jed.pod_naziv as orgpodjed, lok_racunala as lokrac,objekt,kat,soba,z_rac,podesavanje, umrezavanje,shell - from osobe + from osobe,lokacije,org_jed,org_pod_jed where osobe.id=$id and lokacija_id=lokacije.id and org_jed_id=org_jed.id and org_pod_jed_id=org_pod_jed.pod_id order by lokacije.naziv,org_jed.naziv "); -if (pg_numrows($result) > 0) { - $row=pg_fetch_array($result,0); +$sth->execute(); + +if ($row=$sth->fetchrow_hash()) { print "

Podaci o osobi

@@ -85,35 +86,37 @@ $instaliran=0; -$result = pg_Exec ($conn, "select status.id as status_id,datum,opis,ime,prezime,status_tip_id as st +$sth = $dbh->prepare("select status.id as status_id,datum,opis,ime,prezime,status_tip_id as st from status,kontakt_osobe,status_tip where kontakt_osoba_id=kontakt_osobe.id and status_tip_id=status_tip.id and osoba_id=$id order by datum"); +$sth->execute(); $statusi=""; -$nr = pg_numrows($result); -if ($nr > 0) { - for ($i=0; $i<$nr; $i++) { - $row=pg_fetch_array($result,$i); - if ($row[st] != 2) { - $statusi.="$row[datum]$row[opis]$row[ime] $row[prezime]"; - } else { - $statusi.="$row[datum]$row[opis]$row[ime] $row[prezime]"; - } - if ($row[st] == 6) { $instaliran = 1; }; +$nr=0; +while($row=$sth->fetchrow_hash()) { + if ($row[st] != 2) { + $statusi.="$row[datum]$row[opis]$row[ime] $row[prezime]"; + } else { + $statusi.="$row[datum]$row[opis]$row[ime] $row[prezime]"; } -} else { + if ($row[st] == 6) { $instaliran = 1; }; + $nr++; +} + +if ($nr == 0) { $statusi.="

Nema podataka o korisničkom računu"; } -$result = pg_Exec ($conn, "select racuni.login as login, +$sth = $dbh->prepare("select racuni.login as login, racuni.passwd as passwd,e_mail.alias as email + from racuni,e_mail where racuni.osoba_id=$id and e_mail.osoba_id=$id"); +$sth->execute(); -if (pg_numrows($result) > 0) { - $row=pg_fetch_array($result,0); +if ($row=$sth->fetchrow_hash()) { print "

Podaci o korisničkom računu

@@ -165,15 +168,15 @@ $statusi.="