1 |
<? |
2 |
|
3 |
$sql="select titula,ime,note,tel,email,pozicija |
4 |
from zaposleni where $visible_is_true |
5 |
order by grupa,num,id |
6 |
"; |
7 |
# print "$sql"; |
8 |
$sth = $dbh->prepare("$sql"); |
9 |
$sth->execute(); |
10 |
|
11 |
$pos=1; |
12 |
|
13 |
while ($row=$sth->fetchrow_hash()) { |
14 |
if ($row[pozicija]=="c") { |
15 |
$data[]=$row; // duplicate if center |
16 |
$pos=1; |
17 |
} else { |
18 |
if ($pos % 2 == 1) $row[pozicija]="l"; |
19 |
else $row[pozicija]="r"; |
20 |
$data[]=$row; |
21 |
$pos++; |
22 |
} |
23 |
} |
24 |
|
25 |
$smarty->assign( "data", $data ); |
26 |
$main=$smarty->fetch("zaposleni.tpl"); |
27 |
|
28 |
?> |