--- sections/vade.inc 2001/11/19 11:24:57 1.3 +++ sections/vade.inc 2001/11/20 11:26:14 1.4 @@ -4,6 +4,16 @@ $title.=" : VADEMECUM"; +function fix_title($t) { + $t=trim($t); + if ($sp=strpos($t," ")) { + $out=strtoupper(substr($t,0,$sp)).substr($t,$sp,strlen($t)-$sp); + } else { + $out=strtoupper($t); + } + return $out; +} + if (isset($smpc) && $smpc >= 1000 && $smpc <= 9999 && find_html_file("vade",$smpc)) { include_once("read_file.inc"); $main = read_file(find_html_file("vade",$smpc)); @@ -19,6 +29,8 @@ $title .= " : VETERINA "; break; } + + $row[title]=fix_title($row[title]); $title.=" : $row[title]"; $smarty->assign("mtext",$row[title]); @@ -26,6 +38,7 @@ } } else { + $sql_where=array(); if (isset($search) && $search!="" && $search!="all" && $search!="vsi") { $sql_where[]="upper(title) like upper('%$search%')"; @@ -46,6 +59,7 @@ $sth = $dbh->prepare($sql); $sth->execute(); while ($row=$sth->fetchrow_hash()) { + $row[title]=fix_title($row[title]); $data[]=$row; }