14 |
Odaberite Vaše ime i prezime: |
Odaberite Vaše ime i prezime: |
15 |
<select name="kontakt_osoba_id">'; |
<select name="kontakt_osoba_id">'; |
16 |
|
|
17 |
$result = pg_Exec ($conn, "select id,ime,prezime from kontakt_osobe |
$sth = $dbh->prepare("select id,ime,prezime from kontakt_osobe |
18 |
where aktivna=true order by ime"); |
where aktivna=true order by ime"); |
19 |
for ($k = 0; $k < pg_numrows($result); $k++) { |
$sth->execute(); |
20 |
$row=pg_fetch_array($result,$k); |
while ($row=$sth->fetchrow_hash()) { |
21 |
echo "<option value=\"$row[id]\""; |
echo "<option value=\"$row[id]\""; |
22 |
if ($row[id]==$kontakt_osoba_id) { echo " selected"; } |
if ($row[id]==$kontakt_osoba_id) { echo " selected"; } |
23 |
echo ">$row[ime] $row[prezime]</option>\n"; |
echo ">$row[ime] $row[prezime]</option>\n"; |
26 |
<input type=submit value="Posebno označi moje zahtjeve"> |
<input type=submit value="Posebno označi moje zahtjeve"> |
27 |
</form>'; |
</form>'; |
28 |
} else { |
} else { |
29 |
$result = pg_Exec ($conn, "select ime,prezime,passwd,prava from kontakt_osobe where aktivna=true and id=$kontakt_osoba_id"); |
$sth = $dbh->prepare("select ime,prezime,passwd,prava from kontakt_osobe where aktivna=true and id=$kontakt_osoba_id"); |
30 |
$row=pg_fetch_array($result,0); |
$row=$sth->fetchrow_hash(); |
31 |
print "<small>Trenutno ste prijavljeni kao $row[ime] $row[prezime], ako je to krivo odaberite <a href=\"$PHP_SELF?what=relogin\">ovaj link</a>.</small>"; |
print "<small>Trenutno ste prijavljeni kao $row[ime] $row[prezime], ako je to krivo odaberite <a href=\"$PHP_SELF?what=relogin\">ovaj link</a>.</small>"; |
32 |
$prava=$row[prava]; |
$prava=$row[prava]; |
33 |
} |
} |
66 |
if (isset($kontakt_osoba_id)) { |
if (isset($kontakt_osoba_id)) { |
67 |
echo '<input type=hidden name=kontakt_osoba_id value='.$kontakt_osoba_id.'>'; |
echo '<input type=hidden name=kontakt_osoba_id value='.$kontakt_osoba_id.'>'; |
68 |
} |
} |
69 |
|
|
70 |
echo '<br><small>Prikaži status zahtjeva za: |
echo '<br><small>Prikaži status zahtjeva za: |
71 |
',checkbox("shell",$shell),' shell |
',checkbox("shell",$shell),' shell |
72 |
',checkbox("podesavanje",$podesavanje),' podešavanje |
',checkbox("podesavanje",$podesavanje),' podešavanje |
77 |
|
|
78 |
$on_page=50; |
$on_page=50; |
79 |
|
|
80 |
$conn = pg_connect("dbname=informatika user=dpavlin"); |
$sql_polja="osobe.id as id,osobe.ime as ime, |
81 |
|
osobe.prezime as prezime, |
82 |
$sql_polja="osobe.id as id,osobe.ime as ime, |
org_jed.naziv||'<br><small>'||org_pod_jed.pod_naziv||'<small>' as orgjed, |
83 |
osobe.prezime as prezime, |
kontakt_osobe.ime||' '||kontakt_osobe.prezime as kontakt_osoba, |
84 |
org_jed.naziv||'<br><small>'||org_pod_jed.pod_naziv||'<small>' as orgjed, |
e_mail,kontakt_osoba_id |
85 |
kontakt_osobe.ime||' '||kontakt_osobe.prezime as kontakt_osoba, |
"; |
86 |
e_mail,kontakt_osoba_id |
$sql_tablice="osobe,org_jed,kontakt_osobe"; |
87 |
"; |
$sql_where="org_jed.id=org_jed_id |
88 |
$sql_tablice="osobe,org_jed,kontakt_osobe"; |
and org_pod_jed.pod_id=org_pod_jed_id |
89 |
$sql_where="org_jed.id=org_jed_id |
and kontakt_osoba_id=kontakt_osobe.id |
90 |
and org_pod_jed.pod_id=org_pod_jed_id |
"; |
91 |
and kontakt_osoba_id=kontakt_osobe.id |
$sql_order="order by id"; |
|
"; |
|
|
$sql_order="order by id"; |
|
92 |
|
|
93 |
if (isset($sql_upit)) { |
if (isset($sql_upit)) { |
94 |
switch($sql_upit) { |
switch($sql_upit) { |
130 |
|
|
131 |
# echo "<pre>$sql</pre>"; |
# echo "<pre>$sql</pre>"; |
132 |
# echo "<pre>$sql_where</pre>"; |
# echo "<pre>$sql_where</pre>"; |
133 |
$result = pg_Exec ($conn, "$sql"); |
$sth = $dbh->prepare("$sql"); |
134 |
|
|
135 |
echo "<table border=1> |
echo "<table border=1> |
136 |
<tr> |
<tr> |
139 |
<th>organizacijska jedinica</th> |
<th>organizacijska jedinica</th> |
140 |
<th>status zahtjeva</th> |
<th>status zahtjeva</th> |
141 |
<th>kontakt osoba</th> |
<th>kontakt osoba</th> |
142 |
<td><small>",pg_numrows($result),"</small></td> |
<td><small>",$sth->rows(),"</small></td> |
143 |
</tr> |
</tr> |
144 |
"; |
"; |
145 |
|
|
146 |
include("inc/print_bool2.inc"); |
include("inc/print_bool2.inc"); |
147 |
|
|
148 |
|
$k=0; |
149 |
for ($k = 0; $k < pg_numrows($result); $k++) { |
while ($row=$sth->fetchrow_hash()) { |
|
$row=pg_fetch_array($result,$k); |
|
150 |
if ($k % 2 != 0) { |
if ($k % 2 != 0) { |
151 |
print "<tr>"; |
print "<tr>"; |
152 |
} else { |
} else { |
153 |
print '<tr bgcolor="#f0f0f0">'; |
print '<tr bgcolor="#f0f0f0">'; |
154 |
} |
} |
155 |
|
$k++; |
156 |
print "<td>"; |
print "<td>"; |
157 |
if ($row[kontakt_osoba_id]==$kontakt_osoba_id || isset($prava) && $prava==$pr_admin) { |
if ($row[kontakt_osoba_id]==$kontakt_osoba_id || isset($prava) && $prava==$pr_admin) { |
158 |
print "<a href=\"osoba.php?what=select-osoba&id=$row[id]\">$row[id]</a>"; |
print "<a href=\"osoba.php?what=select-osoba&id=$row[id]\">$row[id]</a>"; |
162 |
print "</td><td>$row[ime] $row[prezime]</td> |
print "</td><td>$row[ime] $row[prezime]</td> |
163 |
<td>$row[orgjed]</td><td>"; |
<td>$row[orgjed]</td><td>"; |
164 |
|
|
165 |
$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"); |
$sth1 = $dbh->prepare("select datum,opis from status,status_tip where status.status_tip_id=status_tip.id and osoba_id=$row[id] order by datum"); |
166 |
for ($l = 0; $l < pg_numrows($result1); $l++) { |
while ($row1=$sth1->fetchrow_hash()) { |
|
$row1=pg_fetch_array($result1,$l); |
|
167 |
print "<small>$row1[datum]</small> $row1[opis]<br>"; |
print "<small>$row1[datum]</small> $row1[opis]<br>"; |
168 |
} |
} |
169 |
print "</td><td><a href=\"mailto:$row[e_mail]\">$row[kontakt_osoba]</a><small>"; |
print "</td><td><a href=\"mailto:$row[e_mail]\">$row[kontakt_osoba]</a><small>"; |
198 |
echo " "; |
echo " "; |
199 |
} |
} |
200 |
|
|
201 |
if (pg_numrows($result) >= $on_page) { |
if ($sth->rows() >= $on_page) { |
202 |
echo "<a href=$PHP_SELF?from=".($from+$on_page)."&sql_upit=$sql_upit>+</a> "; |
echo "<a href=$PHP_SELF?from=".($from+$on_page)."&sql_upit=$sql_upit>+</a> "; |
203 |
} else { |
} else { |
204 |
echo " "; |
echo " "; |