10 |
|
|
11 |
$dbh->dbh_do("set datestyle='german'"); |
$dbh->dbh_do("set datestyle='german'"); |
12 |
|
|
13 |
$sth2 = $dbh->prepare("select type from stocks_order order by ordinal"); |
$sql="select date(date),time(date),stocks.type as type,current,change,high,low,open from stocks order by stocks.date desc limit 1"; |
14 |
$sth2->execute(); |
print "$sql"; |
15 |
while ($row2=$sth2->fetchrow_hash()) { |
$sth = $dbh->prepare("$sql"); |
16 |
|
$sth->execute(); |
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"; |
if ($row=$sth->fetchrow_hash()) { |
18 |
$sth = $dbh->prepare("$sql"); |
$row[type]=$row[type]; |
19 |
$sth->execute(); |
$row[current]=sprintf("%.2f ",$row[current]); |
20 |
if ($row=$sth->fetchrow_hash()) { |
$row[high]=sprintf("%.2f",$row[high]); |
21 |
$stock[]=$row; |
$row[low]=sprintf("%.2f",$row[low]); |
22 |
$time=$row[time]; |
$row[open]=sprintf("%.2f",$row[open]); |
23 |
$date=$row[date]; |
$row[change]=sprintf("%.2f",$row[change]); |
24 |
} |
$stock[]=$row; |
25 |
|
$time=$row[time]; |
26 |
|
$date=$row[date]; |
27 |
} |
} |
28 |
|
|
29 |
if ($time == "23:23:23" || $time == "21:21:21" || $time == "22:21:21" ) $time="CLOSE"; |
if ($time == "23:23:23" || $time == "21:21:21" || $time == "22:21:21" ) $time="CLOSE"; |