//			hours	min		sec
    $time = 1 * 30 * 60;
    //15min
    if ($fromcreation < $time) {
        echo file_get_contents($cache);
        exit;
    }
}
require 'statsModel.php';
require 'templates/template.php';
require 'vendors.php';
$script = '<script type="text/javascript" src="js/awesomechart.js"></script>';
$out = Template::header("Statistics", $script);
$out .= Template::contentStart();
$results = new statsModel();
$stats = $results->getStats();
$out .= "<h1>General Info</h1><br/>";
$out .= "<strong>Total scans: </strong>" . $stats['total'];
$out .= "<strong> Distinct wifis: </strong>" . $stats['totalwifi'] . "<hr/>";
$out .= '<h1>Frequency Statistics</h1><br/>
		<div class="charts_container">
            <canvas id="frequencyCanvas" width="600" height="400">
                Your web-browser does not support the HTML 5 canvas element.
            </canvas>
		</div>';
$datas = "";
$labels = "";
$i = 0;
foreach ($stats['frequency'] as $frequency => $data) {
    if ($i > 9) {
        break;