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

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

revision 1.4 by dpavlin, Fri Apr 14 08:23:26 2000 UTC revision 1.10 by dpavlin, Wed Jun 28 07:27:16 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($from)) {          if (! isset($from)) {
7                  $from=0;                  $from=0;
# Line 23  Line 24 
24                          <input type=submit value="Posebno označi moje zahtjeve">                          <input type=submit value="Posebno označi moje zahtjeve">
25                          </form>';                          </form>';
26          } else {          } else {
27                  $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,prava from kontakt_osobe where aktivna=true and id=$kontakt_osoba_id");
28                  $row=pg_fetch_array($result,0);                  $row=pg_fetch_array($result,0);
29                  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>";
30                    $prava=$row[prava];
31          }          }
32    
33          function option($value,$text,$current) {          function option($value,$text,$current) {
# Line 47  Line 49 
49          if (! isset($sql_upit)) { $sql_upit="novi_na_vrh"; }          if (! isset($sql_upit)) { $sql_upit="novi_na_vrh"; }
50    
51          echo '  <form method="post" action="'.$PHP_SELF.'?'.$QUERY_STRING.'" name="forma2">          echo '  <form method="post" action="'.$PHP_SELF.'?'.$QUERY_STRING.'" name="forma2">
52                  <input type=submit value="Prikaži">                  Upišite ime ili prezime po kojem želite pretraživati:
53                            <input type=text name=imepr size=40 value="'.$imepr.'">
54                    <br><input type=submit value="Prikaži">
55                  slogove                  slogove
56                  <select name="sql_upit">                  <select name="sql_upit">
57                  ';                  ';
# Line 57  Line 61 
61                  option("novi_na_vrh","noviji na početak popisa",$sql_upit);                  option("novi_na_vrh","noviji na početak popisa",$sql_upit);
62                  option("order_ime","sortirano po imenu",$sql_upit);                  option("order_ime","sortirano po imenu",$sql_upit);
63                  option("order_prezime","sortirano po prezimenu",$sql_upit);                  option("order_prezime","sortirano po prezimenu",$sql_upit);
64                    option("umrezavanje","potrebno umrežavanje",$sql_upit);
65    
66          echo '  </select>          echo '  </select>
67                  <small><i>za opcije označenje zvjezdicom (*) prvo morate                  <small><i>za opcije označenje zvjezdicom (*) prvo morate
# Line 91  Line 96 
96                          ";                          ";
97                  $sql_order="order by id";                  $sql_order="order by id";
98    
   
99          if (isset($sql_upit)) {          if (isset($sql_upit)) {
100                  switch($sql_upit) {                  switch($sql_upit) {
101                          case "samo_moji":                          case "samo_moji":
# Line 108  Line 112 
112                          case "novi_na_vrh":                          case "novi_na_vrh":
113                                  $sql_order="order by id desc";                                  $sql_order="order by id desc";
114                                  break;                                  break;
115                            case "umrezavanje":
116                                    $sql_where.=" and umrezavanje is true";
117                                    break;
118                  }                  }
119          }          }
120    
# Line 121  Line 128 
128                  $sql_polja.=",umrezavanje";                  $sql_polja.=",umrezavanje";
129          }          }
130    
131            if (isset($imepr) && $imepr != "") {
132                    $sql_where.=" and ( upper(toczs(osobe.ime)) like upper(toczs('$imepr')) or upper(toczs(osobe.prezime)) like upper(toczs('$imepr')) )";
133            }
134    
135          $sql="select $sql_polja from $sql_tablice where $sql_where $sql_order limit $on_page,$from";          $sql="select $sql_polja from $sql_tablice where $sql_where $sql_order limit $on_page,$from";
136    
137  #       echo "<pre>$sql</pre>";  #       echo "<pre>$sql</pre>";
138    #       echo "<pre>$sql_where</pre>";
139          $result = pg_Exec ($conn, "$sql");          $result = pg_Exec ($conn, "$sql");
140    
141          echo "<table border=1>          echo "<table border=1>
# Line 133  Line 145 
145                  <th>organizacijska jedinica</th>                  <th>organizacijska jedinica</th>
146                  <th>status zahtjeva</th>                  <th>status zahtjeva</th>
147                  <th>kontakt osoba</th>                  <th>kontakt osoba</th>
148                    <td><small>",pg_numrows($result),"</small></td>
149                  </tr>                  </tr>
150                  ";                  ";
151    
152          function print_bool($val) {          include("inc/print_bool2.inc");
153                  if ($val == 't') {  
                         print "da";  
                 } elseif ($val == 'f') {  
                         print "ne";  
                 } else {  
                         print "nepoznato";  
                 }  
         }  
154    
155          for ($k = 0; $k < pg_numrows($result); $k++) {          for ($k = 0; $k < pg_numrows($result); $k++) {
156                  $row=pg_fetch_array($result,$k);                  $row=pg_fetch_array($result,$k);
# Line 154  Line 160 
160                          print '<tr bgcolor="#f0f0f0">';                          print '<tr bgcolor="#f0f0f0">';
161                  }                  }
162                  print "<td>";                  print "<td>";
163                  if ($row[kontakt_osoba_id]==$kontakt_osoba_id) {                  if ($row[kontakt_osoba_id]==$kontakt_osoba_id || isset($prava) && $prava==$pr_admin) {
164                          print "<a href=\"osoba.php?what=select-osoba&id=$row[id]\">$row[id]</a>";                          print "<a href=\"osoba.php?what=select-osoba&id=$row[id]\">$row[id]</a>";
165                  } else {                  } else {
166                          print "$row[id]";                          print "$row[id]";
# Line 162  Line 168 
168                  print "</td><td>$row[ime] $row[prezime]</td>                  print "</td><td>$row[ime] $row[prezime]</td>
169                          <td>$row[orgjed]</td><td>";                          <td>$row[orgjed]</td><td>";
170                                                    
171                  $result1 = pg_Exec ($conn, "select datum,opis from status,status_tip where status.status_tip_id=status_tip.id and osoba_id=$row[id]");                  $result1 = pg_Exec ($conn, "select datum,opis from status,status_tip where status.status_tip_id=status_tip.id and osoba_id=$row[id] order by datum");
172                  for ($l = 0; $l < pg_numrows($result1); $l++) {                  for ($l = 0; $l < pg_numrows($result1); $l++) {
173                          $row1=pg_fetch_array($result1,$l);                          $row1=pg_fetch_array($result1,$l);
174                          print "<small>$row1[datum]</small> $row1[opis]<br>";                          print "<small>$row1[datum]</small> $row1[opis]<br>";
# Line 171  Line 177 
177    
178    
179                  if (isset($shell)) {                  if (isset($shell)) {
180                          print "<br>shell: ";                          print "<br>shell: ".print_bool($row[shell]);
                         print_bool($row[shell]);  
181                  }                  }
182                  if (isset($podesavanje)) {                  if (isset($podesavanje)) {
183                          print "<br>podešavanje: ";                          print "<br>podešavanje: ".print_bool($row[podesavanje]);
                         print_bool($row[podesavanje]);  
184                  }                  }
185                  if (isset($umrezavanje)) {                  if (isset($umrezavanje)) {
186                          print "<br>umrežavanje: ";                          print "<br>umrežavanje: ".print_bool($row[umrezavanje]);
                         print_bool($row[umrezavanje]);  
187                  }                  }
188                  print "</small></td></tr>";                  print "</small>";
189                    print "</td><td>
190                            <a href=\"obavijest.php?id=$row[id]\">
191                            <img src=pix/text.gif border=0
192                            alt=\"Prikaži sve podatke o ovom zahtjevu\"></a>
193                            ";
194                    print "</td></tr>";
195          }          }
196    
197    

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

  ViewVC Help
Powered by ViewVC 1.1.26