/[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.11 by dpavlin, Thu Jun 29 09:26:56 2000 UTC
# Line 1  Line 1 
1  <?  <?
2    
3          include("inc/head.inc");          include("inc/head.inc");
4            include("inc/prava.inc");
5            include("inc/checkbox.inc");
6    
7          if (! isset($from)) {          if (! isset($from)) {
8                  $from=0;                  $from=0;
# Line 23  Line 25 
25                          <input type=submit value="Posebno označi moje zahtjeve">                          <input type=submit value="Posebno označi moje zahtjeve">
26                          </form>';                          </form>';
27          } else {          } else {
28                  $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");
29                  $row=pg_fetch_array($result,0);                  $row=pg_fetch_array($result,0);
30                  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>";
31                    $prava=$row[prava];
32          }          }
33    
34          function option($value,$text,$current) {          function option($value,$text,$current) {
# Line 36  Line 39 
39                  echo ">$text</option>";                  echo ">$text</option>";
40          }          }
41    
         function checkbox($name,$current) {  
                 echo "<input type=\"checkbox\" name=\"$name\"";  
                 if (isset($current)) {  
                         echo " checked";  
                 }  
                 echo ">";  
         }  
42    
43          if (! isset($sql_upit)) { $sql_upit="novi_na_vrh"; }          if (! isset($sql_upit)) { $sql_upit="novi_na_vrh"; }
44    
45          echo '  <form method="post" action="'.$PHP_SELF.'?'.$QUERY_STRING.'" name="forma2">          echo '  <form method="post" action="'.$PHP_SELF.'?'.$QUERY_STRING.'" name="forma2">
46                  <input type=submit value="Prikaži">                  Upišite ime ili prezime po kojem želite pretraživati:
47                            <input type=text name=imepr size=40 value="'.$imepr.'">
48                    <br><input type=submit value="Prikaži">
49                  slogove                  slogove
50                  <select name="sql_upit">                  <select name="sql_upit">
51                  ';                  ';
# Line 57  Line 55 
55                  option("novi_na_vrh","noviji na početak popisa",$sql_upit);                  option("novi_na_vrh","noviji na početak popisa",$sql_upit);
56                  option("order_ime","sortirano po imenu",$sql_upit);                  option("order_ime","sortirano po imenu",$sql_upit);
57                  option("order_prezime","sortirano po prezimenu",$sql_upit);                  option("order_prezime","sortirano po prezimenu",$sql_upit);
58                    option("umrezavanje","potrebno umrežavanje",$sql_upit);
59    
60          echo '  </select>          echo '  </select>
61                  <small><i>za opcije označenje zvjezdicom (*) prvo morate                  <small><i>za opcije označenje zvjezdicom (*) prvo morate
# Line 91  Line 90 
90                          ";                          ";
91                  $sql_order="order by id";                  $sql_order="order by id";
92    
   
93          if (isset($sql_upit)) {          if (isset($sql_upit)) {
94                  switch($sql_upit) {                  switch($sql_upit) {
95                          case "samo_moji":                          case "samo_moji":
# Line 108  Line 106 
106                          case "novi_na_vrh":                          case "novi_na_vrh":
107                                  $sql_order="order by id desc";                                  $sql_order="order by id desc";
108                                  break;                                  break;
109                            case "umrezavanje":
110                                    $sql_where.=" and umrezavanje is true";
111                                    break;
112                  }                  }
113          }          }
114    
# Line 121  Line 122 
122                  $sql_polja.=",umrezavanje";                  $sql_polja.=",umrezavanje";
123          }          }
124    
125            if (isset($imepr) && $imepr != "") {
126                    $sql_where.=" and ( upper(toczs(osobe.ime)) like upper(toczs('$imepr')) or upper(toczs(osobe.prezime)) like upper(toczs('$imepr')) )";
127            }
128    
129          $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";
130    
131  #       echo "<pre>$sql</pre>";  #       echo "<pre>$sql</pre>";
132    #       echo "<pre>$sql_where</pre>";
133          $result = pg_Exec ($conn, "$sql");          $result = pg_Exec ($conn, "$sql");
134    
135          echo "<table border=1>          echo "<table border=1>
# Line 133  Line 139 
139                  <th>organizacijska jedinica</th>                  <th>organizacijska jedinica</th>
140                  <th>status zahtjeva</th>                  <th>status zahtjeva</th>
141                  <th>kontakt osoba</th>                  <th>kontakt osoba</th>
142                    <td><small>",pg_numrows($result),"</small></td>
143                  </tr>                  </tr>
144                  ";                  ";
145    
146          function print_bool($val) {          include("inc/print_bool2.inc");
147                  if ($val == 't') {  
                         print "da";  
                 } elseif ($val == 'f') {  
                         print "ne";  
                 } else {  
                         print "nepoznato";  
                 }  
         }  
148    
149          for ($k = 0; $k < pg_numrows($result); $k++) {          for ($k = 0; $k < pg_numrows($result); $k++) {
150                  $row=pg_fetch_array($result,$k);                  $row=pg_fetch_array($result,$k);
# Line 154  Line 154 
154                          print '<tr bgcolor="#f0f0f0">';                          print '<tr bgcolor="#f0f0f0">';
155                  }                  }
156                  print "<td>";                  print "<td>";
157                  if ($row[kontakt_osoba_id]==$kontakt_osoba_id) {                  if ($row[kontakt_osoba_id]==$kontakt_osoba_id || isset($prava) && $prava==$pr_admin) {
158                          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>";
159                  } else {                  } else {
160                          print "$row[id]";                          print "$row[id]";
# Line 162  Line 162 
162                  print "</td><td>$row[ime] $row[prezime]</td>                  print "</td><td>$row[ime] $row[prezime]</td>
163                          <td>$row[orgjed]</td><td>";                          <td>$row[orgjed]</td><td>";
164                                                    
165                  $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");
166                  for ($l = 0; $l < pg_numrows($result1); $l++) {                  for ($l = 0; $l < pg_numrows($result1); $l++) {
167                          $row1=pg_fetch_array($result1,$l);                          $row1=pg_fetch_array($result1,$l);
168                          print "<small>$row1[datum]</small> $row1[opis]<br>";                          print "<small>$row1[datum]</small> $row1[opis]<br>";
# Line 171  Line 171 
171    
172    
173                  if (isset($shell)) {                  if (isset($shell)) {
174                          print "<br>shell: ";                          print "<br>shell: ".print_bool($row[shell]);
                         print_bool($row[shell]);  
175                  }                  }
176                  if (isset($podesavanje)) {                  if (isset($podesavanje)) {
177                          print "<br>podešavanje: ";                          print "<br>podešavanje: ".print_bool($row[podesavanje]);
                         print_bool($row[podesavanje]);  
178                  }                  }
179                  if (isset($umrezavanje)) {                  if (isset($umrezavanje)) {
180                          print "<br>umrežavanje: ";                          print "<br>umrežavanje: ".print_bool($row[umrezavanje]);
                         print_bool($row[umrezavanje]);  
181                  }                  }
182                  print "</small></td></tr>";                  print "</small>";
183                    print "</td><td>
184                            <a href=\"obavijest.php?id=$row[id]\">
185                            <img src=pix/text.gif border=0
186                            alt=\"Prikaži sve podatke o ovom zahtjevu\"></a>
187                            ";
188                    print "</td></tr>";
189          }          }
190    
191    

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

  ViewVC Help
Powered by ViewVC 1.1.26