Esempio n. 1
0
<?php

include $_SERVER["DOCUMENT_ROOT"] . '/admin/classes/classes.php';
// Include local class lib
$sess = new SessionData();
// Creates session object
if (!$sess->CheckValidAdminSession()) {
    // Validates Session
    $log = new log($_SERVER["PHP_SELF"], $_GET, $_POST, $_SERVER['HTTP_REFERER']);
    if (!$sess->CheckValidSession()) {
        header('Location: login.php');
    } else {
        header('Location: ../fb/bind.php');
    }
}
$db = new Database();
// Creates database object
if (!$db->connect()) {
    echo "<p>Error connecting to the database</p>";
}
//$log= new log('AdminIndex');
$stats = new statistics();
$getstatsbackdays = 60;
$daysago = 0;
$getstatsbackmonths = 24;
$monthsago = 0;
$active_users_graph = $pageviews_graph = $month_pageviews_graph = array();
while ($getstatsbackdays >= $daysago) {
    $datetopull = date('Y-m-d', strtotime("-" . $daysago . " days"));
    $active_users_graph[] = "['" . $datetopull . "', " . intval($stats->dailyactiveusercount($datetopull)) . "]";
    $pageviews_graph[] = "['" . $datetopull . "', " . intval($stats->viewcount($datetopull)) . "]";