/[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.2 by dpavlin, Mon Nov 19 11:20:40 2001 UTC
# Line 5  include_once("find_html_file.inc"); Line 5  include_once("find_html_file.inc");
5  $title.=" : VADEMECUM";  $title.=" : VADEMECUM";
6    
7  if (isset($smpc) && $smpc >= 1000 && $smpc <= 9999 && find_html_file("vade",$smpc)) {  if (isset($smpc) && $smpc >= 1000 && $smpc <= 9999 && find_html_file("vade",$smpc)) {
8          $main=join('',file(find_html_file("vade",$smpc)));          include_once("read_file.inc");
9            $main = read_file(find_html_file("vade",$smpc));
10    
11          $sth = $dbh->prepare("select smpc,type,title from vademecum where smpc=$smpc");          $sth = $dbh->prepare("select smpc,type,title from vademecum where smpc=$smpc");
12          $sth->execute();          $sth->execute();
13          if ($row=$sth->fetchrow_hash()) {          if ($row=$sth->fetchrow_hash()) {
14                  switch ($row[type]) {                  switch ($row[type]) {
15                          case 'H' :                          case 'H' :
16                                  $title.=" : HUMAN ";                                  $title.=" : ZDRAVILA ";
17                                  break;                                  break;
18                          case 'V' :                          case 'V' :
19                                  $title .= " : VETERINA ";                                  $title .= " : VETERINA ";
# Line 25  if (isset($smpc) && $smpc >= 1000 && $sm Line 26  if (isset($smpc) && $smpc >= 1000 && $sm
26  } else {  } else {
27    
28    
29          if (isset($search) && $search!="" && $search!="all") {          if (isset($search) && $search!="" && $search!="all" && $search!="vsi") {
30                  $sql_where[]="upper(title) like upper('%$search%')";                  $sql_where[]="upper(title) like upper('%$search%')";
31          }          }
32    
# Line 40  if (isset($smpc) && $smpc >= 1000 && $sm Line 41  if (isset($smpc) && $smpc >= 1000 && $sm
41                          $sql.=" where ".join(" and ",$sql_where);                          $sql.=" where ".join(" and ",$sql_where);
42                  }                  }
43                  $sql.=" order by title asc";                  $sql.=" order by title asc";
44                  print "<pre>$sql</pre>";  #               print "<pre>$sql</pre>";
45                  $sth = $dbh->prepare($sql);                  $sth = $dbh->prepare($sql);
46                  $sth->execute();                  $sth->execute();
47                  while ($row=$sth->fetchrow_hash()) {                  while ($row=$sth->fetchrow_hash()) {
# Line 55  if (isset($smpc) && $smpc >= 1000 && $sm Line 56  if (isset($smpc) && $smpc >= 1000 && $sm
56                  $smarty->assign("search",$search);                  $smarty->assign("search",$search);
57    
58          } else {          } else {
59                  $smarty->assign("search","all");                  $smarty->assign("search","vsi");
60          }          }
61    
62            $types = array ('', 'H', 'V');
63            $types_desc = array ('vsi', 'Zdravila', 'Veterina');
64    
65          $smarty->assign( array(          $smarty->assign( array(
66                          type=>"$type",                          type=>$type,
67                            types=>$types,
68                            types_desc=>$types_desc,
69                          self=>$PHP_SELF,                          self=>$PHP_SELF,
70                          title=>$title                          title=>$title
71                  ));                  ));

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

  ViewVC Help
Powered by ViewVC 1.1.26