<?php /* Smarty version 2.6.2, created on 2010-02-10 17:19:26
         compiled from show_uptime.html */ ?>
<?php require_once(_SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'escape', 'show_uptime.html', 30, false),)), $this); ?>
<?php $this->assign('title', 'show report'); ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "header.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "error.inc.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
<?php require_once(_SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.smarty_include_php.php');
smarty_core_smarty_include_php(array('smarty_file' => "Includes/FusionCharts.php", 'smarty_assign' => '', 'smarty_once' => false, 'smarty_include_vars' => array()), $this); ?>

 
<div id="content">		
        <div class="indent-main">
            <div class="container">
                <div class="col-1 maxheight">
                	<div class="box maxheight">
                        <div class="border-top maxheight">
                            <div class="border-bottom maxheight">
                                <div class="border-right maxheight">
                                    <div class="border-left maxheight">
                                        <div class="corner-top-right maxheight">
                                            <div class="corner-top-left maxheight">
                                                <div class="corner-bottom-left maxheight">
                                                    <div class="corner-bottom-right maxheight"> 
                                                        <div class="indent-box">
                                                            <img alt="" src="<?php echo $this->_tpl_vars['config']['root_surl']; ?>
/templates/images//1page_title1.gif" class="title" /><br />
                    <div class="container tail">
                                                            	
       <table><tr><td><!-- right top links -->
<a href="<?php echo $this->_tpl_vars['config']['root_url']; ?>
/logout.php">#_TPL_MEMBER_LOGOUT#</a></td>
<td><a href="<?php echo $this->_tpl_vars['config']['root_url']; ?>
/profile.php">#_TPL_MEMBER_CH_PSWD#</a></td>
<td><a href="<?php echo $this->_tpl_vars['config']['root_url']; ?>
/checks.php?id=<?php echo $_SESSION['_amember_id']; ?>
">Checks</a></td>
<td><a href="<?php echo $this->_tpl_vars['config']['root_url']; ?>
/contacts.php?id=<?php echo $_SESSION['_amember_id']; ?>
">Contacts</a></td>
<td><a href="<?php echo $this->_tpl_vars['config']['root_url']; ?>
/report.php?id=<?php echo $_SESSION['_amember_id']; ?>
">Report</a></td>
<?php if (count($_from = (array)$this->_tpl_vars['member_links'])):
    foreach ($_from as $this->_tpl_vars['u'] => $this->_tpl_vars['t']):
?>
<a href="<?php echo ((is_array($_tmp=$this->_tpl_vars['u'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
"><?php echo $this->_tpl_vars['t']; ?>
</a><br />
<?php endforeach; unset($_from); endif; ?>
</td></tr></table>
 <table class="vedit" width="80%">
        <tr>
            <td>
           <?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;
}
 ?>
<HTML>
<HEAD>
	<TITLE>
	
	</TITLE>
	
	<!--<?php echo ' --><script LANGUAGE="Javascript" SRC="FusionCharts/FusionCharts.js"></script><!--{literal} '; ?>
-->
	<!--<?php echo ' --><style type="text/css">
	<!--
	body {
		font-family: Arial, Helvetica, sans-serif;
		font-size: 12px;
	}
	.text{
		font-family: Arial, Helvetica, sans-serif;
		font-size: 12px;
	}
	-->
	</style><!--{literal} '; ?>
-->
</HEAD>
<BODY>

<CENTER>

<?php 
	
	// Connect to the DB
	$link = connectToDB();

	
	$strXML = "<chart caption='Site State Report' subCaption='' pieSliceDepth='30' showBorder='1' formatNumberScale='0' numberSuffix=' %'>";
        $datev=date("Y-m-d");
	
	$do=mysql_query("select * from amember_average where site_id='".$_GET['id']."'
            ");
	
		while($row = mysql_fetch_array($do)) {
			
	//if($row['result']=='N')
          //               {
                      //   $strXML .= "<set label='" . $row['time_of_check']. "' value='0' />";
            //             }
              //           elseif($row['result']=='Y')
                //         {
                          $strXML .= "<set label='" . $row['site_date']. "' value='" . $row['site_average_time'] . "'/>";
                    //     }
			
		}
	
	//Finally, close <chart> element
	$strXML .= "</chart>";

	//Create the chart - Pie 3D Chart with data from $strXML
	echo renderChart("FusionCharts/Line.swf", "", $strXML, "Time", 600,300, false, false);
 ?>
            </td>
        </tr>
        
</table>

<script type="text/javascript" src="<?php echo $this->_tpl_vars['config']['root_surl']; ?>
/includes/jquery/jquery.js?smarty"></script><!--<?php echo ' '; ?>
-->
<script type="text/javascript" src="<?php echo $this->_tpl_vars['config']['root_surl']; ?>
/includes/jquery/jquery.select.js?smarty"></script><!--<?php echo ' '; ?>
-->

<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "js.country_state.js", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>


                                                                <br class="clear" />
                                                            </div>
                                                            
                                                           
                                                           <!-- -->
                                                        </div>                                     
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "footer.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
