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

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

  ViewVC Help
Powered by ViewVC 1.1.26