/[pliva-si]/sections/vade.inc
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 /sections/vade.inc

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

revision 1.1 by dpavlin, Mon Nov 19 09:11:36 2001 UTC revision 1.4 by dpavlin, Tue Nov 20 11:26:14 2001 UTC
# Line 4  include_once("find_html_file.inc"); Line 4  include_once("find_html_file.inc");
4    
5  $title.=" : VADEMECUM";  $title.=" : VADEMECUM";
6    
7    function fix_title($t) {
8            $t=trim($t);
9            if ($sp=strpos($t," ")) {
10                    $out=strtoupper(substr($t,0,$sp)).substr($t,$sp,strlen($t)-$sp);
11            } else {
12                    $out=strtoupper($t);
13            }
14            return $out;
15    }
16    
17  if (isset($smpc) && $smpc >= 1000 && $smpc <= 9999 && find_html_file("vade",$smpc)) {  if (isset($smpc) && $smpc >= 1000 && $smpc <= 9999 && find_html_file("vade",$smpc)) {
18          $main=join('',file(find_html_file("vade",$smpc)));          include_once("read_file.inc");
19            $main = read_file(find_html_file("vade",$smpc));
20    
21          $sth = $dbh->prepare("select smpc,type,title from vademecum where smpc=$smpc");          $sth = $dbh->prepare("select smpc,type,title from vademecum where smpc=$smpc");
22          $sth->execute();          $sth->execute();
23          if ($row=$sth->fetchrow_hash()) {          if ($row=$sth->fetchrow_hash()) {
24                  switch ($row[type]) {                  switch ($row[type]) {
25                          case 'H' :                          case 'H' :
26                                  $title.=" : HUMAN ";                                  $title.=" : ZDRAVILA ";
27                                  break;                                  break;
28                          case 'V' :                          case 'V' :
29                                  $title .= " : VETERINA ";                                  $title .= " : VETERINA ";
30                                  break;                                  break;
31                  }                  }
32    
33                    $row[title]=fix_title($row[title]);
34                                    
35                  $title.=" : $row[title]";                  $title.=" : $row[title]";
36                  $smarty->assign("mtext",$row[title]);                  $smarty->assign("mtext",$row[title]);
37                    $smarty->assign("back_url",$PHP_SELF."?p=vade");
38          }          }
39  } else {  } else {
40    
41            $sql_where=array();
42    
43          if (isset($search) && $search!="" && $search!="all") {          if (isset($search) && $search!="" && $search!="all" && $search!="vsi") {
44                  $sql_where[]="upper(title) like upper('%$search%')";                  $sql_where[]="upper(title) like upper('%$search%')";
45          }          }
46    
# Line 40  if (isset($smpc) && $smpc >= 1000 && $sm Line 55  if (isset($smpc) && $smpc >= 1000 && $sm
55                          $sql.=" where ".join(" and ",$sql_where);                          $sql.=" where ".join(" and ",$sql_where);
56                  }                  }
57                  $sql.=" order by title asc";                  $sql.=" order by title asc";
58                  print "<pre>$sql</pre>";  #               print "<pre>$sql</pre>";
59                  $sth = $dbh->prepare($sql);                  $sth = $dbh->prepare($sql);
60                  $sth->execute();                  $sth->execute();
61                  while ($row=$sth->fetchrow_hash()) {                  while ($row=$sth->fetchrow_hash()) {
62                            $row[title]=fix_title($row[title]);
63                          $data[]=$row;                          $data[]=$row;
64                  }                  }
65    
# Line 55  if (isset($smpc) && $smpc >= 1000 && $sm Line 71  if (isset($smpc) && $smpc >= 1000 && $sm
71                  $smarty->assign("search",$search);                  $smarty->assign("search",$search);
72    
73          } else {          } else {
74                  $smarty->assign("search","all");                  $smarty->assign("search","vsi");
75          }          }
76    
77            $types = array ('', 'H', 'V');
78            $types_desc = array ('vsi', 'Zdravila', 'Veterina');
79    
80          $smarty->assign( array(          $smarty->assign( array(
81                          type=>"$type",                          type=>$type,
82                            types=>$types,
83                            types_desc=>$types_desc,
84                          self=>$PHP_SELF,                          self=>$PHP_SELF,
85                          title=>$title                          title=>$title
86                  ));                  ));

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

  ViewVC Help
Powered by ViewVC 1.1.26