6 |
|
|
7 |
if (! isset($from)) { |
if (! isset($from)) { |
8 |
$from=0; |
$from=0; |
9 |
|
$podesavanje="on"; $umrezavanje="on"; |
10 |
} |
} |
11 |
|
|
12 |
if (! isset($kontakt_osoba_id) || ! intval($kontakt_osoba_id)!=0) { |
if (! isset($kontakt_osoba_id) || ! intval($kontakt_osoba_id)!=0) { |
76 |
|
|
77 |
$on_page=50; |
$on_page=50; |
78 |
|
|
|
$conn = pg_connect("dbname=informatika user=dpavlin"); |
|
|
|
|
79 |
$sql_polja="osobe.id as id,osobe.ime as ime, |
$sql_polja="osobe.id as id,osobe.ime as ime, |
80 |
osobe.prezime as prezime, |
osobe.prezime as prezime, |
81 |
org_jed.naziv||'<br><small>'||org_pod_jed.pod_naziv||'<small>' as orgjed, |
org_jed.naziv||'<br><small>'||org_pod_jed.pod_naziv||'<small>' as orgjed, |
83 |
e_mail,kontakt_osoba_id |
e_mail,kontakt_osoba_id |
84 |
"; |
"; |
85 |
$sql_tablice="osobe,org_jed,kontakt_osobe"; |
$sql_tablice="osobe,org_jed,kontakt_osobe"; |
86 |
$sql_where="org_jed.id=org_jed_id |
$sql_where="org_jed.id=osobe.org_jed_id |
87 |
and org_pod_jed.pod_id=org_pod_jed_id |
and org_pod_jed.pod_id=osobe.org_pod_jed_id |
88 |
and kontakt_osoba_id=kontakt_osobe.id |
and kontakt_osoba_id=kontakt_osobe.id |
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 ( upper(toczs(osobe.ime)) like upper(toczs('$imepr')) or upper(toczs(osobe.prezime)) like upper(toczs('$imepr')) )"; |
$sql_where.=" and osobe.aktivna=true and ( upper(toczs(osobe.ime)) like upper(toczs('$imepr')) or upper(toczs(osobe.prezime)) like upper(toczs('$imepr')) )"; |
126 |
} |
} |
127 |
|
|
128 |
$sql="select $sql_polja from $sql_tablice where $sql_where $sql_order limit $on_page,$from"; |
$sql="select $sql_polja from $sql_tablice where $sql_where $sql_order limit $on_page,$from"; |