--- investor.php 2001/02/20 11:35:07 1.1.1.1 +++ investor.php 2001/03/17 16:14:17 1.6 @@ -6,64 +6,47 @@ $smarty->assign( array ( Title=>"Pliva d.d." ) ); -$section=str_replace(".php","",basename($PHP_SELF)); +$section="investor"; + $smarty->assign("section",$section); -$main_file=$section; +$title="INVESTOR'S PAGE"; +$lpic="investor"; $lext=".jpg"; +$mpic="investors.gif"; -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"; -} +if ($menu_item) $title.=" : $menu_item"; $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); +if ($part == "analyst") { + $sth = $dbh->prepare("select company,analyst,email from analysts order by company"); + $sth->execute(); + while ($row=$sth->fetchrow_hash()) { + $analysts[]=$row; + } + + $smarty->assign("analysts",$analysts); + $main=$smarty->fetch("analysts.tpl"); +} else { + $dbh->dbh_do("set datestyle='german'"); + + $sql="select date(date),time(date),type,current,change,high,low,open from stocks order by stocks.date desc,stocks.insert_date asc limit 2"; + $sth = $dbh->prepare("$sql"); + $sth->execute(); + while ($row=$sth->fetchrow_hash()) { + $stock[]=$row; + $time=$row[time]; + $date=$row[date]; + } -$smarty->assign("debug",$PHP_SELF." -- ".basename($PHP_SELF)." -- $section --". - $url[0]); + if ($time == "23:23:23") $time="CLOSE"; + $smarty->assign(array(stock=>$stock, date=>$date, time=>$time)); + $main=$smarty->fetch("investor.tpl"); +} +$smarty->assign("MAIN",$main); $smarty->display("index.tpl"); ?>