1 |
<?php |
2 |
require("Smarty.class.php"); |
3 |
require("conn.inc"); |
4 |
|
5 |
$smarty = new Smarty; |
6 |
|
7 |
$smarty->assign( array ( Title=>"Pliva d.d." ) ); |
8 |
|
9 |
|
10 |
if (isset($from)) { |
11 |
$section=$from; |
12 |
} else { |
13 |
$section="new"; |
14 |
} |
15 |
|
16 |
if ($section == "investor") { |
17 |
$title="INVESTOR'S PAGE"; |
18 |
$lpic="investor"; $lext=".jpg"; |
19 |
$mpic="investors.gif"; |
20 |
$back_url="investor.php"; |
21 |
} else { |
22 |
$title="What's New"; |
23 |
$lpic="new"; $lext=".jpg"; |
24 |
$mpic="new.gif"; |
25 |
$back_url="index.php"; |
26 |
} |
27 |
|
28 |
$smarty->assign( array ( lpic=>$lpic, lext=>$lext, mpic=>$mpic, Section_title=>$title ) ); |
29 |
|
30 |
$sql_where=""; |
31 |
|
32 |
if (isset($id)) { |
33 |
$sql_where.=" where id=$id "; |
34 |
} |
35 |
|
36 |
if (! isset($more) || !file_exists("./news/$more")) { |
37 |
|
38 |
$sth = $dbh->prepare("select id,title,date,body,more,pdf from news $sql_where order by id desc"); |
39 |
$sth->execute(); |
40 |
while ($row=$sth->fetchrow_hash()) { |
41 |
$data[]=$row; |
42 |
} |
43 |
|
44 |
$smarty->assign("data",$data); |
45 |
|
46 |
$main=$smarty->fetch("new.tpl"); |
47 |
|
48 |
if (isset($id) && $data[0][more]) { |
49 |
$main=join('',file("./news/".$data[0][more])); |
50 |
|
51 |
} |
52 |
|
53 |
} else { // display details |
54 |
$main=join('',file("./news/$more")); |
55 |
$back_url=$GLOBALS[HTTP_REFERER]; |
56 |
} |
57 |
|
58 |
include("common.inc"); |
59 |
$smarty->assign( array(back_url=>$back_url, MAIN=>$main)); |
60 |
|
61 |
$smarty->display("index.tpl"); |
62 |
?> |