/[informatika.old]/html/osoba.php
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /html/osoba.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5 by dpavlin, Wed Jun 28 07:28:34 2000 UTC revision 1.9 by dpavlin, Fri Jul 28 09:54:19 2000 UTC
# Line 38  Line 38 
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");
# Line 48  Line 48 
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    
# Line 75  Line 75 
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
# Line 170  Line 170 
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,
# Line 187  Line 190 
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";

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.9

  ViewVC Help
Powered by ViewVC 1.1.26