4 |
include("inc/prava.inc"); |
include("inc/prava.inc"); |
5 |
include("inc/print_bool2.inc"); |
include("inc/print_bool2.inc"); |
6 |
include("inc/bgcolor.inc"); |
include("inc/bgcolor.inc"); |
7 |
|
include("inc/show_bool.inc"); |
8 |
|
include("inc/auth_pop3.inc"); |
9 |
|
|
10 |
if (isset($kontakt_osoba_id) && $what!="relogin") { |
if (isset($kontakt_osoba_id) && $what!="relogin") { |
11 |
$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"); |
12 |
$sth->execute(); |
$korow=pg_fetch_array($result,0); |
|
$korow=$sth->fetchrow_hash(); |
|
13 |
# print "--$korow[passwd] | $md5_passwd | $passwd "; |
# print "--$korow[passwd] | $md5_passwd | $passwd "; |
14 |
$prava=$korow[prava]; |
$prava=$korow[prava]; |
15 |
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>"; |
37 |
include("inc/obavjest-forma.inc"); |
include("inc/obavjest-forma.inc"); |
38 |
} elseif (isset($id) && $what!="auth") { |
} elseif (isset($id) && $what!="auth") { |
39 |
|
|
40 |
$sth = $dbh->prepare(" |
|
41 |
|
$result = pg_Exec ($conn, " |
42 |
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, |
43 |
org_jed.naziv as orgjed,org_pod_jed.pod_naziv as orgpodjed, |
org_jed.naziv as orgjed,org_pod_jed.pod_naziv as orgpodjed, |
44 |
lok_racunala as lokrac,objekt,kat,soba,z_rac,podesavanje, |
lok_racunala as lokrac,objekt,kat,soba,z_rac,podesavanje, |
50 |
order by lokacije.naziv,org_jed.naziv |
order by lokacije.naziv,org_jed.naziv |
51 |
"); |
"); |
52 |
|
|
53 |
$sth->execute(); |
if (pg_numrows($result) > 0) { |
54 |
|
$row=pg_fetch_array($result,0); |
|
if ($row=$sth->fetchrow_hash()) { |
|
55 |
|
|
56 |
print " |
print " |
57 |
<h1>Podaci o osobi</h1> |
<h1>Podaci o osobi</h1> |
87 |
|
|
88 |
$instaliran=0; |
$instaliran=0; |
89 |
|
|
90 |
$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 |
91 |
from status,kontakt_osobe,status_tip |
from status,kontakt_osobe,status_tip |
92 |
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 |
93 |
and osoba_id=$id order by datum"); |
and status.osoba_id=$id order by datum"); |
|
$sth->execute(); |
|
94 |
|
|
95 |
$statusi=""; |
$statusi=""; |
96 |
|
|
97 |
$nr=0; |
$nr = pg_numrows($result); |
98 |
while($row=$sth->fetchrow_hash()) { |
if ($nr > 0) { |
99 |
if ($row[st] != 2) { |
for ($i=0; $i<$nr; $i++) { |
100 |
$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); |
101 |
} else { |
if ($row[st] != 2) { |
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>"; |
$statusi.="<tr ".bgcolor()."><td><small>$row[datum]</small></td><td>$row[opis]</td><td>$row[ime] $row[prezime]</td></tr>"; |
103 |
|
} else { |
104 |
|
$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>"; |
105 |
|
} |
106 |
|
if ($row[st] == 6) { $instaliran = 1; }; |
107 |
} |
} |
108 |
if ($row[st] == 6) { $instaliran = 1; }; |
} else { |
|
$nr++; |
|
|
} |
|
|
|
|
|
if ($nr == 0) { |
|
109 |
$statusi.="<p><big>Nema podataka o korisničkom računu</big>"; |
$statusi.="<p><big>Nema podataka o korisničkom računu</big>"; |
110 |
} |
} |
111 |
|
|
112 |
|
|
113 |
$sth = $dbh->prepare("select racuni.login as login, |
$result = pg_Exec ($conn, "select racuni.login as login, |
114 |
racuni.passwd as passwd,e_mail.alias as email |
racuni.passwd as passwd,e_mail.alias as email |
115 |
where racuni.osoba_id=$id and e_mail.osoba_id=$id"); |
where racuni.osoba_id=$id and e_mail.osoba_id=$id"); |
|
$sth->execute(); |
|
116 |
|
|
117 |
if ($row=$sth->fetchrow_hash()) { |
if (pg_numrows($result) > 0) { |
118 |
|
$row=pg_fetch_array($result,0); |
119 |
|
|
120 |
print " |
print " |
121 |
<h1>Podaci o korisničkom računu</h1> |
<h1>Podaci o korisničkom računu</h1> |
122 |
|
|
123 |
|
<form action=$PHP_SELF method=post> |
124 |
|
|
125 |
<table> |
<table> |
126 |
<tr><td>Korisnička oznaka:</td><td><tt>$row[login]</tt></td></tr> |
<tr><td>Korisnička oznaka:</td><td><tt>$row[login]</tt></td></tr> |
127 |
"; |
"; |
128 |
if ($prava & $pr_instalacija) { |
if ($prava & $pr_instalacija) { |
129 |
print "<tr><td>Lozinka:</td><td><tt>$row[passwd]</tt></td></tr>"; |
print "<tr><td>Lozinka:</td><td><tt>$row[passwd]</tt>"; |
130 |
|
$passwd_ok="?"; |
131 |
|
if ($check_pop) { |
132 |
|
$pop3 = new POP3(); |
133 |
|
$pop3->connect("intranet.pliva.hr"); |
134 |
|
if ($pop3->checklogin($row[login],$row[passwd])) { |
135 |
|
$passwd_ok="t"; |
136 |
|
} else { |
137 |
|
$passwd_ok="f"; |
138 |
|
} |
139 |
|
$pop3->quit(); |
140 |
|
print show_bool($passwd_ok); |
141 |
|
} else { |
142 |
|
print "<input type=hidden name=id value=$id> |
143 |
|
<input type=submit name=check_pop value=\"Provjeri\"> |
144 |
|
"; |
145 |
|
} |
146 |
|
print "</td></tr>"; |
147 |
} else { |
} else { |
148 |
print "<tr><td colspan=2><i>Nemate ovlaštenja vidjeti lozinku ovog korisnika!</i></td></tr>"; |
print "<tr><td colspan=2><i>Nemate ovlaštenja vidjeti lozinku ovog korisnika!</i></td></tr>"; |
149 |
} |
} |
158 |
|
|
159 |
|
|
160 |
print " |
print " |
161 |
|
</form> |
162 |
|
|
163 |
<h1>Podaci o statusima korisničkog računa</h1> |
<h1>Podaci o statusima korisničkog računa</h1> |
164 |
|
|
165 |
<form action=oznaci.php> |
<form action=oznaci.php> |
187 |
} |
} |
188 |
|
|
189 |
$statusi.="<td><select name=status_tip_id>"; |
$statusi.="<td><select name=status_tip_id>"; |
190 |
|
$min_status=5; |
191 |
|
if ($prava==$pr_admin) $min_status=3; |
192 |
|
|
193 |
$sth = $dbh->prepare("select id,opis |
$result = pg_Exec ($conn, "select id,opis |
194 |
from status_tip |
from status_tip |
195 |
where id >= 5 |
where id >= $min_status |
196 |
"); |
"); |
|
$sth->execute(); |
|
197 |
|
|
198 |
$num_prava=0; |
$num_prava=0; |
199 |
|
|
200 |
while ($row=$sth->fetchrow_hash()) { |
for ($i=0; $i<pg_numrows($result); $i++) { |
201 |
|
$row=pg_fetch_array($result,$i); |
202 |
if ($prava & pow(2,$row[id])) { |
if ($prava & pow(2,$row[id])) { |
203 |
$statusi.="<option value=$row[id]>$row[opis]</option>\n"; |
$statusi.="<option value=$row[id]>$row[opis]</option>\n"; |
204 |
$num_prava++; |
$num_prava++; |
221 |
<hr> |
<hr> |
222 |
"; |
"; |
223 |
|
|
224 |
} else { // nema rezultata |
} else { // pg_numrows($result) > 0 |
225 |
print "<p><big>Nema podataka o osobi sa id-jem $id</big>"; |
print "<p><big>Nema podataka o osobi sa id-jem $id</big>"; |
226 |
} |
} // pg_numrows($result) > 0 |
227 |
|
|
228 |
include("inc/obavjest-forma.inc"); |
include("inc/obavjest-forma.inc"); |
229 |
|
|