--- about.php 2001/02/20 11:36:01 1.1.1.1 +++ about.php 2001/10/01 14:05:16 1.4 @@ -6,64 +6,34 @@ $smarty->assign( array ( Title=>"Pliva d.d." ) ); -$section=str_replace(".php","",basename($PHP_SELF)); +include("section.inc"); $smarty->assign("section",$section); -$main_file=$section; - -if ($section == "index") { - $title="HOME"; - $lpic="obitelj"; $lext=".jpg"; - $tmp = time() % 3; - $mpic="welcome_".($tmp+1).".gif"; - $main_file="main"; -} elseif ($section == "about") { - $title="ABOUT US"; - $lpic="about"; $lext=".gif"; - $mpic="about.gif"; -} elseif ($section == "products") { - $title="PRODUCTS"; - $lpic="products"; $lext=".jpg"; - $mpic="products.gif"; -} elseif ($section == "investor") { - $title="INVESTOR'S PAGE"; - $lpic="investor"; $lext=".jpg"; - $mpic="investors.gif"; -} elseif ($section == "rnd") { - $title="R&D"; - $lpic="rnd"; $lext=".gif"; - $tmp = time() % 2; - $mpic="rnd_u".($tmp+1).".gif"; -} elseif ($section == "careers") { - $title="CAREERS"; - $lpic="careers"; $lext=".jpg"; - $mpic="careers.gif"; -} elseif ($section == "contact") { - $title="CONTACT US"; - $lpic="cont"; $lext=".jpg"; - $mpic="contactus.gif"; -} elseif ($section == "coreval") { - $title="CORE VALUES"; - $lpic="about"; $lext=".gif"; - $mpic="about.gif"; - $section="about"; -} elseif ($section == "vision") { - $title="VISION"; - $lpic="about"; $lext=".gif"; - $mpic="about.gif"; - $section="about"; +$main_file="./html/AboutUs-"; +if (file_exists($main_file.$part.".htm")) { + $main_file.=$part.".htm"; + $main=join('',file($main_file)); +} elseif (file_exists("./templates/AboutUs-".$part.".tpl")) { + +# $sth = $dbh->prepare("select iso,name from countries order by iso"); +# $sth->execute(); +# while ($row=$sth->fetchrow_hash()) { +# $countries[]=$row; +# } +# $smarty->assign("countries",$countries); + + $main=$smarty->fetch("AboutUs-".$part.".tpl"); +} else { + $main_file.="Main.htm"; + $main=join('',file($main_file)); + $title.=" : Welcome"; } + $smarty->assign( array ( lpic=>$lpic, lext=>$lext, mpic=>$mpic, Section_title=>$title ) ); include("common.inc"); - -$main=$smarty->fetch("$main_file.tpl"); $smarty->assign("MAIN",$main); -$smarty->assign("debug",$PHP_SELF." -- ".basename($PHP_SELF)." -- $section --". - $url[0]); - - $smarty->display("index.tpl"); ?>