--- html/lista.php 2000/07/04 08:45:32 1.12 +++ html/lista.php 2000/08/02 11:52:20 1.12.2.4 @@ -14,10 +14,10 @@ Odaberite Vaše ime i prezime: '; } else { - $result = pg_Exec ($conn, "select ime,prezime,passwd,prava from kontakt_osobe where aktivna=true and id=$kontakt_osoba_id"); - $row=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(); + $row=$sth->fetchrow_hash(); print "Trenutno ste prijavljeni kao $row[ime] $row[prezime], ako je to krivo odaberite ovaj link."; $prava=$row[prava]; } @@ -66,6 +67,7 @@ if (isset($kontakt_osoba_id)) { echo ''; } + echo '
Prikaži status zahtjeva za: ',checkbox("shell",$shell),' shell ',checkbox("podesavanje",$podesavanje),' podešavanje @@ -76,20 +78,18 @@ $on_page=50; - $conn = pg_connect("dbname=informatika user=dpavlin"); - - $sql_polja="osobe.id as id,osobe.ime as ime, - osobe.prezime as prezime, - org_jed.naziv||'
'||org_pod_jed.pod_naziv||'' as orgjed, - kontakt_osobe.ime||' '||kontakt_osobe.prezime as kontakt_osoba, - e_mail,kontakt_osoba_id - "; - $sql_tablice="osobe,org_jed,kontakt_osobe"; - $sql_where="org_jed.id=org_jed_id - and org_pod_jed.pod_id=org_pod_jed_id - and kontakt_osoba_id=kontakt_osobe.id - "; - $sql_order="order by id"; + $sql_polja="osobe.id as id,osobe.ime as ime, + osobe.prezime as prezime, + org_jed.naziv||'
'||org_pod_jed.pod_naziv||'' as orgjed, + kontakt_osobe.ime||' '||kontakt_osobe.prezime as kontakt_osoba, + e_mail,kontakt_osoba_id + "; + $sql_tablice="osobe,org_jed,kontakt_osobe,org_pod_jed"; + $sql_where="org_jed.id=org_jed_id + and org_pod_jed.pod_id=org_pod_jed_id + and kontakt_osoba_id=kontakt_osobe.id + "; + $sql_order="order by id"; if (isset($sql_upit)) { switch($sql_upit) { @@ -131,7 +131,8 @@ # echo "
$sql
"; # echo "
$sql_where
"; - $result = pg_Exec ($conn, "$sql"); + $sth = $dbh->prepare("$sql"); + $sth->execute(); echo " @@ -140,20 +141,20 @@ - + "; include("inc/print_bool2.inc"); - - for ($k = 0; $k < pg_numrows($result); $k++) { - $row=pg_fetch_array($result,$k); + $k=0; + while ($row=$sth->fetchrow_hash()) { if ($k % 2 != 0) { print ""; } else { print ''; } + $k++; print "
organizacijska jedinica status zahtjeva kontakt osoba",pg_numrows($result),"",$sth->rows(),"
"; if ($row[kontakt_osoba_id]==$kontakt_osoba_id || isset($prava) && $prava==$pr_admin) { print "$row[id]"; @@ -163,9 +164,9 @@ print "$row[ime] $row[prezime] $row[orgjed]"; - $result1 = pg_Exec ($conn, "select datum,opis from status,status_tip where status.status_tip_id=status_tip.id and osoba_id=$row[id] order by datum"); - for ($l = 0; $l < pg_numrows($result1); $l++) { - $row1=pg_fetch_array($result1,$l); + $sth1 = $dbh->prepare("select datum,opis from status,status_tip where status.status_tip_id=status_tip.id and osoba_id=$row[id] order by datum"); + $sth1->execute(); + while ($row1=$sth1->fetchrow_hash()) { print "$row1[datum] $row1[opis]
"; } print "
$row[kontakt_osoba]"; @@ -200,7 +201,7 @@ echo "  "; } - if (pg_numrows($result) >= $on_page) { + if ($sth->rows() >= $on_page) { echo "+ "; } else { echo "  ";