/[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.10 by dpavlin, Wed Jun 28 07:27:16 2000 UTC revision 1.16 by dpavlin, Fri Jan 25 14:47:46 2002 UTC
# Line 2  Line 2 
2    
3          include("inc/head.inc");          include("inc/head.inc");
4          include("inc/prava.inc");          include("inc/prava.inc");
5            include("inc/checkbox.inc");
6            include("inc/sap_org_jed.inc");
7    
8          if (! isset($from)) {          if (! isset($from)) {
9                  $from=0;                  $from=0;
10                    $podesavanje="on"; $umrezavanje="on";
11          }          }
12    
13          if (! isset($kontakt_osoba_id) || ! intval($kontakt_osoba_id)!=0) {          if (! isset($kontakt_osoba_id) || ! intval($kontakt_osoba_id)!=0) {
# Line 38  Line 41 
41                  echo ">$text</option>";                  echo ">$text</option>";
42          }          }
43    
         function checkbox($name,$current) {  
                 echo "<input type=\"checkbox\" name=\"$name\"";  
                 if (isset($current)) {  
                         echo " checked";  
                 }  
                 echo ">";  
         }  
44    
45          if (! isset($sql_upit)) { $sql_upit="novi_na_vrh"; }          if (! isset($sql_upit)) { $sql_upit="novi_na_vrh"; }
46    
# Line 81  Line 77 
77    
78          $on_page=50;          $on_page=50;
79    
         $conn = pg_connect("dbname=informatika user=dpavlin");  
   
80                  $sql_polja="osobe.id as id,osobe.ime as ime,                  $sql_polja="osobe.id as id,osobe.ime as ime,
81                          osobe.prezime as prezime,                          osobe.prezime as prezime,
                         org_jed.naziv||'<br><small>'||org_pod_jed.pod_naziv||'<small>' as orgjed,  
82                          kontakt_osobe.ime||' '||kontakt_osobe.prezime as kontakt_osoba,                          kontakt_osobe.ime||' '||kontakt_osobe.prezime as kontakt_osoba,
83                          e_mail,kontakt_osoba_id                          e_mail,kontakt_osoba_id,sifra
84                          ";                          ";
85                  $sql_tablice="osobe,org_jed,kontakt_osobe";                  $sql_tablice="osobe,kontakt_osobe";
86                  $sql_where="org_jed.id=org_jed_id                  $sql_where="
87                          and org_pod_jed.pod_id=org_pod_jed_id                          kontakt_osoba_id=kontakt_osobe.id
88                          and kontakt_osoba_id=kontakt_osobe.id                          and osobe.aktivna=true
89                          ";                          ";
90                  $sql_order="order by id";                  $sql_order="order by id";
91    
# Line 129  Line 122 
122          }          }
123    
124          if (isset($imepr) && $imepr != "") {          if (isset($imepr) && $imepr != "") {
125                  $sql_where.=" and ( upper(toczs(osobe.ime)) like upper(toczs('$imepr')) or upper(toczs(osobe.prezime)) like upper(toczs('$imepr')) )";                  $sql_where.=
126                      "and (upper(toczs(osobe.prezime)) like upper(toczs('$imepr'))
127                      or upper(toczs(osobe.ime)) 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
131                  from $sql_tablice
132                  where $sql_where
133                  $sql_order
134                  limit $on_page,$from";
135    
136  #       echo "<pre>$sql</pre>";  #       echo "<pre>$sql</pre>";
137  #       echo "<pre>$sql_where</pre>";  #       echo "<pre>$sql_where</pre>";
# Line 166  Line 165 
165                          print "$row[id]";                          print "$row[id]";
166                  }                  }
167                  print "</td><td>$row[ime] $row[prezime]</td>                  print "</td><td>$row[ime] $row[prezime]</td>
168                          <td>$row[orgjed]</td><td>";                          <td><small>".sap_org_jed($row[sifra])."</small></td><td>";
169                                                    
170                  $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");                  $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");
171                  for ($l = 0; $l < pg_numrows($result1); $l++) {                  for ($l = 0; $l < pg_numrows($result1); $l++) {

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

  ViewVC Help
Powered by ViewVC 1.1.26