37 |
$result = pg_Exec ($conn, "select ime,prezime,passwd from kontakt_osobe where aktivna=true and id=$kontakt_osoba_id"); |
$result = pg_Exec ($conn, "select ime,prezime,passwd from kontakt_osobe where aktivna=true and id=$kontakt_osoba_id"); |
38 |
$row=pg_fetch_array($result,0); |
$row=pg_fetch_array($result,0); |
39 |
# print "--$row[passwd] | $md5_passwd | $passwd "; |
# print "--$row[passwd] | $md5_passwd | $passwd "; |
40 |
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>"; |
41 |
$curr_md5_passwd=md5($row[passwd]); |
$curr_md5_passwd=md5($row[passwd]); |
42 |
if ( (!isset($md5_passwd) && $row[passwd] != $passwd) || |
if ( (!isset($md5_passwd) && $row[passwd] != $passwd) || |
43 |
(isset($md5_passwd) && $curr_md5_passwd != $md5_passwd) ) { |
(isset($md5_passwd) && $curr_md5_passwd != $md5_passwd) ) { |
59 |
} elseif (isset($lookup) && isset($sifra)) { |
} elseif (isset($lookup) && isset($sifra)) { |
60 |
|
|
61 |
$warn="<i>Polja označena zvjezdicom (*) su obavezna</i>"; |
$warn="<i>Polja označena zvjezdicom (*) su obavezna</i>"; |
62 |
$conn_mreze = pg_connect("dbname=mreze user=dpavlin"); |
$result=pg_Exec($conn,"select sifra,ime,prezime,sap2orgjed.pod_id,sap2orgjed.nad_id from sap,sap2orgjed where orgjed=sap2orgjed.sap and sifra='$sifra'"); |
|
$result=pg_Exec($conn_mreze,"select ime,prezime from iso_korisnik where sifra=$sifra"); |
|
63 |
if ($result && pg_numrows($result)>0) { |
if ($result && pg_numrows($result)>0) { |
64 |
$row=pg_fetch_array($result,0); |
$row=pg_fetch_array($result,0); |
65 |
$ime=$row[ime]; |
$ime=$row[ime]; |
66 |
$prezime=$row[prezime]; |
$prezime=$row[prezime]; |
67 |
|
$nad_select=$row[nad_id]; |
68 |
|
$pod_select="$row[nad_id] $row[pod_id]"; |
69 |
} else { |
} else { |
70 |
$warn.="<br><b>Osoba sa šifrom $sifra nije pronađena!</b>"; |
$warn.="<br><b>Osoba sa šifrom $sifra nije pronađena!</b>"; |
71 |
$sifra=""; $ime=""; $prezime=""; |
$sifra=""; $ime=""; $prezime=""; |
73 |
# $what="insert-osoba"; |
# $what="insert-osoba"; |
74 |
|
|
75 |
} elseif ($what == "insert-osoba" && check_required()) { |
} elseif ($what == "insert-osoba" && check_required()) { |
76 |
$result=pg_Exec($conn,"select id,ime,prezime from osobe where sifra='$sifra'"); |
$result=pg_Exec($conn,"select id,ime,prezime from osobe where sifra='$sifra' and aktivna=true"); |
77 |
if (pg_numrows($result) > 0 && $zap_plive=="t") { |
if (pg_numrows($result) > 0 && $zap_plive=="t") { |
78 |
$row=pg_fetch_array($result,0); |
$row=pg_fetch_array($result,0); |
79 |
$warn.="<p><big>Vaš podatak nije unešen zbog duple šifre radnika!</big> |
$warn.="<p><big>Vaš podatak nije unešen zbog duple šifre radnika!</big> |