--- results.php 2001/03/03 12:56:33 1.4 +++ results.php 2001/10/12 07:39:37 1.11 @@ -1,38 +1,48 @@ assign( array ( Title=>"Pliva d.d." ) ); -$section="investor"; +if (isset($from)) { + $section=$from; +} else { + $section="investor"; +} -$title="INVESTOR'S PAGE"; -if ($menu_item) $title.=" : $menu_item"; -$lpic="investor"; $lext=".jpg"; -$mpic="investors.gif"; +require("conn.inc"); +include("section.inc"); + +if (! $type) $type="r"; + +$sql="select id,town_date,title,body,pdf from news where type='$type' and $visible_is_true order by priority desc,date desc"; +# print "$sql"; +$sth = $dbh->prepare("$sql"); +$sth->execute(); +while ($row=$sth->fetchrow_hash()) { + $results[]=$row; +} -if ($part && file_exists("templates/$part.tpl")) { - $main_file=$part; +if ($type == "p") { + $main_file="presentations"; +} elseif ($type == "o") { + $main_file="comp_profile"; } else { $main_file="results"; } -$smarty->assign( array ( lpic=>$lpic, lext=>$lext, mpic=>$mpic, Section_title=>$title ) ); - - $sql="select id,title,pdf from news where type='r' and visible order by priority desc,date desc"; -# print "$sql"; - $sth = $dbh->prepare("$sql"); - $sth->execute(); - while ($row=$sth->fetchrow_hash()) { - $results[]=$row; - } - $smarty->assign("results",$results); +$smarty->assign(array( + results=>$results, + type=>$type + )); $main=$smarty->fetch("$main_file.tpl"); include("common.inc"); + +$smarty->assign( array ( lpic=>$lpic, lext=>$lext, mpic=>$mpic, Section_title=>$title ) ); + $smarty->assign( array(back_url=>"$section.php", MAIN=>$main)); $smarty->display("index.tpl");