Beispiel #1
0
    <script type='text/javascript' src='<?= BASE_URL ?>public/js/highcharts.js'></script>    
</head>
<body>

<h1>Custom Stats View Page</h1>
<p>A user can easily make custom stat viewing pages using the helper methods
    provided, custom stats (created in the 'stats' folder) and good ol' HTML</p>

<div style="width: 500px; align: center">
<?php

    //examples of how to manually render graphs

    $days = (int) (array_key_exists('days', $_GET)) ? $_GET['days'] : 60;
    $interval = 'daily';
    
    $futSched = new SonarStat('fut scheduled');
    print $futSched->renderGraph($interval, $days);

    $futs = new SonarStat('sent: fut to sender');
    print $futs->renderGraph($interval, $days);

    $futs = new SonarStat('validation completed');
    print $futs->renderGraph($interval, $days);

?>
</div>


</body>
</html>
Beispiel #2
0
	.smallbox > p {font-size: 9px; line-height: 1.5em; padding: 0; margin: 0;}
	.smallbox > .alert {font: arial 13px bold;  color: white; background-color: red; padding: 3px;}
	.graph_data { width: 110px; float: left; font-size: 10; margin-top: 100px; text-align: right;}
</style>
</head>
<body>
<h1>Dashboard</h1>
<p>The dashboard shows all of the events your a logging, plotted over time</p>
<p>Users can generate their own custom stats in the 'stats' folder. See this
    <a href="<?= BASE_URL?>public/custom-page.php">Example Page</a></p></p>
<?php 

$stats = SonarStatManager::getStatList();

foreach($stats as $stat):
	$graph = new SonarStat($stat['event']); 
    $hourlyValues = $graph->getStatValues('hourly', 12);
	$weight = $graph->getWeight();
?>

	<div class="smallbox">
        <div style="float: left">
	    <?= $graph->renderGraph('daily', 60, 'medium') ?>
	    </div>

        <div class="graph_data">
    	<p><strong>Past 12 hours: </strong><br />
        	<? foreach($hourlyValues as $date=>$value): ?>
        		<br /><?= date('g a', strtotime($date)) ?>:  <strong><?= $value ?></strong>
        	<? endforeach; ?></p>