/[corp_html]/inc/stocks.inc
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /inc/stocks.inc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (hide annotations)
Tue Feb 5 10:03:51 2002 UTC (22 years, 2 months ago) by dpavlin
Branch: MAIN
Changes since 1.3: +13 -12 lines
dionice sa dva decimalna mjesta

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 dpavlin 1.4 $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     $sth = $dbh->prepare("$sql");
15     $sth->execute();
16     if ($row=$sth->fetchrow_hash()) {
17     $row[type]=$row[type];
18     $row[current]=sprintf("%.2f ",$row[current]);
19     $row[high]=sprintf("%.2f",$row[high]);
20     $row[low]=sprintf("%.2f",$row[low]);
21     $row[open]=sprintf("%.2f",$row[open]);
22     $row[change]=sprintf("%.2f",$row[change]);
23     $stock[]=$row;
24     $time=$row[time];
25     $date=$row[date];
26 dpavlin 1.1 }
27    
28 dpavlin 1.3 if ($time == "23:23:23" || $time == "21:21:21" || $time == "22:21:21" ) $time="CLOSE";
29 dpavlin 1.1
30     ?>

  ViewVC Help
Powered by ViewVC 1.1.26