1 |
dpavlin |
1.1 |
<? |
2 |
|
|
|
3 |
|
|
/* returns: |
4 |
|
|
$stocks hash array with date,time,type,current,change,high,low,open |
5 |
|
|
$time string time (or CLOSE) |
6 |
|
|
$date string date |
7 |
|
|
trash: |
8 |
|
|
$row, $sth, $row2, $sth2, datesytle (german) |
9 |
|
|
*/ |
10 |
|
|
|
11 |
|
|
$dbh->dbh_do("set datestyle='german'"); |
12 |
|
|
|
13 |
|
|
$sth2 = $dbh->prepare("select type from stocks_order order by ordinal"); |
14 |
|
|
$sth2->execute(); |
15 |
|
|
while ($row2=$sth2->fetchrow_hash()) { |
16 |
|
|
|
17 |
|
|
$sql="select date(date),time(date),stocks.type as type,current,change,high,low,open from stocks where stocks.type='$row2[type]' order by stocks.date desc limit 1"; |
18 |
|
|
$sth = $dbh->prepare("$sql"); |
19 |
|
|
$sth->execute(); |
20 |
|
|
if ($row=$sth->fetchrow_hash()) { |
21 |
|
|
$stock[]=$row; |
22 |
|
|
$time=$row[time]; |
23 |
|
|
$date=$row[date]; |
24 |
|
|
} |
25 |
|
|
} |
26 |
|
|
|
27 |
|
|
if ($time == "23:23:23") $time="CLOSE"; |
28 |
|
|
|
29 |
|
|
?> |