1 |
dpavlin |
1.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 |
dpavlin |
1.2 |
$section="investor"; |
10 |
|
|
|
11 |
dpavlin |
1.1 |
$smarty->assign("section",$section); |
12 |
|
|
|
13 |
dpavlin |
1.2 |
$title="INVESTOR'S PAGE"; |
14 |
|
|
$lpic="investor"; $lext=".jpg"; |
15 |
|
|
$mpic="investors.gif"; |
16 |
dpavlin |
1.1 |
|
17 |
dpavlin |
1.3 |
if ($menu_item) $title.=" : $menu_item"; |
18 |
|
|
|
19 |
dpavlin |
1.1 |
$smarty->assign( array ( lpic=>$lpic, lext=>$lext, mpic=>$mpic, Section_title=>$title ) ); |
20 |
|
|
|
21 |
|
|
include("common.inc"); |
22 |
|
|
|
23 |
dpavlin |
1.3 |
if ($part == "analyst") { |
24 |
|
|
$sth = $dbh->prepare("select company,analyst,email from analysts order by company"); |
25 |
|
|
$sth->execute(); |
26 |
|
|
while ($row=$sth->fetchrow_hash()) { |
27 |
|
|
$analysts[]=$row; |
28 |
|
|
} |
29 |
|
|
|
30 |
|
|
$smarty->assign("analysts",$analysts); |
31 |
|
|
$main=$smarty->fetch("analysts.tpl"); |
32 |
|
|
} else { |
33 |
|
|
$dbh->dbh_do("set datestyle='german'"); |
34 |
|
|
|
35 |
dpavlin |
1.7 |
$sql="select date(date),time(date),stocks.type as type,current,change,high,low,open,ordinal from stocks,stocks_order where stocks_order.type=stocks.type order by stocks.date desc,ordinal asc limit 2"; |
36 |
dpavlin |
1.3 |
$sth = $dbh->prepare("$sql"); |
37 |
|
|
$sth->execute(); |
38 |
|
|
while ($row=$sth->fetchrow_hash()) { |
39 |
|
|
$stock[]=$row; |
40 |
dpavlin |
1.4 |
$time=$row[time]; |
41 |
|
|
$date=$row[date]; |
42 |
dpavlin |
1.3 |
} |
43 |
dpavlin |
1.2 |
|
44 |
dpavlin |
1.4 |
if ($time == "23:23:23") $time="CLOSE"; |
45 |
|
|
|
46 |
|
|
$smarty->assign(array(stock=>$stock, date=>$date, time=>$time)); |
47 |
dpavlin |
1.3 |
$main=$smarty->fetch("investor.tpl"); |
48 |
dpavlin |
1.2 |
} |
49 |
|
|
$smarty->assign("MAIN",$main); |
50 |
dpavlin |
1.1 |
|
51 |
|
|
$smarty->display("index.tpl"); |
52 |
|
|
?> |