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=base64_encode(mhash(MHASH_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) ) { |
44 |
include("inc/auth.inc"); |
include("inc/auth.inc"); |
48 |
print '<p><a href="index.php">Povratak na početnu stranicu</a>'; |
print '<p><a href="index.php">Povratak na početnu stranicu</a>'; |
49 |
} else { |
} else { |
50 |
session_register("md5_passwd"); |
session_register("md5_passwd"); |
51 |
$md5_passwd=base64_encode(mhash(MHASH_MD5,$row[passwd])); |
$md5_passwd=md5($row[passwd]); |
52 |
} |
} |
53 |
} |
} |
54 |
|
|
75 |
$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'"); |
76 |
if (pg_numrows($result) > 0 && $zap_plive=="t") { |
if (pg_numrows($result) > 0 && $zap_plive=="t") { |
77 |
$row=pg_fetch_array($result,0); |
$row=pg_fetch_array($result,0); |
78 |
$warn.="<p><big>Vaš podatakak nije unešen zbog duple šifre radnika!</big> |
$warn.="<p><big>Vaš podatak nije unešen zbog duple šifre radnika!</big> |
79 |
<p>Osoba sa šifrom $sifra već postoji. Prema |
<p>Osoba sa šifrom $sifra već postoji. Prema |
80 |
našim podacima to je $row[ime] $row[prezime] i unesena |
našim podacima to je $row[ime] $row[prezime] i unesena |
81 |
je na zahtjevu broj $row[id]. Ako ste pogriješili |
je na zahtjevu broj $row[id]. Ako ste pogriješili |
170 |
|
|
171 |
|
|
172 |
} |
} |
173 |
|
$result=pg_Exec($conn,"insert into promjene_osobe |
174 |
|
select * from osobe where id=$id"); |
175 |
|
$promjene_osobe_oid=pg_getlastoid($result); |
176 |
$sql="update osobe set |
$sql="update osobe set |
177 |
ime='$ime',prezime='$prezime',zap_plive='$zap_plive', |
ime='$ime',prezime='$prezime',zap_plive='$zap_plive', |
178 |
sifra='$sifra', org_jed_id=$org_jed_id, |
sifra='$sifra', org_jed_id=$org_jed_id, |
190 |
if ($result) { |
if ($result) { |
191 |
$warn.="<p>Podaci su promjenjeni..."; |
$warn.="<p>Podaci su promjenjeni..."; |
192 |
$result=pg_Exec($conn,"insert into status (osoba_id,kontakt_osoba_id,datum,status_tip_id) values ($id,$kontakt_osoba_id,'now'::datetime,2)"); |
$result=pg_Exec($conn,"insert into status (osoba_id,kontakt_osoba_id,datum,status_tip_id) values ($id,$kontakt_osoba_id,'now'::datetime,2)"); |
193 |
|
$status_oid=pg_getlastoid($result); |
194 |
|
$result=pg_Exec($conn,"select id from status where oid=$status_oid"); |
195 |
|
$row=pg_fetch_array($result,0); |
196 |
|
$result=pg_Exec($conn,"update promjene_osobe set status_id=$row[id] where oid=$promjene_osobe_oid"); |
197 |
|
|
198 |
} else { |
} else { |
199 |
$warn.="<p>Greška kod mijenjanja podataka"; |
$warn.="<p>Greška kod mijenjanja podataka"; |