Ejemplo n.º 1
0
}
$a_amex_l = ccb_odbc_utility_fetch_array($rs);
// Query nyse gainer
$sqlQuery = "SELECT TOP 20 symbol,name,last_trade,last_trade_time,change,change_percent,volume FROM stock_gainer_loser WHERE smarket='nyse' AND stype='gainer'";
$rs = odbc_exec($connection, $sqlQuery);
if (!$rs) {
    die(print_r(odbc_errormsg(), true));
}
$a_nyse_g = ccb_odbc_utility_fetch_array($rs);
// Query nyse loser
$sqlQuery = "SELECT TOP 20 symbol,name,last_trade,last_trade_time,change,change_percent,volume FROM stock_gainer_loser WHERE smarket='nyse' AND stype='loser'";
$rs = odbc_exec($connection, $sqlQuery);
if (!$rs) {
    die(print_r(odbc_errormsg(), true));
}
$a_nyse_l = ccb_odbc_utility_fetch_array($rs);
// Close DB connection
odbc_close($connection);
$yahooRef = "http://ca.finance.yahoo.com/q?s=";
function output_table_list($arrayList)
{
    foreach ($arrayList as $x => $x_value) {
        $parts = str_split($x_value["change"]);
        print "<tr>";
        print "<td><b><a href='" . $yahooRef . $x_value["symbol"] . " 'target='_blank'>" . $x_value["symbol"] . "</a></b></td>";
        print "<td>" . $x_value["name"] . "</td>";
        print "<td>" . $x_value["last_trade"] . "</td>";
        if ($parts[0] == '+') {
            print "<td>" . "<img src='images/up_g.gif'/>" . $x_value["change"] . "</td>";
        } else {
            if ($parts[0] == '-') {
Ejemplo n.º 2
0
$server = "localhost\\MSSQLSERVER2008";
$database = "CCBOnlineNews";
$user = "******";
$password = "******";
$connection = odbc_connect("Driver={SQL Server Native Client 10.0};Server={$server};Database={$database};", $user, $password);
if ($connection === false) {
    echo "Connection could not be established.<br/>";
    die(print_r(odbc_errormsg(), true));
}
// Query
$sqlQuery = "SELECT * FROM stock_summary WHERE stype='currency'";
$rs = odbc_exec($connection, $sqlQuery);
if (!$rs) {
    die(print_r(odbc_errormsg(), true));
}
$arrayResult = ccb_odbc_utility_fetch_array($rs);
// Close DB connection
odbc_close($connection);
$yahooRef = "http://finance.yahoo.com/q?s=";
?>

<h1><span class="mkTableTitleName">金融市场</span></h1>
<br/>
<table class="summary_reference" width="100%" id="main_table_europe" border="1" class="t1">
<tr>
   <th style="width:40px">Symbol</th>
   <th style="width:60px">Currency Pair</th>
   <th style="width:60px">Price</th>
   <th style="width:60px">Update Time</th>
</tr>
<?php 
}
$a_tsx_l = ccb_odbc_utility_fetch_array($rs);
// Query tsxv gainer
$sqlQuery = "SELECT TOP 20 symbol,name,last_trade,last_trade_time,change,change_percent,volume FROM stock_gainer_loser WHERE smarket='tsxv' AND stype='gainer'";
$rs = odbc_exec($connection, $sqlQuery);
if (!$rs) {
    die(print_r(odbc_errormsg(), true));
}
$a_tsxv_g = ccb_odbc_utility_fetch_array($rs);
// Query tsxv loser
$sqlQuery = "SELECT TOP 20 symbol,name,last_trade,last_trade_time,change,change_percent,volume FROM stock_gainer_loser WHERE smarket='tsxv' AND stype='loser'";
$rs = odbc_exec($connection, $sqlQuery);
if (!$rs) {
    die(print_r(odbc_errormsg(), true));
}
$a_tsxv_l = ccb_odbc_utility_fetch_array($rs);
// Close DB connection
odbc_close($connection);
$yahooRef = "http://ca.finance.yahoo.com/q?s=";
function output_table_list($arrayList)
{
    foreach ($arrayList as $x => $x_value) {
        $parts = str_split($x_value["change"]);
        print "<tr>";
        print "<td><b><a href='" . $yahooRef . $x_value["symbol"] . " 'target='_blank'>" . $x_value["symbol"] . "</a></b></td>";
        print "<td>" . $x_value["name"] . "</td>";
        print "<td>" . $x_value["last_trade"] . "</td>";
        if ($parts[0] == '+') {
            print "<td>" . "<img src='images/up_g.gif'/>" . $x_value["change"] . "</td>";
        } else {
            if ($parts[0] == '-') {
Ejemplo n.º 4
0
$server = "localhost\\MSSQLSERVER2008";
$database = "CCBOnlineNews";
$user = "******";
$password = "******";
$connection = odbc_connect("Driver={SQL Server Native Client 10.0};Server={$server};Database={$database};", $user, $password);
if ($connection === false) {
    echo "Connection could not be established.<br/>";
    die(print_r(odbc_errormsg(), true));
}
// Query
$sqlQuery = "SELECT * FROM stock_summary WHERE stype = 'wi-asia'";
$rs = odbc_exec($connection, $sqlQuery);
if (!$rs) {
    die(print_r(odbc_errormsg(), true));
}
$a_asia = ccb_odbc_utility_fetch_array($rs);
// Close DB connection
odbc_close($connection);
$yahooRef = "http://ca.finance.yahoo.com/q?s=";
?>

<h1><span class="mkTableTitleName">亚洲指数</span></h1>
<br/>
<table class="summary_reference" width="100%" id="main_table_europe" border="1" class="t1">
<tr>
   <th style="width:60px">Symbol</th>
   <th style="width:60px">Last Trade</th>
   <th style="width:40px">Change</th>
   <th style="width:60px">Update Time</th>
</tr>
<?php 
Ejemplo n.º 5
0
$server = "localhost\\MSSQLSERVER2008";
$database = "CCBOnlineNews";
$user = "******";
$password = "******";
$connection = odbc_connect("Driver={SQL Server Native Client 10.0};Server={$server};Database={$database};", $user, $password);
if ($connection === false) {
    echo "Connection could not be established.<br/>";
    die(print_r(odbc_errormsg(), true));
}
// Query
$sqlQuery = "SELECT * FROM stock_summary WHERE stype = 'wi-euro'";
$rs = odbc_exec($connection, $sqlQuery);
if (!$rs) {
    die(print_r(odbc_errormsg(), true));
}
$a_euro = ccb_odbc_utility_fetch_array($rs);
// Close DB connection
odbc_close($connection);
$yahooRef = "http://ca.finance.yahoo.com/q?s=";
?>

<h1><span class="mkTableTitleName">欧洲指数</span></h1>
<br/>
<table class="summary_reference" width="100%" id="main_table_europe" border="1" class="t1">
<tr>
   <th style="width:60px">Symbol</th>
   <th style="width:60px">Last Trade</th>
   <th style="width:40px">Change</th>
   <th style="width:60px">Update Time</th>
</tr>
<?php