6 |
include("inc/bgcolor.inc"); |
include("inc/bgcolor.inc"); |
7 |
|
|
8 |
if (isset($kontakt_osoba_id) && $what!="relogin") { |
if (isset($kontakt_osoba_id) && $what!="relogin") { |
9 |
$sth = $dbh->prepare("select ime,prezime,passwd,prava from kontakt_osobe where aktivna=true and id=$kontakt_osoba_id"); |
$result = pg_Exec ($conn, "select ime,prezime,passwd,prava from kontakt_osobe where aktivna=true and id=$kontakt_osoba_id"); |
10 |
$sth->execute(); |
$korow=pg_fetch_array($result,0); |
|
$korow=$sth->fetchrow_hash(); |
|
11 |
# print "--$korow[passwd] | $md5_passwd | $passwd "; |
# print "--$korow[passwd] | $md5_passwd | $passwd "; |
12 |
$prava=$korow[prava]; |
$prava=$korow[prava]; |
13 |
print "<small>Trenutno ste prijavljeni kao $korow[ime] $korow[prezime], ako je to krivo odaberite <a href=\"$PHP_SELF?what=relogin\">ovaj link</a>.</small>"; |
print "<small>Trenutno ste prijavljeni kao $korow[ime] $korow[prezime], ako je to krivo odaberite <a href=\"$PHP_SELF?what=relogin\">ovaj link</a>.</small>"; |
35 |
include("inc/obavjest-forma.inc"); |
include("inc/obavjest-forma.inc"); |
36 |
} elseif (isset($id) && $what!="auth") { |
} elseif (isset($id) && $what!="auth") { |
37 |
|
|
38 |
$sth = $dbh->prepare(" |
|
39 |
|
$result = pg_Exec ($conn, " |
40 |
select osobe.id as id,ime,prezime,tel,lokacije.naziv as lok,sifra, |
select osobe.id as id,ime,prezime,tel,lokacije.naziv as lok,sifra, |
41 |
org_jed.naziv as orgjed,org_pod_jed.pod_naziv as orgpodjed, |
org_jed.naziv as orgjed,org_pod_jed.pod_naziv as orgpodjed, |
42 |
lok_racunala as lokrac,objekt,kat,soba,z_rac,podesavanje, |
lok_racunala as lokrac,objekt,kat,soba,z_rac,podesavanje, |
43 |
umrezavanje,shell |
umrezavanje,shell |
44 |
from osobe,lokacije,org_jed,org_pod_jed |
from osobe |
45 |
where osobe.id=$id |
where osobe.id=$id |
46 |
and lokacija_id=lokacije.id and org_jed_id=org_jed.id |
and lokacija_id=lokacije.id and org_jed_id=org_jed.id |
47 |
and org_pod_jed_id=org_pod_jed.pod_id |
and org_pod_jed_id=org_pod_jed.pod_id |
48 |
order by lokacije.naziv,org_jed.naziv |
order by lokacije.naziv,org_jed.naziv |
49 |
"); |
"); |
50 |
|
|
51 |
$sth->execute(); |
if (pg_numrows($result) > 0) { |
52 |
|
$row=pg_fetch_array($result,0); |
|
if ($row=$sth->fetchrow_hash()) { |
|
53 |
|
|
54 |
print " |
print " |
55 |
<h1>Podaci o osobi</h1> |
<h1>Podaci o osobi</h1> |
85 |
|
|
86 |
$instaliran=0; |
$instaliran=0; |
87 |
|
|
88 |
$sth = $dbh->prepare("select status.id as status_id,datum,opis,ime,prezime,status_tip_id as st |
$result = pg_Exec ($conn, "select status.id as status_id,datum,opis,ime,prezime,status_tip_id as st |
89 |
from status,kontakt_osobe,status_tip |
from status,kontakt_osobe,status_tip |
90 |
where kontakt_osoba_id=kontakt_osobe.id and status_tip_id=status_tip.id |
where kontakt_osoba_id=kontakt_osobe.id and status_tip_id=status_tip.id |
91 |
and osoba_id=$id order by datum"); |
and osoba_id=$id order by datum"); |
|
$sth->execute(); |
|
92 |
|
|
93 |
$statusi=""; |
$statusi=""; |
94 |
|
|
95 |
$nr=0; |
$nr = pg_numrows($result); |
96 |
while($row=$sth->fetchrow_hash()) { |
if ($nr > 0) { |
97 |
if ($row[st] != 2) { |
for ($i=0; $i<$nr; $i++) { |
98 |
$statusi.="<tr ".bgcolor()."><td><small>$row[datum]</small></td><td>$row[opis]</td><td>$row[ime] $row[prezime]</td></tr>"; |
$row=pg_fetch_array($result,$i); |
99 |
} else { |
if ($row[st] != 2) { |
100 |
$statusi.="<tr ".bgcolor()."><td><small>$row[datum]</small></td><td><a href=\"promjene.php?osoba_id=$id&status_id=$row[status_id]\">$row[opis]</a></td><td>$row[ime] $row[prezime]</td></tr>"; |
$statusi.="<tr ".bgcolor()."><td><small>$row[datum]</small></td><td>$row[opis]</td><td>$row[ime] $row[prezime]</td></tr>"; |
101 |
|
} else { |
102 |
|
$statusi.="<tr ".bgcolor()."><td><small>$row[datum]</small></td><td><a href=\"promjene.php?osoba_id=$id&status_id=$row[status_id]\">$row[opis]</a></td><td>$row[ime] $row[prezime]</td></tr>"; |
103 |
|
} |
104 |
|
if ($row[st] == 6) { $instaliran = 1; }; |
105 |
} |
} |
106 |
if ($row[st] == 6) { $instaliran = 1; }; |
} else { |
|
$nr++; |
|
|
} |
|
|
|
|
|
if ($nr == 0) { |
|
107 |
$statusi.="<p><big>Nema podataka o korisničkom računu</big>"; |
$statusi.="<p><big>Nema podataka o korisničkom računu</big>"; |
108 |
} |
} |
109 |
|
|
110 |
|
|
111 |
$sth = $dbh->prepare("select racuni.login as login, |
$result = pg_Exec ($conn, "select racuni.login as login, |
112 |
racuni.passwd as passwd,e_mail.alias as email |
racuni.passwd as passwd,e_mail.alias as email |
|
from racuni,e_mail |
|
113 |
where racuni.osoba_id=$id and e_mail.osoba_id=$id"); |
where racuni.osoba_id=$id and e_mail.osoba_id=$id"); |
|
$sth->execute(); |
|
114 |
|
|
115 |
if ($row=$sth->fetchrow_hash()) { |
if (pg_numrows($result) > 0) { |
116 |
|
$row=pg_fetch_array($result,0); |
117 |
|
|
118 |
print " |
print " |
119 |
<h1>Podaci o korisničkom računu</h1> |
<h1>Podaci o korisničkom računu</h1> |
164 |
} |
} |
165 |
|
|
166 |
$statusi.="<td><select name=status_tip_id>"; |
$statusi.="<td><select name=status_tip_id>"; |
167 |
|
$min_status=5; |
168 |
|
if ($prava==$pr_admin) $min_status=3; |
169 |
|
|
170 |
$sth = $dbh->prepare("select id,opis |
$result = pg_Exec ($conn, "select id,opis |
171 |
from status_tip |
from status_tip |
172 |
where id >= 5 |
where id >= $min_status |
173 |
"); |
"); |
|
$sth->execute(); |
|
174 |
|
|
175 |
$num_prava=0; |
$num_prava=0; |
176 |
|
|
177 |
while ($row=$sth->fetchrow_hash()) { |
for ($i=0; $i<pg_numrows($result); $i++) { |
178 |
|
$row=pg_fetch_array($result,$i); |
179 |
if ($prava & pow(2,$row[id])) { |
if ($prava & pow(2,$row[id])) { |
180 |
$statusi.="<option value=$row[id]>$row[opis]</option>\n"; |
$statusi.="<option value=$row[id]>$row[opis]</option>\n"; |
181 |
$num_prava++; |
$num_prava++; |
198 |
<hr> |
<hr> |
199 |
"; |
"; |
200 |
|
|
201 |
} else { // nema rezultata |
} else { // pg_numrows($result) > 0 |
202 |
print "<p><big>Nema podataka o osobi sa id-jem $id</big>"; |
print "<p><big>Nema podataka o osobi sa id-jem $id</big>"; |
203 |
} |
} // pg_numrows($result) > 0 |
204 |
|
|
205 |
include("inc/obavjest-forma.inc"); |
include("inc/obavjest-forma.inc"); |
206 |
|
|