PHP Code:
<?php
# PHPlot Example: Bar chart, 3 data sets, shaded
require_once 'phplot.php';
$data = array(
array('Jan', 40), array('Feb', 30), array('Mar', 20),
array('Apr', 10), array('May', 3), array('Jun', 7),
array('Jul', 10), array('Aug', 15), array('Sep', 20),
array('Oct', 18), array('Nov', 16), array('Dec', 14),
);
$plot = new PHPlot(600, 300);
$plot->SetImageBorderType('plain');
$plot->SetPlotType('bars');
$plot->SetDataType('text-data');
$plot->SetDataValues($data);
# Main plot title:
$plot->SetTitle('Track record');
# Make a legend for the 3 data sets plotted:
//$plot->SetLegend(array('Engineering', 'Manufacturing', 'Administration'));
# Turn off X tick labels and ticks because they don't apply here:
$plot->SetXTickLabelPos('none');
$plot->SetXTickPos('none');
$plot->DrawGraph();
?>
and the code the table page[PHP]
<?php
require("inc/conn.php");
$page = 7;
//get this page's content from the database
$sql = "SELECT * FROM tblpages WHERE pageID = " .$page;
if ($result = mysql_query($sql)) {
$row = mysql_fetch_array($result);
$pageHeading = $row['pageHeading'];
$pageContent = $row['pageContent'];
}
//build and issue query
$sql = "SELECT * FROM trackrecord ORDER BY date";
$result = @mysql_query($sql) or die(mysql_error());
$num=mysql_numrows($result);
mysql_close();
require_once('header.php'); ?>
<style type="text/css">
<!--
@import url("css/table.css");
-->
</style>
<div id="content_alert">
<div class="post1">
<h1><?php echo $pageHeading; ?></h1>
<table id="mytable" cellspacing="0" summary="">
<caption>Track record </caption>
<tr>
<th scope="col" abbr="date">date</th>
<th scope="col" abbr="currency pair">currency pair</th>
<th scope="col" abbr="recommended lot size">entry price</th>
<th scope="col" abbr="suggested entry">profit 1</th>
<th scope="col" abbr="suggested stop">profit 2</th>
<th scope="col" abbr="time of call">profit 3</th>
<th scope="col" abbr="valid till">daily net</th>
<th scope="col" abbr="target p1">total to date</th>
</tr>
<?
$i=0;
while ($i < $num) {
$field1 =mysql_result($result,$i,"date");
$field2 =mysql_result($result,$i,"pair");
$field3 =mysql_result($result,$i,"entry_price");
$field4 =mysql_result($result,$i,"profit_1");
$field5=mysql_result($result,$i,"profit_2");
$field6 =mysql_result($result,$i,"profit_3");
$field7 =mysql_result($result,$i,"daily_net");
$field8 =mysql_result($result,$i,"total_to_date");
?>
<tr>
<td><? echo $field1; ?></td>
<td><? echo $field2; ?></td>
<td><? echo $field3; ?></td>
<td><? echo $field4; ?></td>
<td><? echo $field5; ?></td>
<td><? echo $field6; ?></td>
<td><? echo $field7; ?></td>
<td><? echo $field8; ?></td>
</tr>
<?
$i++;
}
echo "</table>";
?>
<div class=""> </div>
<div style="float: left; width: 400px;">
<div><img src="includes/graph.php"></div>
</div>
</div>
</div>
<?php require_once('footer.php'); ?>
Bookmarks