Graphiken in den besuchercounter eingefügt
geändert: admin/phpcount/phpcountLog.php neue Datei: admin/phpcount/visitorCount.phplot.php neue Datei: phpLib/phplot/phplot.php neue Datei: phpLib/phplot/rgb.inc.php
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
$basePath = "/users/cwsvjudo/www";
|
||||
|
||||
require_once($basePath."/config/cwsvJudo.config.php");
|
||||
require_once($basePath."/ressourcen/phpLib/phplot/phplot.php");
|
||||
require_once($basePath."/ressourcen/phpLib/phplot/rgb.inc.php");
|
||||
|
||||
// getting a dbConnection
|
||||
try{
|
||||
$dbConnection = new PDO(
|
||||
'mysql:host='.$cwsvJudoConfig["db"]["host"].';dbname='.$cwsvJudoConfig["db"]["name"],
|
||||
$cwsvJudoConfig["db"]["user"],
|
||||
$cwsvJudoConfig["db"]["password"]
|
||||
);
|
||||
|
||||
$nodupesQuery = $dbConnection->prepare(
|
||||
"SELECT COUNT(*) AS anz, DATE(FROM_UNIXTIME( time )) as date FROM `phpcount_nodupes` GROUP BY date ORDER BY date DESC"
|
||||
);
|
||||
$nodupesQuery->execute();
|
||||
$nodupesList = $nodupesQuery->fetchAll(PDO::FETCH_ASSOC);
|
||||
}
|
||||
catch(PDOException $db_error){
|
||||
die( "Error!: " . $db_error->getMessage() );
|
||||
}
|
||||
|
||||
|
||||
$plot = new PHPlot();
|
||||
$data = array();
|
||||
foreach($nodupesList as $nodupesEntry)
|
||||
$data[] = array( $nodupesEntry['date'], $nodupesEntry['anz'] );
|
||||
$plot->SetDataValues($data);
|
||||
$plot->DrawGraph();
|
||||
Reference in New Issue
Block a user