/[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.15 by dpavlin, Thu Jul 27 08:35:35 2000 UTC revision 1.15.2.1 by dpavlin, Mon Jul 31 18:30:49 2000 UTC
# Line 6  include("inc/print_bool2.inc"); Line 6  include("inc/print_bool2.inc");
6  include("inc/bgcolor.inc");  include("inc/bgcolor.inc");
7    
8  if (isset($kontakt_osoba_id) && $what!="relogin") {  if (isset($kontakt_osoba_id) && $what!="relogin") {
9          $result = pg_Exec ($conn, "select ime,prezime,passwd,prava from kontakt_osobe where aktivna=true and id=$kontakt_osoba_id");          $sth = $dbh->prepare("select ime,prezime,passwd,prava from kontakt_osobe where aktivna=true and id=$kontakt_osoba_id");
10          $korow=pg_fetch_array($result,0);          $sth->execute();
11            $korow=$sth->fetchrow_hash();
12  #       print "--$korow[passwd] | $md5_passwd | $passwd ";  #       print "--$korow[passwd] | $md5_passwd | $passwd ";
13          $prava=$korow[prava];          $prava=$korow[prava];
14          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>";
# Line 35  if (! isset($kontakt_osoba_id)) { Line 36  if (! isset($kontakt_osoba_id)) {
36          include("inc/obavjest-forma.inc");          include("inc/obavjest-forma.inc");
37  } elseif (isset($id) && $what!="auth") {  } elseif (isset($id) && $what!="auth") {
38    
39    $sth = $dbh->prepare("
 $result = pg_Exec ($conn, "  
40          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,
41                  org_jed.naziv as orgjed,org_pod_jed.pod_naziv as orgpodjed,                  org_jed.naziv as orgjed,org_pod_jed.pod_naziv as orgpodjed,
42                  lok_racunala as lokrac,objekt,kat,soba,z_rac,podesavanje,                  lok_racunala as lokrac,objekt,kat,soba,z_rac,podesavanje,
# Line 48  $result = pg_Exec ($conn, " Line 48  $result = pg_Exec ($conn, "
48          order by lokacije.naziv,org_jed.naziv          order by lokacije.naziv,org_jed.naziv
49          ");          ");
50    
51  if (pg_numrows($result) > 0) {  $sth->execute();
52          $row=pg_fetch_array($result,0);  
53    if ($row=$sth->fetchrow_hash()) {
54    
55          print "          print "
56  <h1>Podaci o osobi</h1>  <h1>Podaci o osobi</h1>
# Line 85  if ($prava & $pr_promjena) { Line 86  if ($prava & $pr_promjena) {
86    
87  $instaliran=0;  $instaliran=0;
88    
89  $result = pg_Exec ($conn, "select status.id as status_id,datum,opis,ime,prezime,status_tip_id as st  $sth = $dbh->prepare("select status.id as status_id,datum,opis,ime,prezime,status_tip_id as st
90          from status,kontakt_osobe,status_tip          from status,kontakt_osobe,status_tip
91          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
92          and osoba_id=$id order by datum");          and osoba_id=$id order by datum");
93    $sth->execute();
94    
95  $statusi="";  $statusi="";
96    
97  $nr = pg_numrows($result);  $nr=0;
98  if ($nr > 0) {  while($row=$sth->fetchrow_hash()) {
99          for ($i=0; $i<$nr; $i++) {          if ($row[st] != 2) {
100                  $row=pg_fetch_array($result,$i);                  $statusi.="<tr ".bgcolor()."><td><small>$row[datum]</small></td><td>$row[opis]</td><td>$row[ime] $row[prezime]</td></tr>";
101                  if ($row[st] != 2) {          } else {
102                          $statusi.="<tr ".bgcolor()."><td><small>$row[datum]</small></td><td>$row[opis]</td><td>$row[ime] $row[prezime]</td></tr>";                  $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>";
                 } else {  
                         $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>";  
                 }  
                 if ($row[st] == 6) { $instaliran = 1; };  
103          }          }
104  } else {          if ($row[st] == 6) { $instaliran = 1; };
105            $nr++;
106    }
107    
108    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  $result = pg_Exec ($conn, "select racuni.login as login,  $sth = $dbh->prepare("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");
116    $sth->execute();
117    
118  if (pg_numrows($result) > 0) {  if ($row=$sth->fetchrow_hash()) {
         $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>
# Line 165  if ($prava == $pr_admin) { Line 167  if ($prava == $pr_admin) {
167    
168  $statusi.="<td><select name=status_tip_id>";  $statusi.="<td><select name=status_tip_id>";
169    
170          $result = pg_Exec ($conn, "select id,opis          $sth = $dbh->prepare("select id,opis
171                  from status_tip                  from status_tip
172                  where id >= 5                  where id >= 5
173                  ");                  ");
174            $sth->execute();
175    
176          $num_prava=0;          $num_prava=0;
177    
178          for ($i=0; $i<pg_numrows($result); $i++) {          while ($row=$sth->fetchrow_hash()) {
                 $row=pg_fetch_array($result,$i);  
179                  if ($prava & pow(2,$row[id])) {                  if ($prava & pow(2,$row[id])) {
180                          $statusi.="<option value=$row[id]>$row[opis]</option>\n";                          $statusi.="<option value=$row[id]>$row[opis]</option>\n";
181                          $num_prava++;                          $num_prava++;
# Line 196  print " Line 198  print "
198  <hr>  <hr>
199  ";  ";
200    
201  } else { // pg_numrows($result) > 0  } else { // nema rezultata
202          print "<p><big>Nema podataka o osobi sa id-jem $id</big>";          print "<p><big>Nema podataka o osobi sa id-jem $id</big>";
203  }       // pg_numrows($result) > 0  }
204    
205  include("inc/obavjest-forma.inc");  include("inc/obavjest-forma.inc");
206    

Legend:
Removed from v.1.15  
changed lines
  Added in v.1.15.2.1

  ViewVC Help
Powered by ViewVC 1.1.26