--- sections/zaposleni.inc 2001/11/07 12:09:58 1.3 +++ sections/zaposleni.inc 2001/11/16 11:31:16 1.5 @@ -2,14 +2,24 @@ $sql="select titula,ime,note,tel,email,pozicija from zaposleni where $visible_is_true - order by grupa,id + order by grupa,num,id "; # print "$sql"; $sth = $dbh->prepare("$sql"); $sth->execute(); + $pos=1; + while ($row=$sth->fetchrow_hash()) { - $data[]=$row; + if ($row[pozicija]=="c") { + $data[]=$row; // duplicate if center + $pos=1; + } else { + if ($pos % 2 == 1) $row[pozicija]="l"; + else $row[pozicija]="r"; + $data[]=$row; + $pos++; + } } $smarty->assign( "data", $data );