--- fine_chemicals.php 2001/02/23 13:56:07 1.2 +++ fine_chemicals.php 2001/09/18 10:26:46 1.8 @@ -13,14 +13,15 @@ $section="products"; -$title="Products : Fine Chemicals"; +if ($menu_item) { + $title="Products : Fine Chemicals : $menu_item"; +} else { + $title="Products : Fine Chemicals"; +} $lpic="products"; $lext=".jpg"; $mpic="products.gif"; $back_url="products.php"; -$smarty->assign( array ( lpic=>$lpic, lext=>$lext, mpic=>$mpic, Section_title=>$title ) ); - - $sub_part=substr($part,0,strpos($part,"-")); if ($sub_part == "CustomManuf") { $multi_page=array( @@ -33,26 +34,46 @@ } $main_file="./fc/"; -if (file_exists($main_file.$part.".htm")) { +if ($part=="ContactUs") { + $sth = $dbh->prepare("select name,comment,addr1,addr2,email,tel,fax from fc_contact where is_office is not true order by num"); + $sth->execute(); + while ($row=$sth->fetchrow_hash()) { + $person[]=$row; + } + + $sth = $dbh->prepare("select office,name,comment,addr1,addr2,email,tel,fax from fc_contact where is_office is true order by num"); + $sth->execute(); + while ($row=$sth->fetchrow_hash()) { + $office[]=$row; + } + $smarty->assign( array( person=>$person, office=>$office ) ); + $main=$smarty->fetch("fc_ContactUs.tpl"); + + $title.=" : Contact Us"; + +} elseif (file_exists($main_file.$part.".htm")) { $main_file.=$part.".htm"; + $main=join('',file($main_file)); } else { $main_file.="Main.htm"; + $title="Products : Fine Chemicals"; + $main=join('',file($main_file)); } -$main=join('',file($main_file)); include("common.inc"); unset($menu); -$sth = $dbh->prepare("select item,url,file from menu where section='fine' order by num"); +$sth = $dbh->prepare("select item,url,file from menu where section='fine' and $visible_is_true order by num"); $sth->execute(); while ($row=$sth->fetchrow_hash()) { $menu[]=$row; } $smarty->assign("menu",$menu); -$smarty->assign( array(back_url=>$back_url, MAIN=>$main, - contact_url => 'fine_chemicals.php?part=ContactUs')); +$smarty->assign( array ( lpic=>$lpic, lext=>$lext, mpic=>$mpic, + Section_title=>$title, back_url=>$back_url, MAIN=>$main, + contact_url => 'fine_chemicals.php?part=ContactUs')); $smarty->display("index.tpl"); ?>