3 |
include("inc/head.inc"); |
include("inc/head.inc"); |
4 |
include("inc/prava.inc"); |
include("inc/prava.inc"); |
5 |
include("inc/checkbox.inc"); |
include("inc/checkbox.inc"); |
6 |
|
include("inc/sap_org_jed.inc"); |
7 |
|
|
8 |
if (! isset($from)) { |
if (! isset($from)) { |
9 |
$from=0; |
$from=0; |
79 |
|
|
80 |
$sql_polja="osobe.id as id,osobe.ime as ime, |
$sql_polja="osobe.id as id,osobe.ime as ime, |
81 |
osobe.prezime as prezime, |
osobe.prezime as prezime, |
|
org_jed.naziv||'<br><small>'||org_pod_jed.pod_naziv||'<small>' as orgjed, |
|
82 |
kontakt_osobe.ime||' '||kontakt_osobe.prezime as kontakt_osoba, |
kontakt_osobe.ime||' '||kontakt_osobe.prezime as kontakt_osoba, |
83 |
e_mail,kontakt_osoba_id |
e_mail,kontakt_osoba_id,sifra |
84 |
"; |
"; |
85 |
$sql_tablice="osobe,org_jed,kontakt_osobe"; |
$sql_tablice="osobe,kontakt_osobe"; |
86 |
$sql_where="org_jed.id=osobe.org_jed_id |
$sql_where=" |
87 |
and org_pod_jed.pod_id=osobe.org_pod_jed_id |
kontakt_osoba_id=kontakt_osobe.id |
|
and kontakt_osoba_id=kontakt_osobe.id |
|
88 |
and osobe.aktivna=true |
and osobe.aktivna=true |
89 |
"; |
"; |
90 |
$sql_order="order by id"; |
$sql_order="order by id"; |
122 |
} |
} |
123 |
|
|
124 |
if (isset($imepr) && $imepr != "") { |
if (isset($imepr) && $imepr != "") { |
125 |
$sql_where.=" and osobe.aktivna=true and ( upper(toczs(osobe.ime)) like upper(toczs('$imepr')) or upper(toczs(osobe.prezime)) like upper(toczs('$imepr')) )"; |
$sql_where.= |
126 |
|
"and (upper(toczs(osobe.prezime)) like upper(toczs('$imepr')) |
127 |
|
or upper(toczs(osobe.ime)) like upper(toczs('$imepr')))"; |
128 |
} |
} |
129 |
|
|
130 |
$sql="select $sql_polja from $sql_tablice where $sql_where $sql_order limit $on_page,$from"; |
$sql="select $sql_polja |
131 |
|
from $sql_tablice |
132 |
|
where $sql_where |
133 |
|
$sql_order |
134 |
|
limit $on_page,$from"; |
135 |
|
|
136 |
# echo "<pre>$sql</pre>"; |
# echo "<pre>$sql</pre>"; |
137 |
# echo "<pre>$sql_where</pre>"; |
# echo "<pre>$sql_where</pre>"; |
165 |
print "$row[id]"; |
print "$row[id]"; |
166 |
} |
} |
167 |
print "</td><td>$row[ime] $row[prezime]</td> |
print "</td><td>$row[ime] $row[prezime]</td> |
168 |
<td>$row[orgjed]</td><td>"; |
<td><small>".sap_org_jed($row[sifra])."</small></td><td>"; |
169 |
|
|
170 |
$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"); |
$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"); |
171 |
for ($l = 0; $l < pg_numrows($result1); $l++) { |
for ($l = 0; $l < pg_numrows($result1); $l++) { |