2 |
|
|
3 |
include("inc/head.inc"); |
include("inc/head.inc"); |
4 |
include("inc/prava.inc"); |
include("inc/prava.inc"); |
5 |
|
include("inc/checkbox.inc"); |
6 |
|
include("inc/sap_org_jed.inc"); |
7 |
|
|
8 |
if (! isset($from)) { |
if (! isset($from)) { |
9 |
$from=0; |
$from=0; |
10 |
|
$podesavanje="on"; $umrezavanje="on"; |
11 |
} |
} |
12 |
|
|
13 |
if (! isset($kontakt_osoba_id) || ! intval($kontakt_osoba_id)!=0) { |
if (! isset($kontakt_osoba_id) || ! intval($kontakt_osoba_id)!=0) { |
41 |
echo ">$text</option>"; |
echo ">$text</option>"; |
42 |
} |
} |
43 |
|
|
|
function checkbox($name,$current) { |
|
|
echo "<input type=\"checkbox\" name=\"$name\""; |
|
|
if (isset($current)) { |
|
|
echo " checked"; |
|
|
} |
|
|
echo ">"; |
|
|
} |
|
44 |
|
|
45 |
if (! isset($sql_upit)) { $sql_upit="novi_na_vrh"; } |
if (! isset($sql_upit)) { $sql_upit="novi_na_vrh"; } |
46 |
|
|
57 |
option("novi_na_vrh","noviji na početak popisa",$sql_upit); |
option("novi_na_vrh","noviji na početak popisa",$sql_upit); |
58 |
option("order_ime","sortirano po imenu",$sql_upit); |
option("order_ime","sortirano po imenu",$sql_upit); |
59 |
option("order_prezime","sortirano po prezimenu",$sql_upit); |
option("order_prezime","sortirano po prezimenu",$sql_upit); |
60 |
|
option("umrezavanje","potrebno umrežavanje",$sql_upit); |
61 |
|
|
62 |
echo ' </select> |
echo ' </select> |
63 |
<small><i>za opcije označenje zvjezdicom (*) prvo morate |
<small><i>za opcije označenje zvjezdicom (*) prvo morate |
77 |
|
|
78 |
$on_page=50; |
$on_page=50; |
79 |
|
|
|
$conn = pg_connect("dbname=informatika user=dpavlin"); |
|
|
|
|
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=org_jed_id |
$sql_where=" |
87 |
and org_pod_jed.pod_id=org_pod_jed_id |
kontakt_osoba_id=kontakt_osobe.id |
88 |
and kontakt_osoba_id=kontakt_osobe.id |
and osobe.aktivna=true |
89 |
"; |
"; |
90 |
$sql_order="order by id"; |
$sql_order="order by id"; |
91 |
|
|
105 |
case "novi_na_vrh": |
case "novi_na_vrh": |
106 |
$sql_order="order by id desc"; |
$sql_order="order by id desc"; |
107 |
break; |
break; |
108 |
|
case "umrezavanje": |
109 |
|
$sql_where.=" and umrezavanje is true"; |
110 |
|
break; |
111 |
} |
} |
112 |
} |
} |
113 |
|
|
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.= |
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>"; |
144 |
<th>organizacijska jedinica</th> |
<th>organizacijska jedinica</th> |
145 |
<th>status zahtjeva</th> |
<th>status zahtjeva</th> |
146 |
<th>kontakt osoba</th> |
<th>kontakt osoba</th> |
147 |
|
<td><small>",pg_numrows($result),"</small></td> |
148 |
</tr> |
</tr> |
149 |
"; |
"; |
150 |
|
|
151 |
include("inc/print_bool.inc"); |
include("inc/print_bool2.inc"); |
152 |
|
|
153 |
|
|
154 |
for ($k = 0; $k < pg_numrows($result); $k++) { |
for ($k = 0; $k < pg_numrows($result); $k++) { |
155 |
$row=pg_fetch_array($result,$k); |
$row=pg_fetch_array($result,$k); |
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]"); |
$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++) { |
172 |
$row1=pg_fetch_array($result1,$l); |
$row1=pg_fetch_array($result1,$l); |
173 |
print "<small>$row1[datum]</small> $row1[opis]<br>"; |
print "<small>$row1[datum]</small> $row1[opis]<br>"; |