/[informatika.old]/html/obavijest.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/obavijest.php

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

revision 1.3 by dpavlin, Wed May 10 06:26:12 2000 UTC revision 1.4 by dpavlin, Tue May 16 06:13:08 2000 UTC
# Line 1  Line 1 
1  <?  <?
2    
3  include("inc/head.inc");  include("inc/head.inc");
4    include("inc/prava.inc");
5    
6  if (! isset($id)) {  if (isset($kontakt_osoba_id) && $what!="relogin") {
7            $result = pg_Exec ($conn, "select ime,prezime,passwd,prava from kontakt_osobe where aktivna=true and id=$kontakt_osoba_id");
8            $row=pg_fetch_array($result,0);
9    #       print "--$row[passwd] | $md5_passwd | $passwd ";
10            $prava=$row[prava];
11            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>";
12            $curr_md5_passwd=base64_encode(mhash(MHASH_MD5,$row[passwd]));
13            if ( (!isset($md5_passwd) && $row[passwd] != $passwd) ||
14                    (isset($md5_passwd) && $curr_md5_passwd != $md5_passwd) ) {
15                    include("inc/auth.inc");
16                    $what="auth";
17                    echo "<big>Upisana je neispravna loznika!</big>";
18                    session_destroy();
19                    print '<p><a href="index.php">Povratak na početnu stranicu</a>';
20            } else {
21                    session_register("md5_passwd");
22                    $md5_passwd=base64_encode(mhash(MHASH_MD5,$row[passwd]));
23            }
24    }
25    
26    print "--$pr_ko--";
27    
28    if (! isset($kontakt_osoba_id)) {
29            include("inc/auth.inc");
30            $what="auth";
31    
32    } elseif (! isset($id)) {
33          include("inc/obavjest-forma.inc");          include("inc/obavjest-forma.inc");
34  } else {  } elseif (isset($id)) {
35    
36    
37  $result = pg_Exec ($conn, "  $result = pg_Exec ($conn, "
# Line 46  if (pg_numrows($result) > 0) { Line 73  if (pg_numrows($result) > 0) {
73          print "<p><big>Nema podataka o osobi sa id-jem $id</big>";          print "<p><big>Nema podataka o osobi sa id-jem $id</big>";
74  }  }
75    
76    // kreiraj statuse, zapamti da li je instaliran
77    
78    $instaliran=0;
79    
80    $result = pg_Exec ($conn, "select datum,opis,ime,prezime,status_tip_id as st
81            from status,kontakt_osobe,status_tip
82            where kontakt_osoba_id=kontakt_osobe.id and status_tip_id=status_tip.id
83            and osoba_id=$id");
84    
85    $statusi="";
86    
87    $nr = pg_numrows($result);
88    if ($nr > 0) {
89            for ($i=0;$i<$nr; $i++) {
90                    $row=pg_fetch_array($result,$i);
91                    $statusi.="<tr><td><small>$row[datum]</small></td><td>$row[opis]</td><td>$row[ime] $row[prezime]</td></tr>";
92                    if ($row[st] == 6) { $instaliran = 1; };
93            }
94    } else {
95            $statusi.="<p><big>Nema podataka o korisničkom računu</big>";
96    }
97    
98    
99  $result = pg_Exec ($conn, "select racuni.login as login,  $result = pg_Exec ($conn, "select racuni.login as login,
100          racuni.passwd as passwd,e_mail.alias as email          racuni.passwd as passwd,e_mail.alias as email
101          where racuni.osoba_id=$id and e_mail.osoba_id=$id");          where racuni.osoba_id=$id and e_mail.osoba_id=$id");
# Line 58  if (pg_numrows($result) > 0) { Line 108  if (pg_numrows($result) > 0) {
108    
109  <table>  <table>
110  <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>
111  <tr><td>Lozinka:</td><td><tt>$row[passwd]</tt></td></tr>  ";
112    if ($prava and $pr_instalacija) {
113            print "<tr><td>Lozinka:</td><td><tt>$row[passwd]</tt></td></tr>";
114    } else {
115            print "<tr><td colspan=2><i>Nemate ovlaštenja vidjeti lozinku ovog korisnika!</i></td></tr>";
116    }
117            print "
118  <tr><td>E-mail adresa:</td><td><tt>$row[email]@pliva.hr</tt></td></tr>  <tr><td>E-mail adresa:</td><td><tt>$row[email]@pliva.hr</tt></td></tr>
119  </table>  </table>
120          ";          ";
# Line 67  if (pg_numrows($result) > 0) { Line 123  if (pg_numrows($result) > 0) {
123          print "<p><big>Nema podataka o korisničkom računu</big>";          print "<p><big>Nema podataka o korisničkom računu</big>";
124  }  }
125    
 $result = pg_Exec ($conn, "select datum,opis,ime,prezime  
         from status,kontakt_osobe,status_tip  
         where kontakt_osoba_id=kontakt_osobe.id and status_tip_id=status_tip.id  
         and osoba_id=$id");  
126    
127          print "          print "
128  <h1>Podaci o statusima koriničkog računa</h1>  <h1>Podaci o statusima koriničkog računa</h1>
129    
130  <table>  <table>
131  <tr><th>datum</th><th>status</th><th>status postavio/la</th></tr>";  <tr><th>datum</th><th>status</th><th>status postavio/la</th></tr>
132    $statusi
133  $nr = pg_numrows($result);  </table>";
 if ($nr > 0) {  
         for ($i=0;$i<$nr; $i++) {  
                 $row=pg_fetch_array($result,$i);  
                 print "<tr><td><small>$row[datum]</small></td><td>$row[opis]</td><td>$row[ime] $row[prezime]</td></tr>";  
         }  
 } else {  
         print "<p><big>Nema podataka o korisničkom računu</big>";  
 }  
   
 print "</table>";  
134    
135  } // isset($id)  } // isset($id)
136    

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

  ViewVC Help
Powered by ViewVC 1.1.26