--- html/obavijest.php 2000/07/07 11:22:27 1.13 +++ html/obavijest.php 2000/07/31 18:30:49 1.15.2.1 @@ -2,16 +2,17 @@ include("inc/head.inc"); include("inc/prava.inc"); -include("inc/show_bool.inc"); +include("inc/print_bool2.inc"); 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."; - $curr_md5_passwd=base64_encode(mhash(MHASH_MD5,$korow[passwd])); + $curr_md5_passwd=md5($korow[passwd]); if ( (!isset($md5_passwd) && $korow[passwd] != $passwd) || (isset($md5_passwd) && $curr_md5_passwd != $md5_passwd) ) { include("inc/auth.inc"); @@ -21,7 +22,7 @@ print '

Povratak na početnu stranicu'; } else { session_register("md5_passwd"); - $md5_passwd=base64_encode(mhash(MHASH_MD5,$korow[passwd])); + $md5_passwd=md5($korow[passwd]); } } @@ -35,8 +36,7 @@ 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, @@ -48,8 +48,9 @@ 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

@@ -70,9 +71,9 @@ Objekt/soba/kat: $row[objekt] / $row[soba] / $row[kat] Ž računala: $row[z_rac] -Shell: ".show_bool($row[shell])." - Umrežavanje: ".show_bool($row[umrezavanje])." - Podešavanje: ".show_bool($row[podesavanje])." +Shell: ".print_bool($row[shell])." + Umrežavanje: ".print_bool($row[umrezavanje])." + Podešavanje: ".print_bool($row[podesavanje])." "; @@ -85,35 +86,36 @@ $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 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 +167,15 @@ $statusi.="