|
{php}
function connectToDB( $dbName="" ) {
// These four parameters must be changed dependent on your MySQL settings
$hostdb = 'localhost'; // MySQl host
$userdb = 'root'; // MySQL username
$passdb = 'root'; // MySQL password
$namedb = $dbName ? $dbName : 'amember'; // MySQL database name
$link = mysql_connect ($hostdb, $userdb, $passdb);
if (!$link) {
// we should have connected, but if any of the above parameters
// are incorrect or we can't access the DB for some reason,
// then we will stop execution here
die('Could not connect: ' . mysql_error());
}
$db_selected = mysql_select_db($namedb);
if (!$db_selected) {
die ('Can\'t use database : ' . mysql_error());
}
return $link;
}
{/php}
{php}
// Connect to the DB
$link = connectToDB();
$strXML = "";
$datev=date("Y-m-d");
$do=mysql_query("select * from amember_dayservices where site_id='".$_GET['id']."'
and time_of_avg='".$datev."'");
while($row = mysql_fetch_array($do)) {
if($row['result']=='N')
{
$strXML .= "";
}
elseif($row['result']=='Y')
{
$strXML .= "";
}
}
//Finally, close element
$strXML .= "";
//Create the chart - Pie 3D Chart with data from $strXML
echo renderChart("FusionCharts/Column3D.swf", "", $strXML, "Time", 600,300, false, false);
{/php}
|
{include file="js.country_state.js"}
{include file="footer.html"}